Find the distance between object and camera

4 次查看(过去 30 天)
Hello every body,
I'm in the last year of my school study. My engineer project is to find the distance between object and camera by running the software in the Raspberry PI. I find some programs that allow me to recongnize the object that I look for and I have an algorithm which calculate the position of the pixel center in the object in matlab. This algorithm is now running on my PC by capturing the image with my Raspberry PI. Now I have two question, Is it possible to compile some matlab function by using it in Simulink for running them in simulink. And the second is how to calculate the exact distance between camera and the object.
PS : Matlab code is not running in the Raspberry Pi just simulink model. So I want to compile some function in Image processing to use them in my simulink model.
Thank you in advance. I think my questions or my explanations were clear. Thank you for helping.

回答(1 个)

Alessandro Masullo
Calculating the distance between an object and a camera in not an easy task. In theory, you would need two different cameras because one camera only gives you two-dimensional information.
If you only have one camera, you need some tricks to evaluate that distance. If the object (or the camera) is moving you can use some perspective rules to guess the object distance (an object very far away as the background do not change its size while you move the camera, while objects really close to it change their size).
  1 个评论
BA Lamine
BA Lamine 2015-2-5
Thanks you for your fast answer. I have two camera (RaspberryPI camera and USB camera) but I just used one of them (USB Cam). I think when I use two camera, the time to calculate the distance will be very very slow. I try to track a robot and the robot will go fast. If the time to calculate is long, the system is not be helpfull for the robot.
Thank you.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Raspberry Pi Hardware 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by