Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#32790] Bad seams with Keying node

Date:
2012-10-06 07:32
Priority:
3
State:
Closed
Submitted by:
David M (erwin94)
Assigned to:
Sergey Sharybin (nazgul)
Category:
Compositor
Status:
Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Bad seams with Keying node
Detailed 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.

Followup

Message
  • Date: 2012-10-06 07:56
  • Sender: David M
  • 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.
  • Date: 2012-10-06 12:52
  • Sender: David M
  • Attached an image showing the old key, the source and the new key (in that order).
  • Date: 2012-10-08 14:01
  • Sender: Brecht Van Lommel
  • 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.
  • Date: 2012-10-13 17:23
  • Sender: David M
  • 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 ).
  • Date: 2012-10-23 19:03
  • Sender: Sergey Sharybin
  • 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.
  • Date: 2012-11-05 13:37
  • Sender: Sergey Sharybin
  • 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.
 

Attached Files:

Name Date Download
key_test_v2.blend 2012-10-06 07:33 Download
keying_v1.patch 2012-10-06 07:56 Download
key4.png 2012-10-06 12:52 Download
keying_v2.patch 2012-10-13 17:23 Download

Changes:

Field Old Value Date By
status_idOpen2012-11-05 13:37nazgul
close_dateNone2012-11-05 13:37nazgul
StatusNew2012-11-05 13:37nazgul
File Added22389: keying_v2.patch2012-10-13 17:23erwin94
assigned_tonone2012-10-07 01:05dingto
File Added22292: key4.png2012-10-06 12:52erwin94
File Added22288: keying_v1.patch2012-10-06 07:56erwin94
File Added22287: key_test_v2.blend2012-10-06 07:33erwin94