Ask Your Question
0

I want get image with my device

asked 2020-11-03 02:56:03 -0500

wilber1222 gravatar image

updated 2020-11-03 03:01:03 -0500

Hi all,

I want to catch image from UVC capture card,

The resolution of this device is 1920X1081,

I was setting this resolution as following:

VideoCapture camera1;

camera1.open(0);

camera1.set(CV_CAP_PROP_FOURCC,CV_FOURCC('U','Y','V','Y'));

camera1.set(CV_CAP_PROP_FRAME_WIDTH,1920);

camera1.set(CV_CAP_PROP_FRAME_HEIGHT,1081);

But when I get height information, it will be 1080,

Is OpenCV allow catch special size image?

Please help me. Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-11-03 03:21:25 -0500

mvuori gravatar image

This is because an YUVY image height and width must be a multiple of 4.

edit flag offensive delete link more

Comments

Hi mvuori, Thanks for your reply. Because the sensor of my device will exist some information on the image. Thus, the output data will be (1920*1080 image data + 180Byte information). So, OpenCV does not support this case?

wilber1222 gravatar imagewilber1222 ( 2020-11-03 03:36:41 -0500 )edit

Change this:

camera1.set(CV_CAP_PROP_FOURCC,CV_FOURCC('U','Y','V','Y'));

to:

camera1.set(CV_CAP_PROP_FOURCC,CV_FOURCC('I','Y','V','Y'));
supra56 gravatar imagesupra56 ( 2020-11-03 07:06:38 -0500 )edit

Hi all, I found my device's descriptor setting was wrong. It work after I fix my descriptor.

wilber1222 gravatar imagewilber1222 ( 2020-11-03 20:55:48 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-11-03 02:56:03 -0500

Seen: 80 times

Last updated: Nov 03 '20