How to make binary image more rounded, closer to ellipsoid shape?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ivan Shorokhov
le 24 Août 2015
Réponse apportée : Image Analyst
le 25 Août 2015
Given: I have following binary image:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148395/image.jpeg)
Want: I want to make it more rounded, (but not bigger than original bounding box) as follows.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148397/image.jpeg)
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
0 commentaires
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 25 Août 2015
You could try imclose() to do a morphological closing operation.
Or you could call imconvhull() to get the convex hull of each region.
0 commentaires
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!