View Single Post
  #2   Spotlight this post!  
Unread 20-01-2012, 22:38
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: Particle Analysis Report Problems

You declare your variable image2 as a BinaryImage*, which is why the compiler is having trouble. It sees parameter 1's type as "BinaryImage*", but it is looking for Image*. Also, you don't assign anything out of your call to camera.GetImage(). It should be something like image2 = camera.GetImage() [except that might not be the right type. Check out AxisCamera.h to find out what GetImage() returns].

I don't have the code in front of me, but it is likely that what you need to do is do something like this:

ColorImage colorImage;
camera.getImage(&colorImage);
frcParticleAnalysis(&colorImage, 5, par);


However, we had success last night doing something different. We did something very similar to this. It is unlikely the code below or above will compile, it's coming out of memory.
ColorImage img;
camera.getImage(&img);
BinaryImage* binImg = img.ThresholdRGB(192,256,192,156,192,256);
vector<ParticleAnalysisReport>* particles = binImg->GetOrderedReport(); // I don't remember this function's actual name
for(int x = 0;x < particles.size(); x++)
{
ParticleAnalysisReport& par = (*particles)[x];
// do something with par: look at par.center_mass_x, par.center_mass_y, etc.
}

Last edited by Bongle : 20-01-2012 at 22:52.
Reply With Quote