how can I measure the distance between a camera and my object in a stereo camera?

조회 수: 21 (최근 30일)
I have 2 calibrated stereo cameras and made a perffect 3D-recunstruction model of my object, I can also recognize that object and draw a square around it. my question is, how can I measure the distance between the camera and my object now?

채택된 답변

Jose Lara
Jose Lara 2017년 3월 8일
You can estimate the distance of an object from a camera using the Computer Vision System Toolbox. You will need to calibrate your camera with an object with known dimensions in the image/video. Since you have two cameras, you can use the Stereo Camera Calibrator app, which will estimate the parameters of each of the two cameras and their position/orientation. Follow the link below for instructions on how to implement this: http://www.mathworks.com/help/vision/ug/stereo-camera-calibrator-app.html
Once the calibration has been completed, I suggest checking out the example Depth Estimation From Stereo Video. This example shows to find the distance between the camera and a person using the function "vision.PeopleDetector".
The script on this examplecan be edited with your own Object Detector, such as "vision.CascadeObjectDectector". Refer to the Computer Vision System Toolbox Functions for more information on these Object Detectors.
  댓글 수: 2
Iman.Y
Iman.Y 2017년 3월 10일
thanks. I have to learn how CascadeObjectDecetor works. I have tried other methods beside this one.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for USB Webcams에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by