How to extract features from candidates?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Krishna Chaitanya
am 17 Jan. 2020
Beantwortet: Constantino Carlos Reyes-Aldasoro
am 17 Jan. 2020
I have a binary image which consists of candidates(White regions).I need to extract following features for each of these candidates.
1.The area (a) of the candidate.
2.The perimeter (p) of the candidate.
3. major axis length (l) and minor axis length (w) of the candidate.
4.The compactness
where is the distance from the centroid of the object to its boundary pixel and d is the mean of all the distances from the centroid to all the edge pixels. Here n is the number of edge pixels
Akzeptierte Antwort
Constantino Carlos Reyes-Aldasoro
am 17 Jan. 2020
First you need to label your objects with bwlabel, e.g.
labelled_image = bwlabel (original_image);
that will return your same image but each non-zero connected region will have a unique label (1,2,3,...) that will allow the function regionprops to extract the features you require:
features = regionprops(labelled_image,'Area','Perimeter', 'MajorAxisLength','MinorAxisLength') ;
Check the description of the functions to see if you can get compactness directly, otherwise you may have to calculate that from another value.
Hope that helps
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!