View Single Post
  #4   Spotlight this post!  
Unread 30-01-2012, 04:08
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: GetParticleAnalysisReport causes crash

Quote:
Originally Posted by Sinani201 View Post
Code:
ColorImage* camerain = camera->GetImage();
BinaryImage* binImage = camerain->ThresholdHSL(0,9,0,5,250,255);
int numParticles = binImage->GetNumberParticles();
delete camerain;
ParticleAnalysisReport* report;
for(int i = 1; i<=numParticles; i++)
{
    binImage->GetParticleAnalysisReport(i,report);
    // Other processing stuff
}
delete binImage;
It looks like the code should have been:
Code:
ColorImage* camerain = camera->GetImage();
BinaryImage* binImage = camerain->ThresholdHSL(0,9,0,5,250,255);
int numParticles = binImage->GetNumberParticles();
delete camerain;
for(int i = 0; i<numParticles; i++)
{
    ParticleAnalysisReport = binImage->GetParticleAnalysisReport(i);
    // Other processing stuff
}
delete binImage;
__________________

Last edited by mikets : 30-01-2012 at 04:22.
Reply With Quote