Ask Your Question

How to change contrast/brightness of a CAM using OpenCV 2.4.2

asked 2012-08-29 06:43:12 -0500

Gaurang gravatar image


Please let me know how to change the brightness and contrast of a cam using OpenCV 2.4.2. I wrote a code, but there is no impact of using this code. Please let me know how to write the code.

I used like this.

    CvCapture *capture = cvCaptureFromCAM(CV_CAP_DSHOW);
    AfxMessageBox("Not done.");
    while ( 1 ) 
         IplImage* frame = cvQueryFrame( capture );
         int c;
     cvNamedWindow("Image Display", CV_WINDOW_AUTOSIZE);
    cvShowImage("Image Display", frame );


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-08-29 08:23:00 -0500

sammy gravatar image

Those properties only work for a number of cameras. If it doesn't work, the solution is to find another camera or to use an external library that can control those params for the camera you're using. Note that many webcams simply do not have any mechanism to control these parameters - they are cheap devices, without any capture tuning abilities.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2012-08-29 06:43:12 -0500

Seen: 2,546 times

Last updated: Aug 29 '12