How to calculate distance between center of white pixels in an image?
5 次查看(过去 30 天)
显示 更早的评论
In this iamge, I want to measure the distance between the center of area of white pixels marked below.
As these are not definite shapes, how do I find the center of these and then measure the distance in pixels between their centers.
0 个评论
采纳的回答
KSSV
2019-7-22
REad about imdistline; this will allow you to calculate the distance between the points interactively. For this you are supposed to have image toolbox.
[y,x] = find(I==1) ; % give the pixel value
The above line, gives you the coordinates/ points of the required pixel. YOu have the points in hand, you can do the process needed.
2 个评论
更多回答(1 个)
Teja Muppirala
2019-7-22
You can find the center (centroid) of each white region using REGIONPROPS, and then just calculate the distance between the centers that regionprops returns.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!