so we have this simple project to do in MAX with Jitter: We have a few different black forms we film in front of a bright background. We want the background to take on a specific color and a specific music to play in the background to every form.
My idea would be to change the whole scene somehow to black and white, 0 or 1, then somehow identify the shape and with the data play the specific music and somehow make everything that is indicated as 1, white, in the picture to take on a color, say red.
My problem is, I don’t know the objects to do this. The black and white part is surely the easiest. But can you tell me an object to identify a shape on the screen? And more importently, there has to be a way to color the background, but I have no idea how to do it.
I really would appreciate any help I can get.
+ Reply to Thread
Results 1 to 11 of 11
Replacing the background color is easy.
Thx for the answer!
The objects are black sillhouettes of the big bad wolf or little red riding hood or the hunter or the grandma. So yes, they are complex. They rotate a bit, can be at any position, but should not vary in size much. And there are indeed sometimes more than one of them in the picture.
I am very glad to hear that at least the color replacement will be easy. Can you tell me the object, which does that?
Thank you very much for your help!
Last edited by michixlol; 15th Sep 2018 at 07:58.
I don't know anything about the software you're using. But most editors have the ability chroma key -- make certain colors transparent. You would then replace the transparent areas with the color you want via an overlay. An example:
wolf on white background (already binarized to black/white):
a red image to use as the background color:
Overlay the red image over the wolf image using the wolf image itself as a transparency mask (usually called an "alpha channel" or matte in video):
In short, all the white pixels have been replaced with red pixels.
Last edited by jagabo; 15th Sep 2018 at 09:08.
Ah, I see. Yes I actually managed to change the background color. And I rly appreciate you trying to help, even though you don't know MAX. Now I only have to do the identification and the music playing..
And I did this too Think the hard part is done
So the software you're using has the ability to identify your shapes? Nice.
Yes. I made the video binary through objects and used the amount of pixels that are not zero and the amount of edges or something to identify the different shapes.
It sounds like you may be using edge detection (ie, pixels whose intensity differs significantly from those around it are part of an edge) followed by the average brightness. For example, an edge mask built from the earlier wolf image:
White represents edges, black not edges. Bigger objects and objects with more complex outlines will have more edge pixels and hence the edge images's average brightness will be higher.
You might be able to streamline that by bypassing the binarization step. Edge detection will probably work on the original image too -- since you have dark objects on a bright background. In fact, you may not need edge detection at all. The objects themselves may be different enough in size that just the average brightness of the original (or binarized) frame will let you recognize single objects.
Note that I'm using "average brightness" here but since the the pixels that make up the frame are (more or less) black or white and there is a fixed size frame the avarage brightness is a proxy for the number of white pixels, or the percentage of white pixels, etc.
okay, but.. to be honest, I am rly glad it even works as it does x)