简体   繁体   中英

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

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 example 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM