Find the distance between object and camera

4 vues (au cours des 30 derniers jours)
BA Lamine
BA Lamine le 5 Fév 2015
Commenté : BA Lamine le 5 Fév 2015
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.

Réponses (1)

Alessandro Masullo
Alessandro Masullo le 5 Fév 2015
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 commentaire
BA Lamine
BA Lamine le 5 Fév 2015
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Raspberry Pi Hardware dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by