Ask Your Question
2

Chroma Key

asked 2012-08-08 05:35:35 -0600

forthewolf gravatar image

I've never used OpenCV before... Would it be possible to code a "perfect" chroma key (green screen) application with it?

  1. At the basic level I need to set the alpha channel on all the pixels that match a particular RGB value (i.e. 51-255-0 aka green) to be transparent.
  2. Set a range for other colors that are close to green (but not EXACTLY 51-255-0) to also be transparent.
  3. Set pixels to be "semi-transparent" - So, remove the green out of them, but not the brown (for example). This is needed for the edge of the subject, mainly hair. Or semi-transparent objects such as glass.

Here is what I'm trying to achieve:

Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-08-08 06:45:58 -0600

sammy gravatar image

You definitely can do it, because OpenCV allows you to create pretty anything in image processing.

But you should know that it is focused on image processing algorithms, and not image effects. That means there are more appropriate software packages for you to use. ImageMagick is one of them, that explicitely allows you to play with transparency and chroma key.

If you are a general app developer, most probably you do not want to invest the time resources needed to learn OpenCV effectively, and implement your algorithm from scratch. Using another package, with pre-built functions, will keep you focused on your main task - providing an app or a service, or whatever you are developing

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-08-08 05:35:35 -0600

Seen: 8,260 times

Last updated: Aug 08 '12