Go to Post It sounded like a good idea, and then I thought about it. :-/ - Wetzel [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 16 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 13-01-2011, 22:26
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: FRC 2011 Vision Tracking

Are you going to stick with labview, or are you open to java. If you are open to java I can help you get started with the vision tracking. WPIlib has a lot of support for the camera. Basically you calibrate the camera to see the target, and then it return the the size, x, and y of the target. You can use all three of these to approach the target.

You say you have servos, but I think a static camera may be easier to use. You do not need the camera moving around to use it, especially not for this game. It will only complicate things.

Use the y to tell how far you are from the target and the x to center your robot (having the ability to strafe helps a lot here) I would recommend putting your robot at the distance it needs to be to cap and then mount the camera so the bottom target is at the top of the image.

Look at 2009's sample labview code, there may be a tracker in there. The code for that year tracked two colors, but it can be adjusted to track one. I know in java is the tracker sample, labview may be different
__________________
"Never let your schooling interfere with your education" -Mark Twain

Last edited by mwtidd : 13-01-2011 at 22:33.
Reply With Quote
  #2   Spotlight this post!  
Unread 14-01-2011, 02:04
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: FRC 2011 Vision Tracking

The imaging libs, like almost everything else in WPI is almost identical in LV, C++, and Java. The library names and a few conventions are different, but otherwise the same.

As mentioned, the 2009 examples and other color tracking examples are applicable.

If you've read the tutorial, it mentions robot mounted lighting. Have you built one? Do your images look something like the ones in the tutorial? The next step is to use something such as color threshold or subtraction of an unlit image from a lit image. This refers to flashing the light near your own camera. With either of these approaches, you'll have a binary image. Adjust the threshold or other factors until this isolates the targets. Note that when viewing a binary image, be sure to right-click on the image viewer and choose the palette for binary.

Once you have particles, use the particle analysis report or similar technique for getting location, size, and other measurements from the particles in the image.

Finally, I highly recommend reading portions of the Vision Concepts manual. It is located in Start>>National Instruments>>
and the last part of the path is either Vision>>Documentation, or just Documentation. It will review the many different tools available, show images, talk about conditions that affect when the technique will work best. It reviews the various filters and processing for binary images which may be useful for removing unwanted noise, etc.

Finally, feel free to ask more specifics here, including images or partially processed images.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 14-01-2011, 10:17
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: FRC 2011 Vision Tracking

Quote:
Originally Posted by Greg McKaskle View Post
\
If you've read the tutorial, it mentions robot mounted lighting. Have you built one? Do your images look something like the ones in the tutorial? The next step is to use something such as color threshold or subtraction of an unlit image from a lit image. This refers to flashing the light near your own camera. With either of these approaches, you'll have a binary image. Adjust the threshold or other factors until this isolates the targets. Note that when viewing a binary image, be sure to right-click on the image viewer and choose the palette for binary.\
Thanks for this tip, I didn't even think of the lit vs unlit. I think a combination of the two will be the best way to go, The white inner tubes mimic the reflective tape, so you need to use the color threshold to tell the difference. However if you're just doing it in autonomous the lit vs unlit should suffice.
__________________
"Never let your schooling interfere with your education" -Mark Twain
Reply With Quote
  #4   Spotlight this post!  
Unread 14-01-2011, 10:19
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: FRC 2011 Vision Tracking

Quote:
Originally Posted by Greg McKaskle View Post

If you've read the tutorial, it mentions robot mounted lighting. Have you built one? Do your images look something like the ones in the tutorial? The next step is to use something such as color threshold or subtraction of an unlit image from a lit image. This refers to flashing the light near your own camera. With either of these approaches, you'll have a binary image. Adjust the threshold or other factors until this isolates the targets.
Hi Greg,

How well does the RGB thresholding work for these targets? I am worried different lighting/exposure levels may throw it off. Do you think using an IR light source and the appropriate filter over the CCD could yield better results? It would make the thresholding single channel and may be less susceptible to varying backgrounds and lighting conditions. Or, do you think this would be overkill?

Thanks in advance.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-01-2011, 10:37
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: FRC 2011 Vision Tracking

I had a lot of success with just using a standard light bulb, and then changing the lighting environment. Luckily the reflective tape reflects back to the light source, so when i used HSL filter(just like the 09 code) it woked in several lighting environments. The only light that would effect you is on directly behind you at the level of your robot. So I think comp lighting wont be as much of an issue with this system.
__________________
"Never let your schooling interfere with your education" -Mark Twain
Reply With Quote
  #6   Spotlight this post!  
Unread 14-01-2011, 12:17
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: FRC 2011 Vision Tracking

The ambient lighting shouldn't be that much of an issue.

That is based on the fact that these markers are in roughly the same place and at roughly the same orientation as the circles of last year, and that part of the field doesn't catch much glare. It is bright, but the lights are coming from the long sides of the field.

The second reason is that the material specs claim it as 600X brightness for narrow angles. This means it reflects 600 times as much light back to the source as a white painted surface would. I'm sure the measurement specifics are much more technical than that, but it is very bright. Meanwhile, the ambient light or other spots will be returned to their sources. If they aren't right behind you, you should get a pretty pure reflection of your source.

The lights used in the tutorial were cheap christmas lights, not too bright, and they were acceptable even with windows behind the targets. Depending on your light source color, I would experiment with the white balance and try to set the image exposure similar to how it was for 06. In other words, darken the image to where not much more than the reflected lights and active lights show up in the image. You may be able to do this with the auto exposure and brightness combo, but I believe that it will be best to use a custom exposure that results in markers being high intensity and high saturation. This will also speed the threshold processing since the luminance and saturation will then exclude more pixels before the hue is even calculated.

As for using IR or a single color plane, I'm interested to hear how it works. The sensors should be sensitive there. You may need to replace or modify the lens, and if I remember correctly, the IR source will show up more as a white light and not a colored light.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 19-01-2011, 00:25
Carter12s's Avatar
Carter12s Carter12s is offline
Mentor
FRC #2036 (Black Knights)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Boulder CO
Posts: 93
Carter12s is just really niceCarter12s is just really niceCarter12s is just really niceCarter12s is just really nice
Re: FRC 2011 Vision Tracking

What I have found to be the best way to develop a camera algorithm is to use the NI Vision Assistant. This can be found in the Labview install included in the FRC Labview DVD. The Vision Assistant allows you to tweak your parameters and view what affect the tweaks have on the result. Once you have the image altered to an acceptable level you can export the vision assistant parameters directly to Labview code. For help on this process check our decible.ni.com
__________________
Programing is the real way to build a robot.
Reply With Quote
  #8   Spotlight this post!  
Unread 20-01-2011, 08:48
bsudduth bsudduth is offline
Registered User
None #2751
 
Join Date: Oct 2009
Location: Clemson, SC
Posts: 6
bsudduth is an unknown quantity at this point
Thumbs down Re: FRC 2011 Vision Tracking

I am trying to help Team 2751 to do vision tracking for the first time this year. We program our robot using Java, and I am curious how much of the NI Image Processing library is really available to us. A few questions to anyone kind enough to answer:

1. Other than getting the settings from the color thresholding operation, how much of the NI Vision Assistant algorithm prototyping can be transferred to Java? For example, I did some template matching in the Vision Assistant that works well. I can, of course, save the script for inclusion in VI. Is it possible to access VI from Java?

2. In the Javadoc reference, the package to access NI's nvision library is edu.wpi.first.wpilibj.image. It only has the following classes referenced in documentation:
BinaryImage
ColorImage
CurveOptions
EllipseDescriptor
EllipseMatch
HSLImage
Image
MonoImage
ParticleAnalysisReport
RegionOfInterest
RGBImage
ShapeDetectionOptions

These classes appear to be there to support the Java sample machine vision projects from last year. Are other NI image processing functions available through wpilibj or is it just based on the people writing wrapper classes for the functions that are needed?

3. According to the WPI Robotics Library Users Guide - which is ostensibly for Java and C++ - there is reference to the FRC Vision API Specification document, which gets installed with WindRiver. Is it only available in WindRiver? Do I really have to install the IDE for C++ that I don't need since I am using Java NetBeans?

The snippet of information I see in the Library Users Guide says that the FRC Vision Interface includes high level calls for color tracking through TrackingAPI.cpp. It also says programmers may call into the low level library by using nvision.h. Are the trackingAPI and/or the low level calls available to Java? The Java VM we have doesn't support JNI - which is the typical way to make calls to C-libraries.

In summary, it looks like for image processing, LabView has the most support, followed by WindRiver C++, with Java bringing up the rear. From reading this forum, however, I see that several of you are using Java. Are the issues I raise here really not that big of a deal? How did you overcome them?

Any answers and guidance to getting started would be most appreciated. Thanks for your help and good luck during the build season.

Barry Sudduth
Team 2751
Reply With Quote
  #9   Spotlight this post!  
Unread 24-01-2011, 21:55
mcbuckeye mcbuckeye is offline
Registered User
FRC #0011
 
Join Date: Jan 2011
Location: Flanders, NJ
Posts: 1
mcbuckeye is an unknown quantity at this point
Re: FRC 2011 Vision Tracking

Hi--we are also looking for any sample Java code that would demonstrate how to grab images from the Axis camera and process them for tracking, etc.

I see references to prior year demo code. Where can we find that?

Thanks!
Reply With Quote
  #10   Spotlight this post!  
Unread 24-01-2011, 22:27
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: FRC 2011 Vision Tracking

Anyone looking for code for the vision tracking in Java, shoot me an email.

mwtidd@gmail.com

I will add you to my dropbox and supply you with my working camera code.
Also I created a video tutorial that explains how I accomplished the task.
__________________
"Never let your schooling interfere with your education" -Mark Twain
Reply With Quote
Reply


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:18.

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