We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I want to show this sea image that I attached (only)when I (or some people) appear on the screen. (I mean, the image should appear in my silhouette.)
I tried to make the code by using the example 16_06(green screen) and 16_12(background remove).
But I can't do it. I don't know A to Z...
How can I make this code? I'll thank you to make the complete code or teach any part of the code...
I will attach some picture that help you to understand what I want to do.. it named "what I want to do.jpg"
please help me...
Answers
Challenge #1: In your incoming video, what do you have in the background? Are you going to have a green screen?
Check this: https://forum.processing.org/two/discussion/22054/chroma-key#latest
Kf
Actually, I want to place this city image in the background..! I will comeback after see the link that you attacted. please don't go until then :((
I'm so sorry but I can't understand the code at all .. Isn't the code place some picture instead of the greenscreen? I tried to put the ciry image ("0.png") on the code that you linked. I successed to place the city image on the background. but, on the screen, my silhouette don't appear.. I want to be shown on the screen..
how can I place the picture (city or sea image) + to be shown on the screen..?
what I know about processing is almost nothig... please teach me..
There is some effort to get this working. Do you know how Chroma key works? It is the same effect they use to present the weather forecast in the news. However, I am not sure if it applies to your case since you didn't provide enough details of exactly what you have (in code and in your setup) and how it will be combined at the end. Also, it is important to know if the silhouette is constant or if it dynamically changing. The challenge here is to discriminate the silhouette. Even if the silhouette is from a static snapshot, there is not easy way to differentiate between the silhouette or the background if you don't follow some strict rules.
So your image is from video? What have you done so far? Show your code.
This is exactly implied from your part that people here in the forum knows what you are talking about. But we don't know anything about these examples. This is where you need to provide proper references and details.
The link I provided above will only work if you have a green screen in your video.
Kf
this is the code that I made
and the example 16-06 is,
and the example 16-12 is,
and the silhouette is dynamically changing..!
Thank you for sharing the code. In these two samples, you are discriminating against a threshold value. Using a single value to discriminate is very challenging unless you follow a setup similar to the chroma key where your background does not change AND it has a single well define color.
There is another approach. Assuming your background is the same, you can start your sketch by capturing your initial image (image at time zero) with no people on it. Then, for every new image you get, you subtract this image to the initial image. The resulting operation will provide you an image with values either close to zero OR values larger than zero. Values close to zero means that those pixels in the new image and the background image are very similar. This should be zero in theory but in practice there is also some deviation from zero. In contrast, values away from zero in your operation means that those regions in the new image differ substantially from the first image. Those pixels are your silhouette... in essence.
Let's call diff image the resultant image [step 1] of the operation {init-current} image. What you need to do[step 2] is traverse the diff image and set to zero if the pixel position is close to zero Otherwise, set that pixel to 255.
Then [step3] you use your city image, you ocean image and this processed diff image using the mask() function as described here: https://processing.org/reference/PImage_mask_.html
Kf
Thank you for help. I understood the first paragraph but.. How can I capture my first image? by pressing the mouse on the empty screen?
or are there some code to make it?
One way to do it is shown in the backgroundSubtraction example that comes with the video library. In your processing IDE, go to File >> Examples and then go to Libraries>>Video>>Capture>>backgroundSubtraction
I just wrote an example using the mask function. You need to focus only on the draw function of the demo as the other parts of that code will change in your case: https://forum.processing.org/two/discussion/23093/brightness-pixel-doesnt-work
In your case, the tiny non-filled circles will be your ocean theme. The big white circle will be your "inferred" silhouette. The background image (not used here directly) will be your city theme.
Kf
I understood your explain but I can't apply it to my code.. :(( :(( :(( I can't understand what code make the big white circle, what code make the background image, what code make the tiny non-filled circles ........... please..... please help me.........
it's the image what I want to put on my code.. it's okay instead of real my silhouette, put the big white circle.... at least, I just want to make the different image between background and indoor of some shape.... anyone help me....... please
This is the modified version. No silhouette but the mixing part.
Kf
Wow.. Thank you so much!!!!! thank you!!
@rja -- one key to understanding @kfrajer's image masking demo above is that you are combining the
mask()
reference example with thePGraphics
reference example.For another very simple example of this concept. see: