Hi!
I have a binarized image, where I have circles inside squares (see attached image "binarized.bmp").
I want to remove the square, and only keep the circle. But when I run a particle filter, it removes both the square and the circle. I have some circles left in my filtered image, but not as many as I would wish (see attached image "filtered.bmp").
This is my particle filter:
//Remove small and large blobs
filterCriteria[0].parameter = IMAQ_AREA;
filterCriteria[0].lower = 100;
filterCriteria[0].upper = 30000;
filterCriteria[0].exclude = TRUE;
//Remove squares
filterCriteria[1].parameter = IMAQ_HEYWOOD;
filterCriteria[1].lower = (float) 0.7;
filterCriteria[1].upper = (float)1.3;
fi
lterCriteria[1].exclude = TRUE;
//Set border size of the image to make imaqConvolve work
imaqSetBorderSize(myBinaryImage,3);
//Run the particle filter
if(!imaqParticleFilter (myBinaryImage, myBinaryImage, filterCriteria, 2,TRUE, TRUE)){
printf("ERROR: imaqParticleFilter(): '%s'\n",imaqGetErrorText(imaqGetLastError()));
}
How can I be sure to extract the circles?
Thanks!