02-17-2009 01:19 PM
Hi, I would like to know which parameters "particle analysis" uses to "number" the particles in an image? I am trying to locate 8 points in my image by doing some pre-processing (thresholding-filtering-eroding) then I use particle analysis to obtain the particles that are left. From there I need to measure 6 distances using the caliper function. These distances are dependent on the number LabVIEW gives my particles, however this number is not always fixed, thus the caliper function is not giving me the desired result. I have attached an image with my eight particles, the top 4 are the ones that vary, from left to right they are sometimes numbered (1,2,3,4) and most other times (2,1,3,4). Is there any way for me to control this numbering? The bottom ones are always labeled (5,6,7,8).
Thank you in advance for you help.
02-17-2009 01:27 PM
The particle detection locates particles by scanning the image from left to right, starting at the top row and going to the bottom row. The particles are numbered in the order they are encountered. This order can be fairly random if the particles are lined up in a row.
I usually look at the X and Y coordinates of particles to determine which are which. If you know you are going to have two rows of four, take the first four found and sort them by X coordinate, then do the same with the last four.
Another way is to rotate the camera slightly so the leftmost particle is always encountered first. This forces all the particles to be encountered in the order you expect.
Bruce
02-17-2009 01:28 PM
02-17-2009 01:43 PM
Rotating the camera is not an option for me in this case, but going from what you told me I thought of rotating the image before calling particle analysis then rotating the image in the opposite direction after particle analysis is done and before calling the caliper function and it works like a charm, however it kills my performance since rotating each image takes a long time, can I sort by x and y coordinates (the solution you proposed) programatically?
Thank you.
02-17-2009 02:05 PM
02-17-2009 09:50 PM
Method 1: Bundle all the information you need into a cluster for each spot, with the X coordinate as the first item in the cluster. Sort the cluster array using 1D sort. Extract the information you need from the cluster array.
Method 2: Bundle the X coordinate and the original index into a cluster. Sort the cluster array. Extract the sorted index and use it to get the info you need in the order you want.
Bruce