1.私有api
头文件添加:
extern "C" CGImageRef UIGetScreenImage();
使用时添加:
CGImageRef screenref = UIGetScreenImage();
2.摄像头回调
一 、生成capture session 实例
二 、实现回调
AVCaptureVideoDataOutputSampleBufferDelegate
YCbCr or RGBA
ios 默认 YCbCr
,OPEN GL 和CoreGraphics推荐前者
YCbCr =
(Y) Luminance +
(Cb/U) Blue Chrominance + (Cr/V) Red Chrominance ;
OpenCV
Adding OpenCV to your Xcode 4 project
1.download
opencv
2.Download build script by @cvtalks:
下载
3.build script
sh BuildOpenCV.sh opencv/ opencv_ios_build
4. Add the newly-built static libraries (.a) files under Target->Build Settings
5.设置路径
6.添加dummy cpp 文件
7.添加opencv 头文件
8.添加代码