You could use imdistline() or improfile() to manually do it. To find it automatically, get a binary image where the blue channel is low and the red channel is high. Then you can get the boundary points and find the farthest distance between any points. See my attached demo.
Calculating length of an object
1 次查看(过去 30 天)
显示 更早的评论
I'm stuck on a problem of trying to calculate the length of an object in my image. Below is the image of a ruler and I'm trying to calculate the length of it. Currently, I have the bounding box of the image but I don't know how I can calculate the length of one side. Any ideas on how I should go about it?
0 个评论
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!