Find the distance between object and camera
4 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Alessandro Masullo
on 5 Feb 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).
See Also
Categories
Find more on Raspberry Pi Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!