过滤实时相机送纸 [英] Filter Live camera feed
问题描述
所以我一直在使用UIImagepickercontroller访问相机进行照片和视频捕捉,然后我想在这两个来源上应用过滤器,我成功地过滤了令牌照片,但我找不到其余的解决方案,我只需要访问原始图像数据:相机显示的实时图像输入,应用过滤器,然后显示过滤的图像。任何帮助或建议将不胜感激。
So i've been using UIImagepickercontroller to access the camera for photo and video capture, then i wanted to apply filters on those 2 sources, i succeeded with filtering token photos but i'am having trouble finding the solution for the rest, all i need is to access the raw image data : the live image feed that the camera is showing , apply the filter and then show the filtered ones instead. Any help or advice will be appreciated.
推荐答案
UIImagePickerController不会为您提供对相机缓冲区的低级访问。
UIImagePickerController doesn't give you low level access to the camera buffer.
你应该设置一个AVCaptureSession并使用委托来处理CMSampleBufferRef
You should setup a AVCaptureSession and use the delegate to process the CMSampleBufferRef
看看AVCam&来自Apple的SquareCam演示,他们对视频捕捉进行了很好的介绍。
Take a look at the AVCam & SquareCam demos from Apple, they give a good introduction to video capture.
http://developer.apple.com/library/ios/#samplecode/AVCam/Introduction/Intro.html
http://developer.apple.com/library/ios/#samplecode/ SquareCam / Introduction / Intro.html
http://developer.apple.com/library/ios/#samplecode/AVCam/Introduction/Intro.html http://developer.apple.com/library/ios/#samplecode/SquareCam/Introduction/Intro.html
更简单的解决方案是使用 https://github.com/BradLarson/GPUImage
An easier solution is to use https://github.com/BradLarson/GPUImage
谢谢
Adam
Thanks Adam
这篇关于过滤实时相机送纸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!