Manual Exposure vs Auto Exposure for ELP 2 MP USB Camera

09, Dec. 2024

 

Manual Exposure vs Auto Exposure for ELP 2 MP USB Camera

For our drone flying project, we have been using the ELP 2 Megapixel USB Camera. The auto exposure on this camera works in most situations, but we found that it does not always adjust to bright sunlight. In preparation for demonstrating our computer-controlled drone at the Maker Faire, I wanted to have a plan in case we were outdoors. It was a good thing too, since we were assigned an outdoor booth next to the Drone Combat arena.

For more information, please visit HBVCAM.

We detect the location of our drone by using blob detection on four paper circles that we have taped to the top of the drone. Originally, we were using a medium green color, but we found that under some lighting conditions, our code would confuse the light blue color on the body of the drone with the green circles. I thought about making our blob detection code more robust, but the Maker Faire was quickly approaching! Instead we decided to make our flying area more controlled. We used white poster board as the background for our flying area and I tested some different colors for the paper circles. Red circles were good, except that our code got confused if one of our hands was reaching into the flying area. Black was not good in dim light. In the end, we decided on a dark purple with a blue undertone.

OpenCV provides a way to set a webcam's manual exposure, but there are two problems. The first is that OpenCV is not well-documented. I could find the documentation stating that I should be able to set the exposure value, but it was not at all clear what values to pass! The second problem is that your particular webcam may not support programmatic setting of the exposure. Thus, when your code doesn't work, it can be difficult to determine if your code is wrong or if your webcam just won't allow it!

OpenCV's VideoCapture.set() is the method to use. If you look at the documentation, you will see that there is a property named CV_CAP_PROP_EXPOSURE. It took me some time to discover that depending on the version of OpenCV you are using, the property's name might actually be CAP_PROP_EXPOSURE.

There is no hint as to what the exposure value should be set to, but luckily for me, I found a mapping for the ELP 2 MP webcam on this page by Joan Charmant. He shows that the exposure values range between -1 and -13. You can programmatically set the exposure in this manner:

vc = cv2.VideoCapture(1)
vc.set(cv2.CAP_PROP_EXPOSURE,-10)

Unfortunately, I could not figure out a programmatic way to set the exposure back to auto exposure. If you know how, please add a comment! Please be aware that for some webcams, such as this one, the manual exposure setting is stored in its on-board memory, which means that turning off your program and even turning off the webcam itself, the manual exposure will still be set!

As a workaround, I found a way to bring up the DirectShow property pages so that I could use the DirectShow GUI to set the manual exposure or to turn auto exposure back on.

Here's the code to launch the DirectShow property page:

vc.set(cv2.CAP_PROP_SETTINGS,0)

During the Maker Faire, our demonstration area was shaded by a tent for most of the day, but around 2 PM our flying area was part sun and part shade. We delayed the inevitable by moving our table back with the shade, but eventually we had to move our table back to the front of the booth and into the sun. On Saturday, the afternoon was mostly overcast, and the camera's auto exposure worked most of the time. I was surprised that our blob detection code even worked when people walked in front of our booth and made our flying area partly shaded by their shadows.

Sunday was mostly sunny, and the webcam's auto exposure did not work when it was very bright. At these times, I opened up the DirectShow property pages and set the exposure manually so that our demo would still work. Maker disaster averted!

Like this:

Like

Loading...

2 Mega Pixel Dual Lens Camera Module USB AR ...

Description

Dual Lens Camera Module USB AR Wide Dynamic Range With Casing

High end Quality USB dual lens camera module

 

Module No.

Contact us to discuss your requirements of 2mega Pixel USB Cameras. Our experienced sales team can help you identify the options that best suit your needs.

WN-L-K87RS

Module Size 80*16*14.4mm Image quality Colorful Monochrome

Sensor Type

Sensor

AR OV Sensor Size 1/2.7 inch CMOS 1/2.7 inch CMOS Pixel Size 3μm x 3μm 3μm x 3μm Max Resolution H*V H*V Wide Dynamic Range 100DB / Resolution @ Frame Rate MJPG: ×/30fps, ×720/30fps, 800×600/30fps, 640X480/30fps

YUY2: ×/5fps, ×720/10fps, 800×600/20fps, 640X480/30fps

LENS

HFOV 65º 65º Material 3G2P 3G2P+IR filter 850nm bandpass EFL 5.0MM 5.0MM F.No 2.4 2.4 Focus Fixed Focus Fixed Focus Distortion <1%

Specifications

Audio no microphone Interface USB 2.0 Voltage DC 5V Temperature (Operation) -30°C to 70°C Temperature (Stable Image) 0°C to 50°C Operating system request WinXP/Vista/Windows 7 (32bit/64bit)/Windows 8/Windows 10/MAC OSX EI captain 10.11.4  and  Linux /Android

LED

LED 4pc IR Light 850nm bandpass

DSP type

GC/EC/Whiter balance Auto Output Formats YUY2/MJPG

 

This USB Dual Lens Camera Module is with 2pcs different sensor' AR and OV, both of them are 2 mega pixel.  AR is for  colorful image and OV is for monochrome image.  So, there's an 850nm IR lens convering the OV sensor. And there're 4pcs IR 850nm Light built in, this function is helping for camera working at night. What's more, AR is with WDR function to balance the image even the camera is in backlight environment.

There're 2pc USB slot for each image- colorful and monochrome. Cannot display these two images together but can open them in one monitor.

There's an Aluminum Housing in black color for this camera module if you need it for your device. That appearance helps for making your project elegant and look good.

 

The following image is taking by this dual lens camera module. You can see the colorful image is good quality even it's shooting toward the window. Because the AR sensor is with Wide Dynamic Range in 100DB and really working well for balancing image in good quality.

 

 

 

The company is the world’s best Monochrome USB Camera supplier. We are your one-stop shop for all needs. Our staff are highly-specialized and will help you find the product you need.