开发者

How to get raw image data (RGB value of each pixel) from iPhone camera when using in video capture mode?

开发者 https://www.devze.com 2023-03-23 09:24 出处:网络
I have to make an iPhone project that can process video data in realtime. This app has to be able to reconize the color of the

I have to make an iPhone project that can process video data in realtime. This app has to be able to reconize the color of the object in the video frame. After I found information relating to video processing in iOS, I found that I can use AVFoundation Framework to achieve this task but I don't know which APIs or functions of AVFoundation that's able to do this video processing task.

Can anyone suggest me which function to use to get image frames or raw image data out of a video streaming in real-time?

I'd appreciate if you can give me some exa开发者_如何学Pythonmple code

Thank you very much for helping me...


You can first of all make use of AVAsset class by initiating it with your video file URL.

You can then use an AVAssetReader object for obtaining media data of that asset. This will help you obtain video frames which you can read using AVAssetReaderVideoCompositionOutput class object. Accessing RGB channel data from these frames is pertinent to CGImage classes and it's methods.

Hope this helps you to get started

0

精彩评论

暂无评论...
验证码 换一张
取 消