![]() |
Re: Brightness on 2016 vision samples
I was finally able to get the camera to work the way I wanted it. There appears to be some issue related to calling the camera settings function too often or to close together (in time). I haven't spent the time tracking down the issue, but do have a good work around. Previously, I had in my loop, a check that if the setting changed, it would call the appropriate set setting, then immediately call the getImage() function. This would get the image, but I could never get the exposure to work. The change/workaround that makes it work is:
(This is all Java, but applies equally to C++) - I created a separate function the when called, updates the specified setting (brightness or exposure) - it retrieves the value from a Preferences object on the SmartDashboard. - I added a button on the SmartDashboard to trigger this function call. - I also added a button (and function) for setAuto and setHoldCurrentExposure (which switches to manual exposure) - My loop now does just: - USBCamera.getImage() - CameraServer.setImage() - Now when I click one of the buttons, I get exactly what I expect, the exposure or the brightness changes according to the value in the Preferences table. I can get a VERY dark image and I can get a VERY bright image or anything in between. So for those asking about dark for autonomous and normal for teleop, you can explicitly call the settings and get the exposure/brightness you need. I think the important thing is to call them each only once in a given time period (not sure what the time period is, 100's of milli-seconds or seconds I would guess) and don't call getImage() immediately after the settings change. I'm honestly not sure why this approach works and the other doesn't someone that knows the internals of the NIVision.IMAQ class would probably have to chime in. I don't have the time to dig into it. If someone wants the code example, let me know and I'll post it somewhere. |
Re: Brightness on 2016 vision samples
They are located in (from memory so I might be a little off)
C:\Program Files (x86)\National Instruments\Labview 2015\Examples\FRC\Vision\roboRIO\2016 Vision Code\Sample Images\ I may have some of those swapped but that should let you find it provided you have the FRC update installed. |
| All times are GMT -5. The time now is 23:58. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi