Measuring object size with stereo vision

9 views (last 30 days)
HT
HT on 19 Feb 2017
Hi, I am working on a stereovision project trying to measure diameter of a object using the matlab triangulate function. The way I do this Is using blobanalysis on both Images to detect the objects(two red circles on a piece of paper pinned to a wall). Then I Insert a square box around both circles, and uses triangulate on the corner coordinates for the left top corner In both Images, and the same for the right top corners. Then I substract the resulting X koordinate on the left side corner from the resulting right side corner X coordinate. Is this a possible way to get the diameter? because I am getting numbers that are way off from the reality.
I have done this with a single calibrated camera, and got good results. But now I want to do the same with two cameras, hopefully some of you could spare some time to explain what I am doing wrong.
  1 Comment
Stalin Sabu Thomas
Stalin Sabu Thomas on 19 Oct 2018
If you get a bbox of the detected object, here a circle, isn't it safe to say that the width of the bbox is the diameter itself? the third column of the bbox is the width. I don't think you need to have a stereo image or triangulation to get the diameter of the object as it can be done with one single camera image. But one possibility is to triangulate the left & right top corners (world coordinate points) of the bbox and get the distance between them using Euclidean distance ie. sqrt( (x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2 )

Sign in to comment.

Answers (1)

Tohru Kikawada
Tohru Kikawada on 21 Feb 2017
Have you tried this example?
Generally, the accuracy of stereo vision depends on the estimated stereoParameters. You might want to review the results of stereo camera calibration.
  1 Comment
Shaik Ahmad
Shaik Ahmad on 17 Oct 2018
Thank you for the information. I have seen the implementation about triangulate function, it explained how to calculate the distance from the camera to the object. But it didn't mention about the dimension of the object.
Could you please provide some information related to measuring the object dimensions.
Thank you

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!