Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV and Iphone back camera

I have a question about OpenCV video processing and iOS. I followed this tutorial to create a simple example project. http://docs.opencv.org/doc/tutorials/ios/video_processing/video_processing.html#basic-video-processing

self.videoCamera = [[CvVideoCamera alloc] initWithParentView:imageView];
self.videoCamera.defaultAVCaptureSessionPreset = AVCaptureSessionPreset640x480;
self.videoCamera.defaultAVCaptureVideoOrientation = AVCaptureVideoOrientationPortrait;
self.videoCamera.defaultFPS = 60;
self.videoCamera.grayscaleMode = YES;

self.videoCamera.defaultAVCaptureDevicePosition = AVCaptureDevicePositionBack;

self.videoCamera = [[CvVideoCamera alloc] initWithParentView:imageView];
self.videoCamera.delegate = self;

It works well but I can't change to use the back camera. I use this line to change the camera but it not work:

self.videoCamera.defaultAVCaptureDevicePosition = AVCaptureDevicePositionBack;