BradLarson / GPUImage2

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
BSD 3-Clause "New" or "Revised" License
4.85k stars 605 forks source link

ChromaKey with white color #223

Open MoxTalinder opened 6 years ago

MoxTalinder commented 6 years ago

I'm trying to remove white background from a local video file, but it seems that the ChromaKey filter does not work with white color. Is there any solution? Thanks!

EriFisher commented 6 years ago

I actually have tried this before. You can get it to work somewhat, but the issue is since there is a little bit of white in everything besides pure colors it keys out many things. I did it with the chromakey blend and put the settings as
chromakeyBlend.thresholdSensitivity = 0.04 chromakeyBlend.smoothing = 0.001 The reason the values are low is because you are trying to get only pure white or nearly pure white and since white is a bit of every color it usually isn't perfect, although likely the best settings without changing the framework itself. A possible solution if you change the framework is to calculate the exact colors needed to be keyed and making keying work for a group of shades that is analyzed in real time rather than a fixed setting. Also if you can calculate how many pixels exist in a given area you might be able to make it so it won't key out skin tones.

Let me know if any of this works.

suneelseelam commented 6 years ago

Hi, I am trying to filter the chrome key of a green screen for recorded video, I am able to filter the video but I want the output as URL of the filtered video. does any One help On this issue.