prepareCanva(mlpose = this) 
	{
		mlpose.ctx.clearRect(0, 0, mlpose.canvas.width, mlpose.canvas.height);
		
		let im = mlpose.media;
		
		// If filtering mode is on
		if(this.settings.filter && mlpose.segmentationImage.raw){
			// UNET image is 128x128
			im = mlpose.imageDataToCanvas(mlpose.segmentationImage.raw.backgroundMask, 128, 128)
			mlpose.media.setAttribute('class', 'hide');
		} else {
			if (this.settings.hideVideo) { 
				im = mlpose.canvas;
				mlpose.media.setAttribute('class', 'hide') 
			};
		}
		
		// draw the resulting image
		mlpose.ctx.drawImage(im, 0, 0, mlpose.canvas.width, mlpose.canvas.height);

	}
/* 
    * Preparing the canva for use
	* @mlpose: MlBody object is passed to the method
    */
Preparing the canva for use
@mlpose: MlBody object is passed to the method
Preparing the canva for use @mlpose : MlBody object is passed to the method
prepareCanva(mlpose = this) 
	{
		mlpose.ctx.clearRect(0, 0, mlpose.canvas.width, mlpose.canvas.height);
		let im = mlpose.media;
		if(this.settings.filter && mlpose.segmentationImage.raw){
			im = mlpose.imageDataToCanvas(mlpose.segmentationImage.raw.backgroundMask, 128, 128)
			mlpose.media.setAttribute('class', 'hide');
		} else {
			if (this.settings.hideVideo) { 
				im = mlpose.canvas;
				mlpose.media.setAttribute('class', 'hide') 
			};
		}
		mlpose.ctx.drawImage(im, 0, 0, mlpose.canvas.width, mlpose.canvas.height);
	}
prepareCanva ( mlpose = this ) { mlpose . ctx . clearRect ( 0 , 0 , mlpose . canvas . width , mlpose . canvas . height ) ; let im = mlpose . media ; if ( this . settings . filter && mlpose . segmentationImage . raw ) { im = mlpose . imageDataToCanvas ( mlpose . segmentationImage . raw . backgroundMask , 128 , 128 ) mlpose . media . setAttribute ( 'class' , 'hide' ) ; } else { if ( this . settings . hideVideo ) { im = mlpose . canvas ; mlpose . media . setAttribute ( 'class' , 'hide' ) } ; } mlpose . ctx . drawImage ( im , 0 , 0 , mlpose . canvas . width , mlpose . canvas . height ) ; }
Preparing the canva for use
 @mlpose: MlBody object is passed to the method
Preparing the canva for use @mlpose : MlBody object is passed to the method
// If filtering mode is on // UNET image is 128x128 // draw the resulting image