Is there any way to implement invisibility using opencv js framework

First of all do you mean using p5.js? The category you chose is Processing (Java) so it would be helpful if you change the category of the post. Also if it’s “any” javascript framework, I don’t know if this is the best forum to ask - so I assume that you are using p5.js somehow.

My question would be what you mean by “invisibility” (at first I thought you are talking about HTML/CSS invisibile :laughing:). The link seems to be using color key - and in case of green color, it is called chroma key. Here’s what I did before

In this case I used shader (I used PShader in Processing but p5.shader in case of p5.js) because it performs fast enough in real time compared to OpenCV (I ported one from shadertoy). But if you are not familiar with it, I recommend iterating over pixels by loadPixels and check if it’s close to green (or other color you want to mask) by checking the “distance” between colors and if they are close enough, replace the pixel with another color from an image, and at last run updatePixels. This way it’s slower but you can see the concept, and for a simple example you don’t need OpenCV.

But… this is actually the opposite of being invisible as you make the background or the blanket invisible, not yourself. This is actually tricky because if you want to be “perfectly” invisible, you can take a photo with a webcam without you and claim that there is invisible you in the photo. I know it’s dumb, but actually that’s why I’m asking what you mean by invisible.

If you want to make “special effects” like anime or film, you need to look into body tracking and computer graphics (like, again, shader). Here’s a good example that uses iOS hand tracking

And perhaps it’s not impossible to do it in p5.js. Thanks to ml5.js BodyPix you can track the whole body. So in theory you can create a similar effect, but I don’t know if browsers are powerful enough to handle both tracking and “realistic” rendering at the same time.

also Dr Inami’s work is interesting:
https://www.otaquest.com/masahiko-inami-thermo-optical-camouflage-interview/