Asked by Zara Khan
on 14 Jul 2018

A circle is drawn over a binary image object using plot. After this drawn I again want to scan this circle and want to store its circumference coordinates points to an array. How to do that?

Answer by Image Analyst
on 14 Jul 2018

Accepted Answer

The form or size of the image below doesn't matter. It could be binary (with various irregularly shaped blobs in it), RGB, gray scale, whatever - it just doesn't matter.

Since you already have your (x,y) points of the "circle" (because you plotted them), if they're not already your circumference points (like it's a wiggly circle instead of a perfect circle), then you can fit a circle to what you have to get the "perfect" circle radius and center using the FAQ: https://matlab.wikia.com/wiki/FAQ#How_can_I_fit_a_circle_to_a_set_of_XY_data.3F

Now once you have the perfect circle, you can regenerate the perfect circle coordinates. Call round() on them if you want to quantize them to integer row, column values.

Zara Khan
on 14 Jul 2018

well this is always giving me fixed no of points when considering theta. Actually I dont want this. I want to draw a circle over an binary image objects and want to store all(not fixed no of) its circumference coordinates pixels.

Actually when I am drawing 2 circles with two different radius but with same centers then using theta giving me some fixed no of points whatever the circle circumference is. This is actually I dont want. Circumference length will be different so no of points will differ. Is there any way do this?

Image Analyst
on 14 Jul 2018

Zara Khan
on 15 Jul 2018

Thank you I am done.

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 4 Comments

## Walter Roberson (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/410341-how-to-scan-a-circle-that-is-drawn-over-an-image-object#comment_589258

## Zara Khan (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/410341-how-to-scan-a-circle-that-is-drawn-over-an-image-object#comment_589274

## Walter Roberson (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/410341-how-to-scan-a-circle-that-is-drawn-over-an-image-object#comment_589281

## Zara Khan (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/410341-how-to-scan-a-circle-that-is-drawn-over-an-image-object#comment_589293

Sign in to comment.