I spent more time on it last night and discovered a few things. I looked at the source code for the USBCamera class - it's just a wrapper for the NIVision.IMAQ functions - that's not a bad thing, but it is good to know.
Info:
- The USBCamera constructors call 'openCamera' internally. You don't need to explicitly call openCamera unless you explicitly call closeCamera.
- UpdateSetting is automatically called by getImage() and getImageData() if one of the settings (exposure, brightness, fps, etc) had previously been changed. There is no need to call updateSettings() explicitly unless you are not using getImage() or getImageData().
- The setBrightness() and setExposure() functions do nothing but set a USBCamera member variable. The settings are not sent to the camera/driver until the updateSettings is called (which will be the next time you call getImage() or getImageData())
- The getBrightness() does nothing but return that member variable.
It's good to know what the functions are actually doing
Bottom line - I removed the openCamera() call and removed my calls to updateSettings() and relied on the USBCamera class to manage it. This works better, but not perfectly. I can adjust the brightness and see things change, but exposure seems to have no effect.
I took it a step further. I created my own USBCamera class and added a getExposure() and modified the getBrightness() to get the values from the camera/driver using the NIVision.IMAQ calls. This proved to me that the exposure and brightness ARE getting changed, AND I validated that I am NOT in AutoExposure mode. Unfortunately, I still cannot get the exposure changes to show any appreciable effect on the LifeCam image. Brightness goes from a decent image with Brightness = 0, to a white image with Brightness = 100. Exposure changes seem to have no effect.
Has ANYONE been able to get images out of the life cam, using ANY method, that comes anywhere close to being as dark as the sample images for the FRC vision processing? I'm beginning to think that the LifeCam is simply not adjustable to that low of an exposure.