# How to divide a closed detected edge of an image into 8 parts from a point inside in it..?

7 views (last 30 days)
KRISHNA TEJA DUDE on 4 Jul 2020
Answered: Image Analyst on 5 Jul 2020 at 15:58
During my work course,I detcted the edge of the image. Now, I need to divide that closed edge detected image into equal parts from a point so that I can see which have greater area cointaing shaded edge portion .

Image Analyst on 4 Jul 2020
Don't you see a contradiction in your requirements? If the parts are equal how can one have greater area (except for digitization noise)? What do you mean by equal? Equal areas or equal angles? If the angles from the centroid are equal, then of course one sector might have a different area than another sector. Is that what you meant?
KRISHNA TEJA DUDE on 4 Jul 2020
yah..! I need the equal angles from centroid. So the below figure can have different areas corresponding to the parts as like cutting a pizza into equal parts from a point.
It would be helpful if u write a code for me.

darova on 5 Jul 2020 at 11:14
• use bwboundaries to get coordinates of a circle
• divide into equal parts
x(1:end/8)

KRISHNA TEJA DUDE on 5 Jul 2020 at 15:39
I got something for dividing a gray image into 8 parts from a point where i converted a rectangular matrix into square matrix
function [first,second,three,four,firstone,firstsecond,secondone,secondsecond,threeone,threetwo,fourone,fourtwo] = divide(image)
m =size(image,1); n = size(image,2);
for i = 1:m/2
for j = 1:n/2
first(i,j) = image(i,j);
end
end
figure(1),imshow(first)
for i = 1:m/2
for j = ((n/2)+1):n
secondd(i,j) = image(i,j);
end
end
second = secondd(1:m/2,((n/2)+1):n);
figure(2),imshow(second)
for i = (m/2+1):m
for j = 1:n
sample(i,j) = image(i,j);
end
end
threefour = sample((m/2+1):m,1:n);
row_s = size(threefour,1);
col_s = size(threefour,2);
for i = 1:row_s
for j = 1:col_s/2
three(i,j) = threefour(i,j);
end
end
figure(3),imshow(three)
for i = 1:row_s
for j = (col_s/2+1):col_s
fourth(i,j) = threefour(i,j);
end
end
four = fourth(1:row_s,(col_s/2+1):col_s);
figure(4),imshow(four)
firstone = triu(first);
figure(5),imshow(firstone)
firstsecond = tril(first);
figure(6),imshow(firstsecond)
second2 = flipdim(second,2);
secondone = triu(second2);
figure(7),imshow(secondone)
secondsecond = tril(second2);
figure(8),imshow(secondsecond)
third = flipdim(three,1);
threeone = triu(third);
figure(9),imshow(threeone)
threetwo = tril(third);
figure(10),imshow(threetwo)
fourone = triu(four);
figure(11),imshow(fourone)
fourtwo = tril(four);
figure(12),imshow(fourtwo)

Image Analyst on 5 Jul 2020 at 15:58