Ask Your Question
1

Can't set video resolution in Java

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

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
1

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

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

edit flag offensive delete link more

Question Tools

Stats

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

Seen: 1,837 times

Last updated: Mar 24 '14