Ask Your Question
0

opencv doesn't get full picture of microsoft HD3000 webcam

asked 2018-01-09 14:12:02 -0500

arh24 gravatar image

I bought a microsoft HD 3000 webcam, it works fine with 720p 30FPS

but there is a strange problem with opencv running this camera, when i open it with opencv videocapture. camera gives me 640*480 resolution picture while in windows 10 camera application it gives 720p which is right

i don't know what is wrong here

problem is with webcam or opencv?? anybody has any idea

i am using opencv 3.4

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-01-09 14:32:13 -0500

LBerger gravatar image

updated 2018-01-09 14:33:17 -0500

You can use set method:

VideoCapture cap(0);

if (!cap.isOpened()) {
    cerr << "ERROR! Unable to open camera\n";
    return -1;
}
cap.set(CAP_PROP_FRAME_WIDTH ,1280);
cap.set(CAP_PROP_FRAME_HEIGHT,720);
if (cap.get(CAP_PROP_FRAME_HEIGHT)!=720 || cap.get(CAP_PROP_FRAME_WIDTH)!=1280)
     cout<<"unable to set 1280*720\n";
edit flag offensive delete link more

Comments

great thank u, that is the solution

arh24 gravatar imagearh24 ( 2018-01-10 15:52:47 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-01-09 14:12:02 -0500

Seen: 397 times

Last updated: Jan 09 '18