From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to take circle attributes seperately

Solved!
Go to solution

Hello all,

 

I need to group the attributes(like radius, center x, center y) of circles from IMAQ Detect Circles function. For instance, all of the y positions need to be grouped in an array. I could not seperate them.

 

I tried a few things to do that. I'm adding my last try as attachment. Because I am new at Labview it may be not a good way. If it is not a good way to do this task, I would be pleased to hear different methods or modifying the VI would be appreciated 🙂

Download All
0 Kudos
Message 1 of 8
(2,709 Views)
Solution
Accepted by topic author sevincom

@omersevinc wrote:

Hello all,

 

I need to group the attributes(like radius, center x, center y) of circles from IMAQ Detect Circles function. For instance, all of the y positions need to be grouped in an array. I could not seperate them.

 

I tried a few things to do that. I'm adding my last try as attachment. Because I am new at Labview it may be not a good way. If it is not a good way to do this task, I would be pleased to hear different methods or modifying the VI would be appreciated 🙂



The IMAQ Detect Circle vi returns an array of clusters. Each cluster contains a position cluster with X and Y information (single precision float), the radius (double precision float), and the score (double precision float). You can separate these out by first getting a single element from the array. In the snippet below, I use an indexed tunnel in a For Loop to do this. Then use the Unbundle by Name function to separate the three elements of the cluster. You'll need to use the Unbundle by Name function again to pull out X and Y from the Position Cluster. Then just run all values out of the For Loop with an indexed tunnel and you have it. Hope this was what you were looking for.

 

Separate Circle Parameters.png

 

Regards,

------------------------------
All statements are my opinion and worth every cent you paid for them.
Tom Whitaker, CLD
- - - - - - - - - - - - - - - - - - - -
"Give every man thy ear but few thy voice."
Polonius in Hamlet.
Message 2 of 8
(2,684 Views)
Actually, the second unbundle by name is not needed. Clusters within clusters can be unbundled directly.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 8
(2,661 Views)

Thank you both for your helps. I did it like you explained.

 

I don't know do I need to open a new topic but now I have another problem with circle detection. As you can see from the image, I have only 6 circles. But the function detects 12 circles. It detects each circle twice with small differences. What should I do to constraint the second detections?

0 Kudos
Message 4 of 8
(2,632 Views)

Hi omer,

 

in your picture I can see 12 circles: 6 black ones overlaid by 6 white circles… 😄

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(2,628 Views)

GerdW,

 

You are right Smiley Happy but I need to detect only the black ones

0 Kudos
Message 6 of 8
(2,620 Views)

Hi omer,

 

group the circles by their XY coordinates and choose the bigger one of each pair…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(2,615 Views)

 

GerdW,

 

I was looking for an option like find best edge in VBAI but sorting also works for now Smiley Happy

 

Thanks for your help.

0 Kudos
Message 8 of 8
(2,585 Views)