Divide circular rings in N angular portions
Show older comments
I am developing a program to process images where there are rings. Basically it is a 640x640 matrix (called T) and the rings are defined by their positions [center, outer_radius, inner_radius]. What I am trying to do, is to divide such circular rings in ''numDivisions'' angular portions, where each portion has equal number of elements from the matrix, and then store each portion as a logical matrix of size 640x640 in a structure called mask (mask(i).Roi would be each portion). The problem is that the angular portions do not have the same number of elements, even if I divide them with the same aperture and they are defined on a symmetric circular ring. What could be the reason for this? How can I solve it?
T = ones(640,640);
n_ang=4;
center=[153.9959 174.2265];
outer_radius=129.6656;
inner_radius=87.1144;
mask= Circle_Mask(T, center, outer_radius, inner_radius, n_ang);
num_elements=[];
for i=1:4
roi = mask(i).Roi;
num_elements(i) = sum(roi(:));
clear roi;
end
num_elements
2 Comments
As a newcomer, you may not know that this forum let's you attach files to your posts, like sample input images. Additionally, it lets you launch code online directly from within your posts (drawing on your image attachments as input), e.g.,
y=(1:5).^2
This means you can demonstrate your code and in what way you think it fails. You are strongly advised to do this.
Valentina
on 16 Feb 2024
Accepted Answer
More Answers (0)
Categories
Find more on Region and Image Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!