Ask Your Question

Can't set video resolution in Java

asked 2014-03-02 22:40:40 -0500

mayhewsw gravatar image

I'm using the Java bindings for opencv 2.4.8. It seems that the default resolution is 640x480, but my camera is 1280x800. I'm doing the following:

VideoCapture v = new VideoCapture(1);
boolean b = v.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, 1280);
boolean b2 = v.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, 800);

Both of these values (b, b2) are false. It just doesn't work.

This is all the more puzzling because I know that I can change the resolution with the C++ bindings and C bindings on this computer (ubuntu 12.04) and camera (Microsoft LifeCam Cinema).

(I also asked the question here)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-03-24 15:10:11 -0500

You need to open the camera first then set it. I tried it before and it just returns to standard settings, but when try setting after it works.

edit flag offensive delete link more

Question Tools


Asked: 2014-03-02 22:40:40 -0500

Seen: 1,523 times

Last updated: Mar 24 '14