03-16-2007 08:10 PM
03-17-2007 07:01 AM
Hi
Here's my idea. I am using the Vision Development Module from LabVIEW only, but it should be similar when called from C++.
Use the function IMAQ Label (in C++, it is probably called imaqLabel) to generate an image of particle labels. In this image, each pixel holds the number of particle it belongs to. Now you have to do some low-level image processing in C++. Go through all image pixels, and when you hit a pixel of your desired particle, check its neighbors (4 or 8, depending on whether you want to have the contours 8- or 4-connected). If at least one of the neighbors is zero, this is a contour pixel and you can draw it on the canvas for the user.
Hope this helps,
Vladimir
03-17-2007 08:30 AM
If you want to represent the outlines on a pixel by pixel basis, you could use edge detection on your blobs to reduce them to edges (or erosion and subtraction), then search and record the individual pixels as suggested previously.
If you need the contours as a continuous curve, that is much more difficult. I don't have any ideas how to do that at the moment.
Bruce
03-18-2007 03:40 AM
03-18-2007 04:59 AM
Hi
Well I'm not certain, but I definitely don't think that the Particle Analysis function stores the perimeter points for later exposure to the programmer. It would just be an internal waste of memory. However, the Sobel approach you are using is much slower and also gives worse results than the method I've described. If you don't want to get the contour of each particle separately, you can omit the "IMAQ Label" step and use just the original thresholded image for determining the contours of all particles. This is just one more linear pass through the image, thus the performance should not be severely affected.
Vladimir
03-19-2007 04:57 PM
Hello rbiro,
You should be able to get this functionality using ROI's. If you have LabVIEW, I've attached an example vi that I've seen which does what you are looking for. The functions should be the same in C++. You will need to use the imaqMaskToROI function to convert your thresholded image into an ROI containing the contour information.
Regards,
Luke H