View Full Version : USB-Camera lower exposure
Ronso007
25-01-2016, 12:54
Hey guys, I have a simple question: how to lower the exposure in the usb camera lifecam HD 3000?
Under: WPI Robotics Library->Camera->Camera Properties Look for the one that says "Set Expos"
Mark McLeod
25-01-2016, 13:09
Look in the Vision Processing.vi
One of the settings there is Camera Set Expos.
You can saturate the exposure by pointing the camera at something brighter and use Hold Current.
Look at the Context Help for that library vi for help.
Ronso007
25-01-2016, 15:14
Look in the Vision Processing.vi
One of the settings there is Camera Set Expos.
You can saturate the exposure by pointing the camera at something brighter and use Hold Current.
Look at the Context Help for that library vi for help.
Under: WPI Robotics Library->Camera->Camera Properties Look for the one that says "Set Expos"
Is there a way to use the Set Expos VI with the dashboard?
Mark McLeod
25-01-2016, 15:20
You could, it would take a little work.
Make a control or use one of the sample ones on the Dashboard for your code to read on the roboRIO.
In your roboRIO code when the button changes call Set Expos with the camera reference.
Ronso007
25-01-2016, 15:27
You could, it would take a little work.
Make a control or use one of the sample ones on the Dashboard for your code to read on the roboRIO.
In your roboRIO code when the button changes call Set Expos with the camera reference.
Can you be specific how to do that?
Mark McLeod
25-01-2016, 15:54
Start with a default project (you can add other stuff if you want to).
Look in Teleop.vi for the DB/Button 1 code (with the Sample Boolean 1 output)
Copy that snippet of code to the Vision Processing.vi, inside the While loop
Add a separate Case statement inside the While Loop
Wire the same output that feeds the Sample Boolean 1 output to the Case
Copy the Camera Set Expos into the Case True case.
Wire the Set Expos to the pink camera ref that comes in the left of the While Loop
Change the Set Expose input constant to "Hold current"
Once you've put the new code onto the roboRIO, go to the Dashboard Basic tab and press DB/Button 1 to make the camera Hold Current exposure setting.
This would only work once and assumes that the original Set Expos is still set to "Auto".
Once set to Hold current exposure, then if you push the button a second time you won't se any change.
To get it to change again you'd need to add another Set Expos to take it back to "Auto" long enough for the camera to adjust the exposure again, then you could Hold Current again.
Greg McKaskle
25-01-2016, 16:56
Can you be specific how to do that?
Here is what I'd do.
Use slider zero and button zero on the basic tab for the camera exposure. These values are automatically stored as "DB/Slider 0" and "DB/Button 0" and if your robot reads those network table variables, it gets the slider values.
Within your camera loop, in the enabled case, the code already updates the image size. Similarly, you can update the exposure by reading the button and slider and calling the Set Exposure subVI. It internally checks against current value and only modifies the camera on change.
Greg McKaskle
Ronso007
27-01-2016, 05:04
Here is what I'd do.
Use slider zero and button zero on the basic tab for the camera exposure. These values are automatically stored as "DB/Slider 0" and "DB/Button 0" and if your robot reads those network table variables, it gets the slider values.
Within your camera loop, in the enabled case, the code already updates the image size. Similarly, you can update the exposure by reading the button and slider and calling the Set Exposure subVI. It internally checks against current value and only modifies the camera on change.
Greg McKaskle
Start with a default project (you can add other stuff if you want to).
Look in Teleop.vi for the DB/Button 1 code (with the Sample Boolean 1 output)
Copy that snippet of code to the Vision Processing.vi, inside the While loop
Add a separate Case statement inside the While Loop
Wire the same output that feeds the Sample Boolean 1 output to the Case
Copy the Camera Set Expos into the Case True case.
Wire the Set Expos to the pink camera ref that comes in the left of the While Loop
Change the Set Expose input constant to "Hold current"
Once you've put the new code onto the roboRIO, go to the Dashboard Basic tab and press DB/Button 1 to make the camera Hold Current exposure setting.
This would only work once and assumes that the original Set Expos is still set to "Auto".
Once set to Hold current exposure, then if you push the button a second time you won't se any change.
To get it to change again you'd need to add another Set Expos to take it back to "Auto" long enough for the camera to adjust the exposure again, then you could Hold Current again.
Thank you guys for your AMAZING answers!
One last thing, the set Expos sub-vi input is in precentage values and when we put 0 precent it's really dark and when we put any other number it's normal(1,10,50,0.5)... any ideas what is the range?
Greg McKaskle
27-01-2016, 07:23
It will be camera specific. Vision Assistant will show you the range values of the camera exposure, and the percentage is scaled between their min and max values for that property.
Be sure to have enough light that the camera will actually use your value. Testing a camera in varying light can be confusing, as the cameras decide to outsmart you and send you chasing after untamed geese.
Greg McKaskle
robert1356
27-01-2016, 09:14
Under: WPI Robotics Library->Camera->Camera Properties Look for the one that says "Set Expos"
This does NOT seem to work. See http://www.chiefdelphi.com/forums/showthread.php?t=142633 - I'm using the setExposureManual() and setBrightness() methods on the USBCamera class and I'm not seeing a change.
Just checking, are you using Labview or C++?
robert1356
27-01-2016, 17:33
Just checking, are you using Labview or C++?
Neither - Java, though the C++ and the Java API should be the same.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.