how to get center point of a box and draw a circle

1 view (last 30 days)
is there any way to get the center point of the boxes and draw a circle with "point a" as center and "point b" as radius.... and cut the circled portion and save it as another image
for i=i2:(i2+i4)
for j=i1:(i1+i3)
pointb(i,j)=255;
end
end
for i = i6 : (i6+i8)
for j = i5 : (i5+i7)
pointa(i,j) = 255;
end
end
This is the code used to get the 2 white boxes. but how to draw a circle with "point a" as center and "point b" as radius.... please do reply....

Accepted Answer

Image Analyst
Image Analyst on 10 Feb 2014
You should be able to get the center of the boxes if you drew them - just take the average of the left and right sides and the top and bottom rows.
Then you can draw a circle using any of the 4 ways in the FAQ http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F

More Answers (0)

Categories

Find more on 3-D Scene Control in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!