Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Brightness on 2016 vision samples (http://www.chiefdelphi.com/forums/showthread.php?t=142382)

robert1356 27-01-2016 09:24

Re: Brightness on 2016 vision samples
 
Jonboy, In my thread, http://www.chiefdelphi.com/forums/sh...d.php?t=142633, that is exactly what I am trying to do - the code is there, the methods are there, but it doesn't seem to be working.

According to the USBCamera class, there is a setExposureManual(int exp) and a setBrightness(int bright) methods, which is what I'm using. Whether they get saved across power cycles or not, I'm not sure, but I don't care because I've connected it to the SmartDashboard and using the Preferences class, it will update to whatever values I save in the preferences file.

mwtidd 27-01-2016 09:35

Re: Brightness on 2016 vision samples
 
Quote:

Originally Posted by robert1356 (Post 1530867)
Jonboy, In my thread, http://www.chiefdelphi.com/forums/sh...d.php?t=142633, that is exactly what I am trying to do - the code is there, the methods are there, but it doesn't seem to be working.

According to the USBCamera class, there is a setExposureManual(int exp) and a setBrightness(int bright) methods, which is what I'm using. Whether they get saved across power cycles or not, I'm not sure, but I don't care because I've connected it to the SmartDashboard and using the Preferences class, it will update to whatever values I save in the preferences file.

In the past I've altered the camera settings on a LifeCam Studio through the LifeCam software. If I remember correctly the changes persisted.

https://www.microsoft.com/hardware/e...ifecam-hd-3000

Roscoe Plowbots 27-01-2016 10:46

Re: Brightness on 2016 vision samples
 
My team has been using NI Vision assistant and we now know how to track objects on the screen; however, we were wondering how to impliment the tracking to motor movement. We want our robot to find the target then auto adjust to score. If anyone has any code, websites, or tips for us that would be great. Thank you.

euhlmann 27-01-2016 11:01

Re: Brightness on 2016 vision samples
 
Quote:

Originally Posted by jonboy (Post 1530862)
I apologize for not doing my homework.

The question is: Can the EXPOSURE of the USB camera be held or set manually? If it can be held will it hold through an on/off/on power cycle?

TNX

The USBCamera class is able to set exposure manually. It worked on our logitech camera.

Edit: sorry, didn't see that this was already answered.

robert1356 27-01-2016 17:27

Re: Brightness on 2016 vision samples
 
Quote:

Originally Posted by lineskier (Post 1530870)
In the past I've altered the camera settings on a LifeCam Studio through the LifeCam software. If I remember correctly the changes persisted.

https://www.microsoft.com/hardware/e...ifecam-hd-3000

This is VERY cumbersome - it requires disconnecting the cam on the robot and connecting it to a PC, attempting to set the parameters based on venue, then saving them, then plugging back into the robot - it might be A way to do it, but certainly not optimal :/

simon-andrews 27-01-2016 20:26

Re: Brightness on 2016 vision samples
 
I've been setting exposure on the Lifecam from programs with v4l-utils. You can play with exposure settings using QV4L2 on your development computer, then in your code include a call to v4l2-ctl to set your exposure:

Code:

v4l2-ctl --set-ctrl=exposure_absolute=9 --device=1
I'm working on Raspberry Pi, but since roboRIO is also Linux I'm pretty sure you will be able to install v4l-utils on it as well. Not the best solution but it works well enough.

robert1356 28-01-2016 09:10

Re: Brightness on 2016 vision samples
 
Has ANYONE been able to get DARK images out of the life cam, using ANY method? Images that come 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. I can see changes when I adjust the brightness, but exposure doesn't seem to be changing anything and even with both exposure and brightness set to minimums, the image still looks "normal" (a decent image for the average person to look at) not DARK like is needed for the image processing.

robert1356 28-01-2016 09:37

Re: Brightness on 2016 vision samples
 
I just confirmed it is possible - I'm running on a Mac and I just installed "Webcam Settings Panel" from the app store. It allowed me to adjust the exposure to a BLACK image. It also seems to confirm that it is not doing any of this in software, but is actually querying the camera for it's capabilities. The setting options are different between the LifeCam, my laptop iSight and my monitor's iSight, for example, the LifeCam has a backlight compensation slider while the iSights show up as simply on/off options.

I also confirmed that the settings are saved in the camera (or at least in the driver) - quit the settings panel (so I know it wasn't restoring the values) and unplugged the cam and plugged it back in and the image was the same as when I had unplugged it. This is all good news, now if I can just figure out how to use the USBCamera, NIVision.IMAQ or something on the RoboRIO to make these same adjustments, I would be happy.

robert1356 28-01-2016 09:41

Re: Brightness on 2016 vision samples
 
CORRECTION - I THOUGHT I had closed "Web Cam Settings" - I hadn't. IT was storing and re-storing the settings. I made sure I quit it and tested again. When I replugged the camera, it reverted to Autoexposure

Sky Captain 30-01-2016 15:05

Re: Brightness on 2016 vision samples
 
One of the questions my team had is, can we change the camera settings for autonomous, and have them go back to normal for teleop? We'd like to have dark picture for vision analysis, but standard colors for real time feed for complicated driving. Is this possible?

adciv 30-01-2016 21:18

Re: Brightness on 2016 vision samples
 
It is possible. You just need a routine to reset the camera settings again and have it run at the begining of teleop.

Greg McKaskle 31-01-2016 09:17

Re: Brightness on 2016 vision samples
 
You don't mention what language you are using, but the camera settings are adjusted using the WPILib camera property sets. The initialization code often has similar set calls.

Greg McKaskle

sraque 31-01-2016 13:19

Re: Brightness on 2016 vision samples
 
In Labview, we were able to use the stock VIs for camera control to adjust the settings of the LifeCam. In particular, settings that produced images where the target is brightly lit, but all surroundings are dark were:

Exposure 0
Brightness 20-30
We left the white balance on auto.

techplex 31-01-2016 19:32

Re: Brightness on 2016 vision samples
 
Where are the Vision Samples? I'd be interested to see what we should be shooting for.

Greg McKaskle 31-01-2016 21:21

Re: Brightness on 2016 vision samples
 
The LV examples include about 100 images. I didn't find them immediately, but I'm pretty sure they are on first forge or WPI or another public site.

Greg McKaskle


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