Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我尝试使用过滤器构建简单的相机应用程序。我在 UIImage 上应用 CIFilters 效果很好,但现在我想在拍照之前应用滤镜(相机上的实时滤镜),比如下面的 iOS7 相机。
预先感谢。
如果您正在寻找 UIImagePickerController 的 api 来进行实时相机过滤,它不会发生。你必须建立你自己的。
查看 AVCaptureSession,也许还有这个示例代码(请参阅参考资料XBFilteredCameraView.m)来帮助您了解如何实时捕获相机输出图像。
XBFilteredCameraView.m
而且你还需要一个实时图像处理库,比如GPUImage。
希望这可以帮到你。
可供开发人员使用的 CoreImage 过滤器对于实时处理来说太慢了。
如上所述,使用 GPU 加速库,例如GPUImage。