How to divide a binary image circularly into "n" non overlapping equal size sectors around its center of gravity to count foreground pixels in each sector?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How to divide a binary image circularly into "n" non overlapping equal size sectors around its center of gravity to count foreground pixels in each sector?
0 commentaires
Réponses (1)
Matt J
le 29 Déc 2015
Modifié(e) : Matt J
le 29 Déc 2015
Use NDGRID and FIND,
[M,N]=size(binaryImage);
[X,Y]=ndgrid((1:M)-centerX,(1:N)-centerY)
[i,j]=find(binaryImage);
Then use cart2pol to convert to polar coordinates,
theta = cart2pol(X(i),Y(j));
and finally apply histcounts() to theta.
0 commentaires
Voir également
Catégories
En savoir plus sur Cartesian Coordinate System Conversion dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!