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?

1 次查看(过去 30 天)
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?

回答(1 个)

Matt J
Matt J 2015-12-29
编辑:Matt J 2015-12-29
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.

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by