View Single Post
  #2   Spotlight this post!  
Unread 28-01-2012, 13:44
kylevedder kylevedder is offline
Programmer
AKA: Kyle Vedder
FRC #0467 (Shrewsbury Colonials)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Massachusetts
Posts: 6
kylevedder is an unknown quantity at this point
Re: Acquiring distance using axis camera

Hi, I am from team 467 and I am the programmer who is working on the code for the camera. My first recommendation would be to read the paper published by National Instruments, here is a link to download the paper:
https://decibel.ni.com/content/docs/DOC-20173
I recommend following the paper up until the point where they do the convex hull operation. There are two reasons for this, because there is no convex hull operation in the library for Java, and because this makes you unable to do a quality filter as I explained later. Instead of the convex hull you should put a filter on the particles the camera sees so you only get the particles that fall into the correct ratio of width to height (which is about 1.33) and fall into the correct quality range (quality is the total area of the bounding box of the particle divided by the total area of the particle) which should be around 30%. Both these functions can be found in the ParticleAnalysisReport class. From this point you can find the center of the backboard setup by getting the center of mass for all four particles. You could even find how far away from the boards the robot is by doing math on the width and height of the particle bounding boxes instead of trying to find the distance between the rectangles. You may not get very good results at first, but keep messing with the thresholds in the NI Vision Assistant software you got in the kit until you get a good image to do processing on.
Good Luck!

Last edited by kylevedder : 28-01-2012 at 13:49.
Reply With Quote