RGB Chroma Key Node Test-Windows Build (12 AUG 06)


(bob_holcomb) #1

I’ve updated my difference patch to be a little faster (not much, but some is always better than nothing). The spill suppression has also been “enhanced” a bit. The big change is I also added a new chroma keyer. It’s a true chroma keyer instead of a difference keyer and functions slightly differently and will be explained in a later post. It also is capable (marginally) at pulling keys with thier shadows and working with translucent materials. I removed the dialate/erode node from my patch since it’s commited to CVS and is included with this build. I also removed the info overlay node since I was for the plumineros guys and they went with something else. If anybody wants it, there is a patch for it in the patch tracker.

Current patch has:
-matte node menu group
-Difference matte node
-Chroma key matte
-YUV color space seperator node
-YUV<->RGB conversion functions
-YCbCr color space seperator node
-YCbCr<->RGB conversion functions
-RGB spill correction

Cheers,

Bob

http://scourage.servebeer.com/art/screenshot1.pngUpdated Link (27 AUG 06-2315 EST):
http://scourage.servebeer.com/art/matte.patch

Latest (VS7.1)Windows build (12 AUG 06-1830 EST)
http://scourage.servebeer.com/art/blender_matte.zip

Latest (32 bit) Linux build (27 AUG 06-2315 EST)
http://scourage.servebeer.com/art/blender_matte.tar.gz


(bob_holcomb) #2

After a bit of research, I’ve come up with 5 other Matte generation nodes that I’m going to try and implement:

-A much better chroma key matte
-luminence matte
-YUV matte (I already wrote a seperate to YUV node as well)
-color difference
-difference (not color difference)

Each has thier strengths for pulling mattes from images, I guess it’s just a mix to get a good matte for compositing images. If anybody has some test images that I could play with/use for examples please let me know.

Cheers,

Bob


(mattebb) #3

Oh, nice one! I was going to have a play with this sort of thing, but I know next to nothing about it myself.

Brecht already coded a dilate/erode node which I have the source for here, I can make a patch for it soon.

Also Primatte has some information about their process here if it interests you:
http://primatte.com/p_whitepapers.cfm

And this one’s interesting too http://www.cs.toronto.edu/~arnold/320/Readings/Smith-SIG96.pdf


(tedi) #4

why not make a “plugin” system for nodes? aka “nodeplugs”?

so there would be bread/butter nodes supplied, and other would be plugins?
(eh, I know, I have just written myself in history … blah-blah … )


(mattebb) #5

Well, some reasons to the contrary are that blender is open source, and that there’s less need for a separate plugin system. Nodes are incredibly easy to code in the blender source A simple node would only take you about 20 minutes. There’s also a lot more flexibility in having it built in, since you can do custom and well organised UIs etc. Witness the nightmare UIs of current sequence plugins. It also makes things more difficult to change/mutate/fix if there’s an API specification that should be kept compatible, and with the compositor in such an early stage, this may hamper it’s growth. Anyway, I don’t think anyone would be against a C node plugin API, but I’m not sure there’s a huge priority to develop one at this stage either.


(bob_holcomb) #6

Broken,

Thanks for the papers they should help a lot. I was thinking that I could make a new menu item under the add menu for mattes and put the nodes there. It took me 30 minutes to add a YUV conversion node last night. Now that I have the basics down, I expect that a couple of these might only take a little bit longer to build. The dialate/erode tool would work great with some matte nodes. If you can send me a patch, I’ll add it to my tree and create a big patch of all the new nodes/menu for the patch tracker.

Cheers,

Bob


(Jason H) #7

…and just how do I get this into blender? Do I need to get a C++ compiler?


(bob_holcomb) #8

you’ll need a C++ compiler and the source. I use linux (64 bit), so scons works great for me. you will need to patch the source tree with this patch, then build. I’ve actually done a bit more work today on a couple of new nodes (YUV keying) and a menu bar. Maybe some kind soul would do a build for windows?

Cheers,

Bob


(bob_holcomb) #9

For those wishing to patch thier source and try this out, here is an updated patch that adds the following (I think I finally got my terms right):

-matte node menu group
-RGB difference matte node
-YUV difference matte node (also called luminence matte?)
-YUV color space seperator node
-YUV<->RGB conversion functions
-YCbCr difference matte node (chroma key)
-YCbCr color space seperator node
-YCbCr<->RGB conversion functions
-Blue spill correction
-Green spill correction

I’d love to have some feedback. Also posted in the patch tracker.

Cheers,

Bob

http://scourage.servebeer.com/art/matte.patch


(bob_holcomb) #10

Just a couple of the nodes in action:



Cheers,

Bob


(mattebb) #11

Awesome! I’m a bit busy atm so that dilate/eroade patch may be a couple of days in the making. I also see a reasonable amount of green reflection in that pic, how about some kind of tolerance options in the spill node? (and probably condensing the blue and green ones into a single node with an option for which colour would be nicer)


(bob_holcomb) #12

Broken,

I’m still thinking of how to best add a user input to the spill suppressing nodes. Combining them is probably smart, they’re virtually the same code. I may get to that tomorrow.

Cheers,

Bob


(bob_holcomb) #13

Time for a new patch (follow link in first post). Combined color spills into one node. Changed algorithm a little to allow user to enhance the spill above and beyond the normal calculation. I’ve started a tutorial for how to do garbage matte+green screen+compositing.

Cheers,

bob


(POWER 3D) #14

Looks good, I have not tested it yet, but this looks like it will help with what I am doing. I cant compile it right now, so I may just wait until someone compiles a version that I can download.


(Rangel) #15

Bob, thank you very much! Those keyers are very useful…
Since I don´t compile, I´m looking foward to using them!


(POWER 3D) #16

So is recompiling blender the only way to add these patches to blender? or how do I add them?


(bob_holcomb) #17

Power 3d-
Recompiling blender is the only way because there isn’t a node plug-in system (maybe in the future).

Rangel-
I can also post a link to my binary, but it is a dynamic link 64-bit linux version. I might be able to make a windows(/spit) build tonight.
EDIT: I have the windows source patched and once I get the prebuilt libs from blender CVS (tonight) I will build a windows binary. I also found a bug and fixed it, the patch at the top of the page is current.

Also, I noticed the link at the top referenced the old patch, so that’s been corrected.

Cheers,

bob


(rexprime) #18

this looks promising


(mattebb) #19

Hi bob, here’s my patch. I was lazy and just included all my changes so you get Combine RGBA too :slight_smile: Credits go to Brecht for Dilate/Erode.

https://projects.blender.org/tracker/index.php?func=detail&aid=4727&group_id=9&atid=127

Was thinking a median node might be useful for cleaning up leftover noise/grain from a key too. Should be easy, but need time.

cheers

Matt


(Jason H) #20

so…what am I looking for here? a .dll?

I’m so confused…(non compiler guy here).:o