06-12-2014 07:52 AM
You need to make sure in your False case that you wire the cluster array straight through. It looks like you have "Default value" enabled for the output, which means in the false case you are clearing the array. This would marry with the error you are seeing regarding insufficient points - you are getting an empty array!
06-12-2014 07:54 AM - edited 06-12-2014 07:55 AM
You haven't wired the Array through the false case in your case Structure.
Whenever the false case is executed you "forget" all previously found points.
Best Regards
Florian
P.S.
Thoric beat me to it
06-12-2014 08:04 AM
THANK YOU VERY MUCH both of you !
You saved my life and I'm so glaaad 😄
06-12-2014 08:10 AM
Are you certain that you will always get 255 for the points you want to analyze? Never 254 or 253? If there can be other values, use a > 128? (or other suitable threshold) in place of the = 255? comparison. It will not change the performance when all the values are 255, but will allow for some noise if that is a possibility.
Lynn
06-12-2014 08:17 AM
yes, thanks for the advice !
06-12-2014 10:05 AM - edited 06-12-2014 10:08 AM
I have now 4 circles, and I want exactly the same thing (center, radius, area, perimeter) for each circle.
I found a VI named IMAQ Count Objects 2. (in Red on the image)
I tried to do a For loop and put number of object into it but I didn't succeed. How can I have the same parameters for circle 2, circle 3 and circle 4 ?
thanks a lot
Program :
06-13-2014 07:35 AM
Regarding the first issue of characterising four circles, you'll need to separate the cluster of coordinate pairs into four arrays, one for each circle. If you know the four circles are in the four rectangluar corners of the image then you have several options:
1. break the image up into four images and perform your existing analysis (unchanged) on each image to get four results
2. modify the nested for loop that determine the location of '255' values to only look at a zone, such as the top left corner only, bet setting the for loop N values and accounting for any starting index offsets. Then perform that on each quadrant.
3. Within the nested loop, determine which of the four quadrants the coordinates are and place the result in one of four clusters of coordinates, one cluster for each quadrant. This is not the recommended way, but might be simpler for you if you are new to LV.
Regarding your second issue of wanting to overlay images, you need to mask out the black areas in your second image otherwise it will entirely cover up your first. It might be better instead to Draw Circles onto the first image, using the centre and radius information you gain from the analysis?
06-18-2014 08:23 AM
For the second problem, I don't understand why (and how) I need to mask out the black areas...
Because if I add the two images, it's like I add a pixel value 0 to a 255 so 0+255 = 255 and not 0.
It seems to be wrong because it doesn't work ^^ I don't understand what I have to do...