Unable to change frame height, width in OpenCV

I am using python OpenCV bindings to compile a quick script/prototype , but for some odd reason

 camera.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 640.0) 

... doing nothing. By this I mean that it returns True , but the frame height is constant. No, returning a constant is not an error, since camera.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT) returns 240.0 as the default value.

I have no clue as to why this fails. Any ideas?

For what it's worth, I'm running this code on windows 8.1 .

+1
python opencv
Dec 04 '13 at 22:58
source share
2 answers

It is often impossible to change camera settings through openCV.

It depends on how well the camera implements the interface for Microsoft Directshow. Because Directshow is hard to understand, poorly documented and hard to test, and cameras are cheaply made .....

+1
Dec 04 '13 at 23:07
source share

To change the resolution of the camera, you must set both WIDTH and HEIGHT . Some say that changing the height automatically adjusts the width, but that did not work for me.

See my other answer on this topic.

+1
Dec 05 '13 at 8:24
source share



All Articles