Sunset Lake Software - Comments for "Chaining GPUImageChromaKeyBlendFilter" http://www.sunsetlakesoftware.com/forum/chaining-gpuimagechromakeyblendfilter Comments for "Chaining GPUImageChromaKeyBlendFilter" en The color "distances" are http://www.sunsetlakesoftware.com/forum/chaining-gpuimagechromakeyblendfilter#comment-1531 <p>The color "distances" are based on Y, Cb, and Cr, and are based on a distance algorithm proposed by Apple in one of their samples. You can look at the fragment shader code to see how I calculate this. There might be a better way to calculate this, but that's what I'm using right now.</p> pubDate Wed, 01 Aug 2012 23:48:59 +0000 dc:creator Brad Larson guid false comment 1531 at http://www.sunsetlakesoftware.com Thanks that seems to work http://www.sunsetlakesoftware.com/forum/chaining-gpuimagechromakeyblendfilter#comment-1530 <p>Thanks that seems to work fine and is much faster.</p> <p>Another related question. It seems like the thresholdSensitivity setting responds quite differently to different colors. Red requires a very low threshold to be replaces whereas blue and green seem to be quite hard to replace and need a higher threshold. </p> <p>This seems a bit odd to me, but maybe I am doing something wrong.</p> pubDate Wed, 01 Aug 2012 23:14:51 +0000 dc:creator michel.lonngren guid false comment 1530 at http://www.sunsetlakesoftware.com Try reordering it to http://www.sunsetlakesoftware.com/forum/chaining-gpuimagechromakeyblendfilter#comment-1529 <p>Try reordering it to this:</p> <p><div class="geshifilter"><pre class="geshifilter-cocoa">[foreground addTarget:chroma1]; [foreground addTarget:chroma2]; &nbsp; [background addTarget:chroma1]; &nbsp; [background addTarget:chroma2]; &nbsp; [foreground processImage]; [background processImage];</pre></div></p> <p>Under the new way that I've configured the blends, this should ripple down the filter chain appropriately.</p> pubDate Wed, 01 Aug 2012 15:39:29 +0000 dc:creator Brad Larson guid false comment 1529 at http://www.sunsetlakesoftware.com I finally got it working by http://www.sunsetlakesoftware.com/forum/chaining-gpuimagechromakeyblendfilter#comment-1528 <p>I finally got it working by doing the following:</p> <p>[foreground addTarget:chroma1];<br /> [foreground addTarget:chroma2];</p> <p>[foreground processImage];<br /> [background addTarget:chroma1];<br /> [background processImage];</p> <p>[foreground processImage];<br /> [background addTarget:chroma2];<br /> [background processImage];</p> <p>return[chroma1 imageFromCurrentlyProcessedOutput];</p> <p>Seems a bit wasteful to run processimage twice on each image. Am I doing things backwards? Is there a more effective way to do this?</p> <p>(I see a pretty harsh slowdown for each new chroma filter I add).</p> pubDate Wed, 01 Aug 2012 13:52:46 +0000 dc:creator michel.lonngren guid false comment 1528 at http://www.sunsetlakesoftware.com