Comp Nodes Green Screen test

Hey guys, This is a test of the keying abilities within blender. I’m not an experienced keyer, and this is a terrible result. But it’s a try!
Can anyone tell me how I can make this better?

Thanks!

And Here is my Nodes Setup:

A few points:

  • using the difference key was, I found, a lot more effective. In general, its YUV mode worked best for me - I was using DV video.
  • the colour spill should go after the keys - it gets rid if any annoying little bits round the edge, I believe (he says, probably showing his ignorance). If you do it before, it will reduce the colour of the bits you want to remove, giving you a bad result. Your colour spill should be set to G. You don’t need to turn up enhance at all. I sometimes find that colour spill isn’t really necessary, the difference keys give such good results.
  • to avoid having to turn up the tolerances too much, which can give horrible blocky results, use several difference key nodes in a row, feeding into each other - then choose several different greens that appear in your background (use the colour picker).
    Hope that helps!

Change Color Spill to G with higher Enhance and increase your Acceptance in the Chroma Key.
After this instead of your current set up,
use a color ramp to invert your Matte,
and use Mix with the inverted Matte as a factor to fully overlay your people on the Red.
Hope this helps.
If this is too complicated let me know and I’ll give a more precise step by step procedure.

Post a frame so we can play with it :wink:

indigomonkey is right. Use the difference key instead. You can see inside the Chroma Key that it pulled part of the shirt as alpha.
Use a series of Difference keys.

Ok guys, thanks for your help! I did the multiple difference key method, and it worked fairly well, except the mat was SUPER blocky and pixelated, so I don’t really know what to do about that.

But!
Here’s some sample footage to play with. Feel free to do whatever you want with it! Royalty Free! I shot it for a contest over at cgTalk.
Anyway, if you get something that looks good, please post it here with a blend for the good of the community, or at least a snap of your nodes setup.

Thanks!

Have fun!

http://www.ponymoon.com/murphy/sampleFootage.mov

(H.254, 5.4 megs, 720 x 480 DV)

1 Like

Thanx. I’ll see how I can help.

It can be very hard (at least for me) to visualize what is actually happening to the data as it is passing through a web of nodes. But you have to think of it as a production line.

When you have to do chroma-key with live video, remember that what you want to come up with is the clean equivalent of an alpha-based mask.

The first step is going to be, of course, the initial extraction. Downstream from that are going to be stages to try to improve the mask. (Remind the actors not to wear green shirts.) Color-bleed, reflected-light issues, whatever are handled now. Build the set of nodes to this point first, and look at the result before proceeding.

When you like the mask, despite its rough edges, you now build onto what you’ve got to provide the illusion of alpha… a blur-filter, for example. But you want the blurring to pretty-much occur inward, and over a very, very small edge-area.

Finally, you composite that mask in the usual way.

Looking at what I can see of your node-outline, I think that your troubles clearly began with your original green-screening. Look at it, as a computer might do, and you’ll see that the tones of the actor’s faces are very similar to those of what’s supposed to be the mask. Both in color and in contrast, they’re almost the same.

When you are lighting the background screen, you want all the distinction you can possibly get. The background color should be noticeably different. It should be noticeably brighter, the color extremely uniform, and not reflecting either its light or its color onto the actors.

Best place I know of to get that? Your local community theatre on a nice Thursday morning. They drop a flat at the back of the stage, twenty or thirty feet back, light it up with rows of lights top and bottom, back and front. Then, down-stage-front, they light you.

Wow! thanks for that wonderful explanation sundials! I shall try and do better next time!

i noticed you mentioned DV and pixelated, all in the same breath. See the matte nodes Tutorials off the wiki page, as there is some very helpful info on nodes there to blur the one of the channels from DV footage…

removed for clairity

My solution:


Your green screen footage really very good for not having a multimiliion dollar setup. I didn’t check all the scenes (like the one with the box), so if you find this setup doesn’t work out of the box, you can chain together some difference nodes to remove the extra green parts.

Lets go through it:

The top layer from left to right starts with your source footage. I then pull this into a channel keyer that is setup for the green channel of an image in RGB color space. I then pull the matte (not the image) out of this node to a color ramp to clamp anything that is not white to black. This node then goes to a dialate/erode node that I have set to -1 pixel to erode the key a smidge. I then blur the mask 2 pixels to softly remove the hard edges (which makes it mix with the background a bit easier). Now to next row of nodes.

The second row of nodes is pulling from the original image to a difference node set to look for the color black. This is to mask out the black bars at the top and bottom and is also done in RGB color space. I then erode this mask by -1 pixel, but don’ blur since I’m not worried about harsh edges (it’s like a garbage mask). I then multiply this with the mask from the first row to get a complete mask.

In the third row, I use a setAlpha node to use the combined mask I just created to become the alpha channel of the original image. I then run this through color spill node to remove any left over green light that may have spilled on foreground objects. I then use an alpha over node with an image I rendered for a background and output to the composit output node.

Wheew! What a mouthful.

let me know if you have any questions or improvements.

cheers,

Bob

WoW! Bob you are amazing! thanks so much! that worked great, and I have the feeling that with better footage, it would dominate. :slight_smile:

Here’s my result with your method:
http://i24.photobucket.com/albums/c20/murphyRandle/nodesBestResult.jpg

Muuuuuuch better.

And here’s my nodes setup:
http://ponymoon.com/murphy/NodesBestSetup.png

one of the differances is that instead of using a differance key for the letterboxing, I just drew a garbage matte with splines in the 3D view, and pulled that into the nodes from the scene as a brite white mat. then I used that as a garbage matte.
add a little color correction and VIEEWODALSA! ( that was supposed to be french) :slight_smile:

Looks great! You don’t have to follow my style exactly. If it looks good, it is good. I would try to color correct the two guys to match the background. Try matching the whites and blacks, then the reds, blues and greens. Also you have some green spill on the left guys arm. You may need to play with the erode/blur combo

Cheers,

Bob

Corey: I couldn’t seem to get any better result than you did. There were a couple of problems that I ran into.

  1. The greenscreen was really good but you should add just a little more light when you record. This will help the Keyers tell what is and isn’t green. A really dark blue is close to a really dark green.

  2. Your actors need to wear clothes that are as far as possible from green. Your guy on the left has a shirt on that doesn’t do to well under keying. It appears as though the stripes in the shirt are a yellowish/greenish.
    Doesn’t go well with the green background.
    In the future this should help to remove blockiness because you can turn your tolerence up higher to get a more defined line.
    Hope this helps!

Thanks for the footage: - I’ll be trying out green-screening myself soon.

I hate to say this, but I don’t think you really could colour-match those photos of you to that background. You are under defuce light, in 3D terms radiosity rendering, where as your background is under direct sunlight, with almost black shadows.

Hey thanks guys! yes, next time there will hopefully be a bit better setup, with a bit better clothes too.
I now have access to a Panasonic HD cam which also shoots in 4:2:2, and that is Muuch better for keying. so when I get some more good samples, I will post one so that peoples can play with it. (probably in a separate thread)

about matching, I was thinking about this, I know it would be a pain, but for matching the light, in theory you could reconstruct a crude model of the subject, and light it, then use the shadows for a shadow map on your video.

That’s actually an idea for production maybe. When shooting on green screen, light your characters totally diffuse, and (if you are rich enough) setup some type of mocap rig (maybe you would need two takes, one in the costume, one in the mocap suit) but then you would have digital representation of your motion that you could relight however you desire without having to rotoscope! Yay!
probably unrealistic, but hey! I can dream can’t I?

Yes, you can color match your scene. You need to match your whites and your blacks then you need to match your colors. Please post your background (I already have your foreground) and I’ll show you what I mean.

cheers,

Bob

Thanks Bob! I want to know how to do that, and I would love it if you would show me how.
Here’s the image:http://www.sxc.hu/photo/603001.

Ok,
Well, I went and took some footage with the cool camera, and researched some ways to enhance the key, and I came up with this!
http://i24.photobucket.com/albums/c20/murphyRandle/Picture1.png

I’m pretty proud of myself I must say. Edit: I said I would hopefully be posting a video tutorial on this subject, but I probably won’t be unless someone expresses real interest. Thanks!

Please let me know what you think!
thanks!
Murphy

Wow, looks great. And I want your camera.