如何将任何颜色的色度键滤镜应用于现场摄像机输入ios? [英] How to apply chroma key filter with any color to live camera feed ios?

查看:160
本文介绍了如何将任何颜色的色度键滤镜应用于现场摄像机输入ios?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我想将色度键过滤器应用于ios live camera feed但我希望用户选择将被其他颜色替换的颜色。

Basically I want to apply chroma key filter to ios live camera feed but I want user to pick the color which will be replaced by another color.

我发现了一些使用绿屏的例子但我不知道如何动态替换颜色而不仅仅是绿色。

I found some examples using green screen but I don't know how to replace color dynamically instead of just green color.

任何想法我怎样才能以最佳表现达到目的?

Any idea how can I achieve that with best performance?

推荐答案

你之前已经问过我的 GPUImage 框架,所以我假设您熟悉它。在该框架内有两个过滤器,一个GPUImageChromaKeyFilter和一个GPUImageChromaKeyBlendFilter。两者都将通过 -setColorToReplaceRed:green:blue:方法键入您指定的任何颜色,并使用 thresholdSensitivity property。

You've previously asked about my GPUImage framework, so I assume that you're familiar with it. Within that framework are two filters, a GPUImageChromaKeyFilter and a GPUImageChromaKeyBlendFilter. Both will key off of whatever color you specify via the -setColorToReplaceRed:green:blue: method, with a threshold set using the thresholdSensitivity property.

前一个过滤器只是将与阈值内颜色匹配的区域变为alpha为0,后者实际上与另一个图像或视频混合基于源的输入图像或视频匹配的区域。 FilterShowcase示例应用程序显示如何为绿色执行此操作,但您可以将键控颜色设置为您想要的任何颜色。

The former filter merely turns areas matching the color within the threshold to an alpha of 0, with the latter actually doing a blend against another image or video source based areas of the input image or video that match. The FilterShowcase example application shows how to do this for green, but you can set the keying color to anything you want.

这篇关于如何将任何颜色的色度键滤镜应用于现场摄像机输入ios?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆