Home

Bad seams with Keying node
Closed, InvalidPublic

Description
Hi all,

the new Keying node has a problem with colored edges after pulling a matte from a "perfect" greenscreen.
The attached file shows the problem.

I believe this can be done better, I will attach a patch soon.

till then, David.
erwin94 (David M) set Type to Bug.Via Old WorldOct 6 2012, 7:32 AM
erwin94 (David M) added a comment.Via Old WorldOct 6 2012, 7:56 AM
Here is a patch for the problem.

A couple of notes:

This works better because the factor fabsf(1.0f - val) is taken out of the saturation
equation, making it linear. This creates a different problem, unsaturated colors are not
keyed anymore, this is fixed by adding a maximum norm luminance key after the
saturation key. This should also make the overexposure check redundant. Lastly, the
if block is replaced by a CLAMP macro, making it much shorter.

I have done quite a lot of tests of this method, and I feel that keyers in other software
work similarly (especially concerning the linear nature of the key, resulting in clean
mattes in perfect conditions).

thanks, David.
Attached an image showing the old key, the source and the new key (in that order).
brecht (Brecht Van Lommel) added a comment.Via Old WorldOct 8 2012, 2:01 PM
Regarding the patch, I suggest not using macros this way, because this gets expand and the math operations will be done more times. Also means the comments are lost.

Probably this patch needs some good tests on Mango shots, I know Sergey experimented with many formulas so there might be a reason this code is here.
Thanks for looking at the patch. I attached a new version that fixes the issue with the macros.
In my opinion the comments are not really that useful, as the first one does not apply anymore,
and the others basically say "clamp to 0-1 range".

I tested this with two of the mango shots, and various other shots in my own projects and I
feel the results are consistently better, especially when combined with a screen subtraction
(hint at my other patch: http://projects.blender.org/tracker/index.php?func=detail&aid=32797&group_id=9&atid=127 ).
sergey (Sergey Sharybin) added a comment.Via Old WorldOct 23 2012, 7:03 PM
Hi,

Checked the patch. It behaves better with the scene you've attached, and behaves pretty much the same on mango files. However, I wouldn't consider it behaves much better in plates from holllywood camera works. You could check it on "godiva medium" and "simple shadow extraction" plates from http://www.hollywoodcamerawork.us/greenscreenplates.html i.e.

From what i understand, you can not actually have single formula which would always performs good, perhaps it should be an option which formula to use.
sergey (Sergey Sharybin) added a comment.Via Old WorldNov 5 2012, 1:37 PM
Still not sure its actually a bug, just some case where current formula doesn't work well. I would prefer to have new formula as an option and also would ask to move to the bug tracker for further discussion.
sergey (Sergey Sharybin) closed this task as "Invalid".Via Old WorldNov 5 2012, 1:37 PM

Add Comment