How can i calculate the ( area ,... ) automatic for gray scale image using Matlab code ??

12 views (last 30 days)
Aya Ahmed
Aya Ahmed on 21 Feb 2020
Commented: Aya Ahmed on 4 Mar 2020
How can i calculate the
( (i) area , (ii) centriod , (iii) bounding box , (iv) major axis , (v) minor axis , (vi) eccentricity , (vii) orientation ,(viii) convex area and (ix) extrema ) automatic
for gray scale galaxy image like that using Matlab code ??
to make feature extraction for galaxy images ?
Note >>this image after makeing galaxy oriantation horizontal and cropping it >>

Answers (1)

Daniel Vieira
Daniel Vieira on 21 Feb 2020
you don't calculate areas in grayscale directly, you need to binarize to indicate which pixels count in the area and which dont.
For that:
bw=imbinarize(I);
R=struct2table(regionprops(bw,{'Area','Centroid','BoundingBox',...
'MajoraxisLength','MinoraxisLength','Eccentricity',...
'Orientation','ConvexArea','Extrema'}))
Note that imbinarize hardly ever yields good results at the default properties, without exploring parameters.
  3 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!