Ask Your Question
0

OpenCV and Iphone back camera

asked 2013-12-23 08:45:16 -0600

Safari gravatar image

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;
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-04-15 04:24:13 -0600

Merlux gravatar image

I know it's an old one, but if someone stumbles across:

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

should only be called once.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-12-23 08:45:16 -0600

Seen: 719 times

Last updated: Dec 23 '13