Class: BodyMaskHDPlugin
@geenee/bodyrenderers-common.BodyMaskHDPlugin
Segmentation mask upscale plugin
Performs smart upscaling of a segmentation mask on a pixel level using input image as a context provider. Increases the resolution of a segmentation mask preserving the consistency of foreground and background regions. BodyMaskHDPlugin is a processing (pre-render) stage plugin that can be attached to a @geenee/armature!ShaderRenderer. High resolution mask will be added to @geenee/bodyprocessors!Pose of tracking results and can be used by plugins next in the rendering pipeline. Higher resolution segmentation increases accuracy of patching and occluder components of the pipeline. Evaluation of body segmentation must be enabled when calling init() by setting @geenee/bodyprocessors!PoseParams#mask flag.
Hierarchy
-
↳
BodyMaskHDPlugin
Constructors
constructor
• new BodyMaskHDPlugin()
Constructor
Overrides
Properties
loaded
• loaded: boolean
Loaded state
Inherited from
ordinal
• ordinal: number
Ordinal number
Inherited from
renderer
• Protected
Optional
renderer: Renderer
<PoseResult
>
Renderer loaded the plugin
Inherited from
Methods
dispose
▸ dispose(): void
Dispose video plugin
Returns
void
Inherited from
load
▸ load(renderer
): Promise
<void
>
Initialize plugin
Initializes resources required for shader effect.
Parameters
Name | Type | Description |
---|---|---|
renderer | Renderer <PoseResult > | Renderer this plugin is attached to |
Returns
Promise
<void
>
Promise resolving when initialization is finished
Overrides
setupCamera
▸ setupCamera(ratio
, angle
): void
Set camera parameters
Could be overridden to adjust plugin's pipeline.
Parameters
Name | Type | Description |
---|---|---|
ratio | number | Aspect ration of input video |
angle | number | Vertical field of view in radians |
Returns
void
Inherited from
setupVideo
▸ setupVideo(size
): void
Set video size
Could be overridden to adjust plugin's pipeline.
Parameters
Name | Type | Description |
---|---|---|
size | Size | Resolution of input video |
Returns
void
Inherited from
unload
▸ unload(): void
Reset plugin
Releases all resources and instances created in load().
Returns
void
Overrides
update
▸ update(result
, stream
): Promise
<void
>
Process the image
Performs smart pixel-level upscaling of a segmentation mask to a higher resolution. Adds evaluated HD mask to tracking results.
Parameters
Name | Type | Description |
---|---|---|
result | PoseResult | Results of video processing |
stream | HTMLCanvasElement | - |
Returns
Promise
<void
>
True on success, false otherwise