Find location of plotted circle on a binary image
4 ビュー (過去 30 日間)
古いコメントを表示
have to findthe location of the circle, need to walk along the circle and get the pixel value. For example the answer will be almost like 000011111000001111.. when the circle pass through the white region shows "1" and if it pass through black region shows "0".
4 件のコメント
Nir Rattner
2014 年 8 月 5 日
The circle in the provided image appears to be computer generated. What function are you using to draw the circle? It is likely that you can pull the XData and YData from the circle object to get pixel values.
回答 (1 件)
Image Analyst
2014 年 8 月 5 日
編集済み: Image Analyst
2014 年 8 月 5 日
for k = 1 : length(circleX)
row = circleY(k);
column = circleX(k);
pixelValue = binaryImage(row, column)
end
Is that what you want?
3 件のコメント
Nir Rattner
2014 年 8 月 6 日
Note that this may double count some pixels depending on the resolution and rounding of your adjusted_theta vector. You may first want to do:
uniqueXY = unique([x' y'], 'rows');
xUnique = uniqueXY(:, 1);
yUnique = uniqueXY(:, 2);
And then you can use xUnique and yUnique in the loop suggested above.
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!