[gstreamer-bugs] [Bug 512345] New: gstalpha: chroma-key should not set alpha to 0 if brightness is near maximum or minimum

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Sun Jan 27 02:21:00 PST 2008


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=512345

  GStreamer | gst-plugins-good | Ver: HEAD CVS
           Summary: gstalpha: chroma-key should not set alpha to 0 if
                    brightness is near maximum or minimum
           Product: GStreamer
           Version: HEAD CVS
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-good
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: sebastian-keller at gmx.de
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


I tried using the "alpha" filter in combination with videomixer to get
something like a bluescreen effect working for my old webcam (Replace one color
of a stream with another stream). Since the old webcam tends to have problems
with lightsources or bright reflections it often has a bright white in the
picture. As a result not just blue got replaced but also many of the white
light reflections in the picture.
Then i changed gst_alpha_chroma_key_i420 in gstalpha.c to always use an alpha
value of 255 if the brightness(y) is near the maximum or near the minimum
(which was also a problem; black got replaced, too). I did tried to check if it
equals 229 (which seems to be the maximum) or 0 first, but saw that it did not
catch everything, so i checked if it is >= 225 or <= 5 which worked even
better.
After that the result was as expected and no more bright lights or dark shadows
were replaced, only blue was replaced.
If i understand it right, thats because one can't determine the color if the
brightness value is at maximum or minimum and other colors are more likely to
get matched if the brightness is near maximum or minimum which leads to lots of
false matches.
Maybe somebody who completely understands the algorithm could create a better
patch since my version is mostly trial&error ;)


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=512345.




More information about the Gstreamer-bugs mailing list