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?

5 ビュー (過去 30 日間)
Burhan
Burhan 2015 年 12 月 29 日
編集済み: Matt J 2015 年 12 月 29 日
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 Center および File ExchangeCartesian Coordinate System Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by