11-07-2014 04:19 AM - edited 11-07-2014 04:20 AM
Hello
I have a 2D float array that when converted into an image looks something like this
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:
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 🙂
11-07-2014 04:18 PM
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.
11-07-2014 04:27 PM
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
11-07-2014 06:26 PM
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.