We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello Processing Community,
I have created a sketch with kinect , in which The background is black and , simple image is displayed inside the user's silhouette. My question is that, is it possible to play a movie inside the user's silhouette? If yes, then please give me your useful suggestions...
I'm trying my best for this stuff, but if I"ll get any help, it would be great....
regards...
Answers
Hello !
It's possible And it's actually not very hard since you know how to put an image inside the silhouette.
You just have to draw your video in an image and use that image in your silhouette :)
Hi, Yes, I have tried that as you suggest me @tlecoz, ...
This is the code to display the image inside the user's silhoutte
But, when I tried to place an image of movie inside the user's silhoutte, the sketch has stop running.
hmmm it's very weird !
Try to draw your video inside the image "userImage" and use the exact same code, it should work.
"I tried to place an image of movie inside the user's silhoutte" Can you show us your code
Yes , @tlecoz
Here is the code:
Then ,it gives an ArrayIndexOutOfboundException...
Hello !
As I said 2 times already... You need to draw your video inside the image you're using....
Right now, your video has not the same dimension of your image, then you get an outOfBoundException. If you draw your video in the image, there will be no problem anymore because there will be no dimension problem anymore.
Then... just draw your video in your picture with PImage.copy, and use your image without change anything.
Hi,
As you told me that why , an array ewxception is thrown , that I understand , but You are saying that, draw the movie in the user image, Sorry , but seriously I don't know how to draw a movie inside the user image with the help of PImage.copy method.
something like that
image.copy(video,0,0,videoWidth,videoHeight,0,0,imageWidth,imageHeight);
hi @tlecoz,
with the help of yours , the userImage is displayed like this:
()
Movie is running inside the user Image, but , b'coz of the black lines in the user'silhoutte, we can not see the movie properly.
Is it bcoz of interlace of the movie, or bcoz of the user's depth image?
Hmmm.... I think - but not sure - it's because your video is scaled to fit in your picture. Then, the height of each pixel is bigger than it should be
try to apply the copy like that and tell me if it works
The code should (I don't test it) scale your video to have the same height than the image, center the video in the image (and then crop the left/right border).
I think it should be better now
Hi, @tlecoz, It gives the same result. . .
Can you send the whole code ?
Yes @tlecoz,
This is the updated code:
Hi @tlecoz,
Movie is playing inside the user's silhoutte, I have just used 640x480 movie.
Sorry I don't know...
I met that problem not so long time ago with a kinect project too, but I can't remember how I made or even if I successed...
Hey, @tlecoz
please don't be sorry, you helped me to draw the movie inside the user's image.. In fact, Thank you for helping me.
hi @tlecoz , Is it possible to assign different images or videos to the different user's silhouettes ?
e.g, 1st user's silhouette will get 1st image, 2nd user's silhouette will get 2nd image, 3rd user's silhouette will get 3rd image, 4th user's silhouette will get 4th image ...
and so on ...
Hello
It's possible :)
In a first time you need to know what color are used for the silhouette. Once you get it, you only have to add a condition
Hi @tleccoz, You mean to say that, First I create an array of color, n try to see that, which user get which colour, n then apply your logic?
Can we have the full code?
https://forum.processing.org/two/discussion/17057/spout-and-videoexporter-enabled-kinect-masker#latest