02-08-2006 08:53 AM - edited 02-08-2006 08:53 AM
I need to be able to separate objects in a U8 image.
I have a program that finds the center of ion hits (white spots) on an image. Sometimes two ions hit very close to each other. This is a problem since they will only be counted as one ion hit - located at the center of mass of the combined hit.
How can I separate them into two separate objects?
The program works as follows:
1. Threshold to get rid of most of the noise (set pixels with value below 20 to 0).
2. Particle filter 2 removes particles of size less than 9 pixels (which usually is noise).
3. Imaq label labels each particle.
4. The labeled particles are used as a mask for imaq centroid.
I somehow need to separate the mask into two parts, if there is a double ion hit.
A sample image is attached, with clear indications of double hits in two places. (de032.png)
Also the program is attached. (the 8 bit binary file reader should not be needed).
Message Edited by svif on 02-08-2006 08:56 AM
02-09-2006 01:49 PM - edited 02-09-2006 01:49 PM
This gives the attached image.

Message Edité par chilly charly le 02-09-2006 08:49 PM
02-10-2006 03:30 AM
Thanks for your reply.
It seems like a very nice method, however, I could not find the vi's you mentioned. Are they a part of IMAQ Vision?
The gauss smoothing seems to be incorporated in CannyEdgeDetection, I will try and see how that vi works.
/Simon
02-10-2006 08:49 PM - edited 02-10-2006 08:49 PM
Any smoothing filter will do. The effect is to damp the image noise, while adding some blur. Use the IMAQ convolute function (in the vision > image processing > filters subpalette) with a 3x3 kernel.
The kernel can be generated using the IMAQ GetKernel function, using Gaussian (4), 3, 4, as inputs for Kernel family, kernel size and kernel number respectively.
The Laplacian filter is a edge detector. That's why it is most often used after noise removal. Use again IMAQ convolute, with Laplacian (2), 7 and 0 as inputs for the GetKernel function.
I have attached the corresponding vi, significantly simpler than yours. Savec as Vision 8.0, not sure you have it yet...
Message Edité par chilly charly le 02-11-2006 04:03 AM
02-10-2006 08:49 PM - edited 02-10-2006 08:49 PM
Any smoothing filter will do. The effect is to damp the image noise, while adding some blur. Use the IMAQ convolute function with a 3x3 kernel.
The kernel can be generated using the IMAQ GetKernel function, using Gaussian, 3, 4, as inputs for Kernel
And the tab bug striked again ! Molly, is there something planned to avoid this ?
Message Edité par chilly charly le 02-11-2006 03:54 AM
02-10-2006 08:49 PM - edited 02-10-2006 08:49 PM
Any smoothing filter will do. The effect is to damp the image noise, while adding some blur. Use the IMAQ convolute function with a 3x3 kernel.
The kernel can be generated using the IMAQ GetKernel function, using Gaussian, 3, 4, as inputs for Kernel
And the tab bug striked again ! Molly, is there something planned to avoid this ?
Message Edité par chilly charly le 02-11-2006 03:52 AM
02-10-2006 08:49 PM - edited 02-10-2006 08:49 PM
Any smoothing filter will do. The effect is to damp the image noise, while adding some blur. Use the IMAQ convolute function with a 3x3 kernel.
The kernel can be generated using the IMAQ GetKernel function, using Gaussian, 3, 4, as inputs for Kernel
And the tab bug striked again ! Molly, is there something planned to avoid this ?
Message Edité par chilly charly le 02-11-2006 03:52 AM
02-10-2006 08:49 PM - edited 02-10-2006 08:49 PM
Any smoothing filter will do. The effect is to damp the image noise, while adding some blur. Use the IMAQ convolute function with a 3x3 kernel.
The kernel can be generated using the IMAQ GetKernel function, using Gaussian, 3, 4, as inputs for Kernel
And the tab bug striked again ! Molly, is there something planned to avoid this ?
Message Edité par chilly charly le 02-11-2006 03:53 AM
02-13-2006 01:50 AM
I must say that your vi is extremely effective, almost too effective since it detects even very weak signals.
In order to understand the processes in the program I tried to add indicators throughout the process, so that I could see the effect of each step in the routine. However im dooing something wrong, when I try to add indicators. Can anyone tell me how to do it right?
02-13-2006 08:35 PM
Your vi is alright... except that you forgot :
1 - to wire the error in/out of the intermediate display operations. Due to the data flow woperationnal mode of LabVIEW, plus the way images are managed in LV, the additionnal pictures were displaying only the end picture. Chaining the operations ensures that the intermediate displays are built before the image is further processed;
2- to change the display mode of the intermediate pictures : rigth click on the display area ands select palette > binary