View Single Post
  #7   Spotlight this post!  
Unread 13-01-2012, 15:21
JewishDan18's Avatar
JewishDan18 JewishDan18 is offline
Registered User
FRC #1700
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Sunnyvale, CA
Posts: 185
JewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to behold
Re: Tracking in JAVA?

Quote:
Originally Posted by ProgrammerMatt View Post
I m stuck with actually analyzing the images so far i have a line doing this

Code:
ColorImage image = AxisCamera.getInstance().getImage();
Bye the way team 20? we won WPI with you a year ago remember team GUS 228
Haha yes, I remember, it was an awesome regional. I wish we were going back, but we're doing GSR and CT this year.

So from there, you have an image object. I would recommend printing out the height and width of the image, to make sure your camera is hooked up properly. From there, the traditional route is to threshold the image to get a binary image which should ideally contain only the rectangle. From there, WPILib has a rectangle detection function, which should work for basic stuff. From there, you get the height and width, and can do a bunch of trigonometry to figure out how far away it is. I would start by figuring out the thresholding functions; play around with them and see what they do. If you have any questions, please ask!
Reply With Quote