Given: I have following binary image:
Want: I want to make it more rounded, (but not bigger than original bounding box) as follows.
Currently done:
I have tried 'imdilate'
close all; clear all;clc; o_circ = imread('to_round.jpg'); bw_circ = im2bw(o_circ, graythresh(o_circ)); bw_circ_2 = imdilate(bw_circ, strel('disk',30)); figure(1);imshow(bw_circ_2);
But it did't work as I wanted.
Needed: So what I actually need is to make original shape, as close a possible to ellipsoid shape. I guess I could use the regionprops, but I'm quite sure how to use all the values to plot an ellipse…
st = regionprops(bw_circ,'Centroid','MajorAxisLength','MinorAxisLength','Eccentricity');
[MATLAB version]
R2014a
Best Answer