Thread: Vision Failing
View Single Post
  #2   Spotlight this post!  
Unread 31-03-2012, 20:59
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Vision Failing

I can't comment on the specifics of how to make your algorithm work (2702's is in a similar state of "nearly works"), but one way to test would be to save a bunch of JPGs from the camera, and then you can use them as test images or debug them intensively. We always found the most difficult part of testing the camera was reproducing what went wrong, and only this year at our last competition figured out how to get a good debugging going on.


Basically, you do something like this:
if(stick1.GetRawButton(1))
{
image->Write("savedimage.jpg");
}
To save your images. When the robot starts acting up, save the images to the cRio's internal storage with the button and retrieve them by FTP. Then, you can take a look in image-editing software to figure out the thresholds you need.

Then, modify the code so that instead of doing
Code:
ColorImage* image = new RGBImage;
camera.GetImage(image);
You do
Code:
ColorImage* image = new RGBImage("savedimage.jpg");
This way, your code will run on the saved test image and you'll be able to deduce precisely what went wrong.
Reply With Quote