Go to Post My favorite is always "The Next One!" - Bill Moore [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 16-03-2016, 20:18
EthanJF123 EthanJF123 is offline
Registered User
FRC #2614
 
Join Date: Mar 2015
Location: Morgantown, WV
Posts: 11
EthanJF123 is an unknown quantity at this point
USB MS Lifecam HD 3000 Exposure Issues

After several weeks of adjusting and playing with calibrations, I have found that the lifecam's exposure seems to be binary. What we are using is a USB MS Lifecam HD 3000 on Labview with NI Vision example code, and we are using a green LED to try to track the target. In the code I am setting the exposure by making it custom.
When I set the exposure to zero, the camera sees a green target and recognizes it properly. However, even when I change the value to one, the camera sees a white target and cannot find the target. I will change the values to go from one to one-hundred, and I cannot see any change. So, is the exposure acting binary, or am I doing something wrong?
  #2   Spotlight this post!  
Unread 16-03-2016, 20:44
TimTheGreat's Avatar
TimTheGreat TimTheGreat is offline
ArchdukeTim
FRC #1418 (Vae Victis)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 238
TimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura about
Re: USB MS Lifecam HD 3000 Exposure Issues

Quote:
Originally Posted by EthanJF123 View Post
After several weeks of adjusting and playing with calibrations, I have found that the lifecam's exposure seems to be binary. What we are using is a USB MS Lifecam HD 3000 on Labview with NI Vision example code, and we are using a green LED to try to track the target. In the code I am setting the exposure by making it custom.
When I set the exposure to zero, the camera sees a green target and recognizes it properly. However, even when I change the value to one, the camera sees a white target and cannot find the target. I will change the values to go from one to one-hundred, and I cannot see any change. So, is the exposure acting binary, or am I doing something wrong?
We had this problem (although the exposure change was going from 5-6). Our solution? Tape a polarized sunglass lens over the camera. Works like a dream.
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.



2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP
  #3   Spotlight this post!  
Unread 16-03-2016, 21:40
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,383
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: USB MS Lifecam HD 3000 Exposure Issues

I have found this behavior to be typical for this camera.
Time to get creative!
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #4   Spotlight this post!  
Unread 16-03-2016, 22:19
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,624
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: USB MS Lifecam HD 3000 Exposure Issues

I agree: this is a common issue with this camera and the tinted or polarized lens does help.

Last edited by techhelpbb : 16-03-2016 at 22:22.
  #5   Spotlight this post!  
Unread 16-03-2016, 22:45
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is online now
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 163
nickbrickmaster is an unknown quantity at this point
Re: USB MS Lifecam HD 3000 Exposure Issues

I've been setting the exposure using the Lifecam software. It's been working well so far.
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-
  #6   Spotlight this post!  
Unread 16-03-2016, 23:21
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,091
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: USB MS Lifecam HD 3000 Exposure Issues

I haven't tried using any of the FRC software to set the exposure, but I noticed that OpenCV has issues setting it as well. I've found that you can install v4l-utils (via opkg), and execute the following command:

Code:
v4l2-ctl -c exposure_auto=1 -c exposure_absolute=10
Works every time.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #7   Spotlight this post!  
Unread 17-03-2016, 13:53
Cinnamon Toast's Avatar
Cinnamon Toast Cinnamon Toast is offline
Registered User
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Michigan
Posts: 32
Cinnamon Toast is an unknown quantity at this point
Re: USB MS Lifecam HD 3000 Exposure Issues

I've been having the same problem with some vision I've been running with open cv. Is it possible to integrate that command into the camera capture object? If I could do this in the initiation of my code that would be great. If possible how so?
  #8   Spotlight this post!  
Unread 17-03-2016, 14:13
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,091
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: USB MS Lifecam HD 3000 Exposure Issues

Quote:
Originally Posted by Cinnamon Toast View Post
I've been having the same problem with some vision I've been running with open cv. Is it possible to integrate that command into the camera capture object? If I could do this in the initiation of my code that would be great. If possible how so?
Depends on your language, there are multiple ways to run external processes in each language. In python it would be something like:

Code:
import os
...
os.system('v4l2-ctl ... ')
And in C++ it'll probably be something like:

Code:
#include <stdlib.h>
...

system("v4l2-ctl ...");
And in java it'll be something like this:

Code:
Runtime.getRuntime().exec("v4l2-ctl ...");
Obviously, you will want to do error checking, and some languages provide better ways of doing this as well.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #9   Spotlight this post!  
Unread 17-03-2016, 14:13
teku14's Avatar
teku14 teku14 is offline
http:
FRC #2614 (MARS)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Morgantown, WV
Posts: 64
teku14 is a jewel in the roughteku14 is a jewel in the roughteku14 is a jewel in the roughteku14 is a jewel in the rough
Re: USB MS Lifecam HD 3000 Exposure Issues

Quote:
Originally Posted by EthanJF123 View Post
After several weeks of adjusting and playing with calibrations, I have found that the lifecam's exposure seems to be binary. What we are using is a USB MS Lifecam HD 3000 on Labview with NI Vision example code, and we are using a green LED to try to track the target. In the code I am setting the exposure by making it custom.
When I set the exposure to zero, the camera sees a green target and recognizes it properly. However, even when I change the value to one, the camera sees a white target and cannot find the target. I will change the values to go from one to one-hundred, and I cannot see any change. So, is the exposure acting binary, or am I doing something wrong?
hey i know you
  #10   Spotlight this post!  
Unread 17-03-2016, 14:15
TheOtherGuy's Avatar
TheOtherGuy TheOtherGuy is offline
Unregistered User
AKA: Kevin Forbes
FRC #4183 (Bit Buckets)
Team Role: Engineer
 
Join Date: Jul 2006
Rookie Year: 2006
Location: Tucson, AZ
Posts: 408
TheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond repute
Re: USB MS Lifecam HD 3000 Exposure Issues

Java? http://stackoverflow.com/questions/8...d-line-in-java

C++? http://stackoverflow.com/questions/8...om-a-c-program

Labview? http://digital.ni.com/public.nsf/all...2564C400579DBA
__________________
  #11   Spotlight this post!  
Unread 18-03-2016, 00:42
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,524
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: USB MS Lifecam HD 3000 Exposure Issues

Anyone find a USB camera you can adjust exposure on?
  #12   Spotlight this post!  
Unread 18-03-2016, 11:33
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,624
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: USB MS Lifecam HD 3000 Exposure Issues

A few years ago, when Patrick was a student on FRC11, and doing hard core collection of frames from Video4Linux directly into his own Java code on my Dell Mini 9's with Microsoft USB cameras we discovered an annoying issue that basically abstracts away your ability to control the exposure (auto white balance) via the exposed registers on Linux (Ubuntu 9 Karmic at the time) with the Microsoft USB cameras we had and the newer models are not much different. Keeping in mind you have Linux on the RoboRIO but it is not Ubuntu.

We contacted the package maintainer who was part of the V4L project, which OpenCV draws from and GRIP depends on, but between us we weren't able to expose whatever Microsoft had done with the OmniVision CMOS sensor in the core of their camera. I've been a long time user of OmniVision products which are at the core of some of the best webcams (more than 10 years) and it's clearly something particular with the way this was used or the sensor was configured. I tried to pull in some friends from Microsoft but was not successful. A little transparency would have long ago solved this issue.

We were able get this to work from V4L directly into Java and OpenCV with Logitech cameras. Logitech has been pretty forthcoming with the Linux community for a long time (considering how many Logitech 3 button mice I used to buy for X-terminals where the middle button was a tricky matter).

This issue, by the way, is the reason I provided FRC11 the Logitech C920 USB cameras and why I recommended to several people on ChiefDelphi the Logitech cameras.

Take those same Microsoft branded cameras and put them on a Windows laptop and you'll see the issue is much less a problem. The Windows drivers do something to the camera configuration that expands the response. I did consider, at one time, reversing the camera communications with my logic analyzer but, to be honest, the camera is too cheap to waste that kind of energy.

Normally I don't expose this kind of interaction but this topic has been respectful so please continue to be polite so I don't regret pointing out the likely problem.

Last edited by techhelpbb : 18-03-2016 at 11:50.
  #13   Spotlight this post!  
Unread 18-03-2016, 14:25
ahartnet's Avatar
ahartnet ahartnet is offline
Registered User
AKA: Andrew Hartnett
FRC #5414 (Pearadox)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2005
Location: Houston, Texas
Posts: 208
ahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond repute
Re: USB MS Lifecam HD 3000 Exposure Issues

Please see the thread here: http://www.chiefdelphi.com/forums/sh...d.php?t=142633 (or other posts by robert1356).

Basically, you are not doing anything wrong, there's a problem in the USBCamera class that prevents it from working correctly. You might be able to copy and modify the existing class, but it sends a value between 0-100 when it should be something much greater.
__________________
Team 451 The Cat Attack, Student Alumni (2005)
Team 1646 Precision Guessworks, Mentor (2006-2008)
Team 2936 Gatorzillas, Mentor (2011-2014)
Team 5414 Pearadox, Mentor (2015-Present)
  #14   Spotlight this post!  
Unread 18-03-2016, 15:22
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,624
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: USB MS Lifecam HD 3000 Exposure Issues

I don't know if this works on a RoboRIO, but this does work on other Linux distributions:

http://www.techytalk.info/webcam-set...ng-system-cli/

This is a way to get V4L to tell you the range it thinks it can set for a value to the camera.
If V4L gives you the wrong range - then I am not at all surprised everything else would as well.

One way to test, if this can't be built or compiled on the RoboRIO, is to put the camera on a similar enough Linux distribution on a PC or more open embedded system and try it. I may try this, this weekend, on my Intel Edison or ODroid XU4 or Raspberry Pi 2 with Yocto. I just want to see what range V4L thinks is available at the bottom of the stack. The RoboRIO might not be identical.

Last edited by techhelpbb : 18-03-2016 at 15:41.
  #15   Spotlight this post!  
Unread 18-03-2016, 15:46
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,383
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: USB MS Lifecam HD 3000 Exposure Issues

Because of this thread, and because I had some time to kill, I pulled out my RPi 2 and tried a few tests to see what I could figure out for the LifeCam HD-3000 and adjusting exposure.

The first step was to see if
Code:
V4l2-ctl -L
would list out a setting for exposure. Sure enough it does. You can set it to manual or Aperture Priority mode (auto).
When in manual mode, you need to set the exposure value with exposure_absolute. The range of values it reports as acceptable are: min=5, max=20000.

In testing I found that it still had what amounted to a binary response to inputs while in manual. Any value above 5 resulted in over exposure. 5 resulted in under exposure. It didn't matter if I used anything from 6 to 20000, it was over exposed. 5 resulted in under exposure.

So now the next test is, can we set it to an exposure_absolute=5 and have a bright enough light shine on the target to get acceptable tracking of the target? (Enter the 3 X 3w LED ring).
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi