VideoHelp Forum
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. Member
    Join Date
    Sep 2018
    Location
    Österreich
    Search PM
    Hi,

    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.
    Thank you!
    Quote Quote  
  2. Originally Posted by michixlol View Post
    somehow identify the shape...
    This may be difficult. How complex are the shapes? Can they be be at any position, any size, any orientation (rotation in 3 dimensions) and with projection distortion? Will there be multiple objects in the image? It's easy if the shapes appear individually, are very different, always in the same position with the same size and with no rotation. It's very difficult at the other end of the spectrum.

    Replacing the background color is easy.
    Quote Quote  
  3. Member
    Join Date
    Sep 2018
    Location
    Österreich
    Search PM
    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.
    Quote Quote  
  4. 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):

    Click image for larger version

Name:	wolf.png
Views:	285
Size:	3.5 KB
ID:	46728

    a red image to use as the background color:

    Click image for larger version

Name:	red.png
Views:	314
Size:	1.4 KB
ID:	46729

    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):

    Click image for larger version

Name:	bg.png
Views:	329
Size:	3.4 KB
ID:	46730

    In short, all the white pixels have been replaced with red pixels.
    Last edited by jagabo; 15th Sep 2018 at 09:08.
    Quote Quote  
  5. Member
    Join Date
    Sep 2018
    Location
    Österreich
    Search PM
    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..
    Quote Quote  
  6. Yes, some editors have a simple "replace this color with that color" filter.

    Originally Posted by michixlol View Post
    Now I only have to do the identification
    That's the hard part. I don't know if the software you're using has that ability. It's the type of thing one might use a neural network for.
    Quote Quote  
  7. Member
    Join Date
    Sep 2018
    Location
    Österreich
    Search PM
    And I did this too Think the hard part is done
    Quote Quote  
  8. So the software you're using has the ability to identify your shapes? Nice.
    Quote Quote  
  9. Member
    Join Date
    Sep 2018
    Location
    Österreich
    Search PM
    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.
    Quote Quote  
  10. 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:

    Click image for larger version

Name:	edges.png
Views:	265
Size:	4.4 KB
ID:	46732

    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.
    Quote Quote  
  11. Member
    Join Date
    Sep 2018
    Location
    Österreich
    Search PM
    okay, but.. to be honest, I am rly glad it even works as it does x)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!