LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to program variable annular arrays

Hello

 

I have a 2D float array that when converted into an image looks something like this

example.png

From this image I can calculate the centre/centroid of the 'circle' as well as the diameters in the x and y direction (the image is not always perfectly circular).

I now need to do the following:

example2.png

From the centre i need to be able to take the mean of the array values that sit on the red circles. So to clarify I would want to average the array values that sit on on an annulus of radius one and thickness 1, then average the array values that sit on an annulus of radius 2 and thickness 1, average array values that sit on an annulus of radius 3 and thickness 1, etc. until I reach the edge of the circle. I am having a lot of difficulty with this, since the VIs IMAQ Select Annulus dont select the annuli automatically. I found another thread on here that does something similar, but only for circles including the area inside, and the radius of the circle doesnt vary.

 

Any help would be greatly appreciated 🙂

Message 1 of 4
(2,490 Views)

Sounds like you know the center of the circle and presumably can translate that into index values.   You can calculate index values that are radially x +/- y index values away from the center and pass those to a FOR loop to index them out of your 2D array and average them.  

Message 2 of 4
(2,449 Views)

Convert the data to complex and then to r, theta format. In Range & Coerce will then find all the points on the annular ring.  A complex array can be wired directly to XY graph for display. Credit to altenbach who promotes the use of complex data types for 2D problems.

 

The attached VI simulates the effect.

 

Lynn

Message 3 of 4
(2,444 Views)

I read this thread because I thought there was something to learn and I wasn't disappointed.  This was really interesting, by the way!  Had to bookmark it.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 4
(2,433 Views)