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

6 次查看(过去 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.

更多回答(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