How to extract features from candidates?
1 次查看(过去 30 天)
显示 更早的评论
Krishna Chaitanya
2020-1-17
回答: Constantino Carlos Reyes-Aldasoro
2020-1-17

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

采纳的回答
Constantino Carlos Reyes-Aldasoro
2020-1-17
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Segmentation and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!