Calculating length of an object

1 次查看(过去 30 天)
Recap
Recap 2016-4-28
编辑: Recap 2016-4-28
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?

回答(1 个)

Image Analyst
Image Analyst 2016-4-28
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.

Community Treasure Hunt

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

Start Hunting!

Translated by