Finding the area of multiple segments and circles
Show older comments
Hi!
I have a set of two data derived from an image, I was able to extract particle coordinates using the hough transform and then focus on a specific region of particles in an image.
I've been struggling to compute the area of the circles lying on the boundary of the segment in the figure plot below. I have tried using patch and fill to check if my techniques would work but for some reason they don't.
I am interested in calculating the area packing fraction of the circles highlighted in red, including the fraction of a circle that is cut into the segment of interest.
I have managed to create the following plot:
So far I have been very close and managed to generate this plot:

Using the inpolygon function and some further alteration I get this image:
Any ideas?
After some alteration I manage to acquire the following figure in which discs not touching the segment boundary are excluded:

The packing fraction of interest is the area of the all the circles and segments in red divided by the area of the blue pizza slice minus the area of the large red circle within the blue slice.
r = 600; center_inner = [654, -23]; radius_inner = 125; theta=deg2rad(30);
for i = 1:length(coords.radii);
circle_fraction(i,:) = nnz(in(i,:))/min(size(in));
end
Areaa_Circles = pi*coords.radii.^2;
Area_Circles = pi*coords.radii.^2.*circle_fraction;
Area_Wedge = 0.5*theta*r^2 -0.5*theta*radius_inner^2;
packing_fraction = nansum(Area_Circles)/Area_Wedge
particlesx = particlesx.*in;
particlesy = particlesy.*in;
coords.particlesx(circle_fraction < 1) = nan;
coords.particlesy(circle_fraction < 1) = nan;
figure;
hold on
plot(particlesx,particlesy,'k.');
plot(coords.wedgex,coords.wedgey);
viscircles([center_inner(1) center_inner(2)],radius_inner);
hold off
set(gca,'Ydir','reverse')
My Problem is that the function keeps returning a packing fraction > 1, and i believe i'm doing something wrong in my approach to determining the areas of the segmented circles at the boundary of the wedge.
Any advice would be appreciated, thanks!
2 Comments
Image Analyst
on 28 Jul 2017
Any ideas on what? I don't even know what this means: "I've been struggling the area of the 'cut-off' circles." How do you struggle an area?
Just say what you want to do. And attach the original image and code if you think that will help people to help you.
Accepted Answer
More Answers (0)
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!