2

I am working on an Iphone application. I am using OpenCV to take a picture with the camera and use it as UIImage.

To take the picture first I declare the cvCapture

CvCapture * capture = cvCaptureFromCam(1200) //(1200 is to use the CV_CAP_AVFOUNDATION  from the AVFoundation framework)

Then I use cvQueryFrame(capture) to get the image.

Everything works correctly.

Now the image resolution I get is 480X360. i want to make the image bigger. After researches and some test on a desktop application I found out we can use this to set the capture resolution:

cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 1280);
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 720);

However this was not working the image size is not changing.

Directly after calling cvSetCaptureProperty I used the cvGetCaptureProperty to read the properties, to make sure they are changing. But they where not changing (I'm still getting them as 480X360). It is like cvSetCaptureProperty is not setting the properties correctly.

On a desktop application that uses open CV those methods work fine and the resolution is changed correctly. I am testing on an Iphone 4s btw.

Any idea why setting the frame height and width is not working?

Thanks a lot for any help

4

0 回答 0