0

I am experimenting with the following code on the raspberry pi:

https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/camshiftdemo.cpp?rev=4234

and I would like to do the recommendations from this thread:

Getting better performance using OpenCV?

Specifically, how do I perform #1 - #4 in the link above?

Looking at this site:

http://opencv.willowgarage.com/documentation/cpp/reading_and_writing_images_and_video.html#cv-videocapture-set

I have attempted to do the following:

cap.set(CV_CAP_PROP_FRAME_WIDTH, 320);
cap.set(CV_CAP_PROP_FRAME_WIDTH, 240);
cout << "width = " << cap.get(CV_CAP_PROP_FRAME_WIDTH) << endl;
cout << "height = " << cap.get(CV_CAP_PROP_FRAME_HEIGHT) << endl;

However the output always says 640 and 480 for width and height. Am I missing something big here?

I am using OpenCV 2.3.1

2
  • 1. : you're setting CV_CAP_PROP_FRAME_WIDTH twice 2.: not every capture driver implements all those flags. sadly it seems, you can't set the frame size on your raspi this way . if 640x480 is more, than you want to chew, try to resize() or pyDown() your image Commented Mar 16, 2013 at 23:46
  • You are correct. I changed the CV_CAP_PROP_FRAME_WIDTH to CV_CAP_PROP_FRAME_HEIGHT and everything worked. I would have given you points but you added a comment. If you go ahead and answer it I can mark it as correct. Commented Mar 17, 2013 at 2:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.