The prior post is fine as well, but if you're still wondering the subtlety of why yours didn't work originally, see the // **CHANGE** line here...
Code:
ColorImage* camerain = camera->GetImage();
BinaryImage* binImage = camerain->ThresholdHSL(0,9,0,5,250,255);
int numParticles = binImage->GetNumberParticles();
delete camerain;
ParticleAnalysisReport report; // **CHANGE** - instantiates the real object and not just a pointer to it...(and then below...)
for(int i = 1; i<=numParticles; i++)
{
binImage->GetParticleAnalysisReport(i,&report); // **CHANGE** and now pass the address of the real object to the function so it can make modifications to your real object 'report' from above.
// Other processing stuff
}
delete binImage;
The only other concern is it should be "for (i=0 ; i<numParticles; i++)" or you'll crash at the tail end of the for-loop for going out of bounds. Arrays in C always start with the '0' element ... not '1'.
bob