View Single Post
  #1   Spotlight this post!  
Unread 29-01-2012, 23:39
Sinani201 Sinani201 is offline
Registered User
AKA: Daniel
FRC #1836 (Milken Knights)
Team Role: Programmer
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Los Angeles, CA
Posts: 12
Sinani201 is an unknown quantity at this point
GetParticleAnalysisReport causes crash

Whenever I try to use the command GetParticleAnalysisReport, the robot stops working and I have to reboot it. Not sure why this is happening. Here is the code:
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;
This happens the very first time GetParticleAnalysisReport is called, so it doesn't have to so with overwriting the report variable (though I don't know if this will end up being a problem later).

Any help would be greatly appreciated.
Reply With Quote