Ask Your Question
0

How to Change the videocapture property in opencv c++?

asked 2020-07-24 09:33:37 -0600

Rishi Shah gravatar image

I have been trying to set the camera reading pixel size to different than what by default camera resolution is. However, I am not able to set the pixel size using

videoStream.set(cv::CAP_PROP_FRAME_WIDTH, frameWidth);
videoStream.set(cv::CAP_PROP_FRAME_HEIGHT, frameHeight);

Can someone help me out with the reasons for this?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-07-24 10:08:18 -0600

berak gravatar image

sadly, none of the VideoCapture::set() or get() settings are guaranteed to work, it depends on your hardware, drivers, os, opencv video backend even.

most webcams only support certain sizes, e.g. multiples of vga or pal resolution, not arbitrary numbers.

in any case, please check the return value from videoStream.set() for failure.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-07-24 09:33:37 -0600

Seen: 438 times

Last updated: Jul 24 '20