Clear Filters
Clear Filters

Calculating length of an object

1 view (last 30 days)
Recap
Recap on 28 Apr 2016
Edited: Recap on 28 Apr 2016
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?

Answers (1)

Image Analyst
Image Analyst on 28 Apr 2016
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!