I am building a Javascript library which takes an image as an input, the output image will have all the human skin blurred like below.
I have got this script in python, which is working perfectly (example below) and I am converting it to JS using Opencv.js. The issue is I am not able to replicate the following line of code in Javascript.
out[global_mask>0] = blur[global_mask>0]
Here,
- out: original image
- global_mask: black and white image where all the skin is white and other parts are black
- blur: blurred copy of the original image.
Can someone please guide me on this, I have tried creating an ROI on the original image and tried placing the black and white image over it. In my mind the path to achieve this is
- Make all the black pixels in the black and white image transparent
- Replace the white pixels in the black and white image with the pixels of blurred image at same position.
- Place the new image over the original image.

