Distance to an object

조회 수: 9 (최근 30일)
Gideon Oladipupo
Gideon Oladipupo 2019년 7월 4일
댓글: Gideon Oladipupo 2019년 7월 5일
Hi. I have a kinect v1 camera. Will like ti know the steps to take to calculate the distance to an object. Also, I acquire a tyre wheel picture using the rgb camera. I used the imfindcircle to locate the centre of the wheel as well as the radius and I got some values (which I guess they are pixels). How do I convert this to metres or mm as the case maybe? Attached is the located circle. The centre and radius as returned on the command line is
center =
379.4851 377.5351
radius =
50.9897
phase_coding_method.jpg
  댓글 수: 4
Julie
Julie 2019년 7월 4일
So, getting the distance to an object not shown in the image is very diffrent than getting the distance between 2 objects in an image. I have no idea how to do it, other than maybe taking pictures of the wheel at various known distances and using the sizes of the central hub to estimate distance. There is probably a better way, but it is not something I have worked with.
Gideon Oladipupo
Gideon Oladipupo 2019년 7월 4일
Ok, many thanks for your time. Can you suggest a better ways to get this done? I will appreciate if you could suggest any link that would be helpful to me. Do I need to calibrate the kinect camera or I can go ahead to use it directly?

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

답변 (2개)

Image Analyst
Image Analyst 2019년 7월 4일
I assume you have a distance image from the Kinect camera as well as the optical RGB image. So just use the centroid you got from the optical image to read the value from the distance image.
column = centers(1); % x
row = centers(2); % y
distanceToCenter = distanceImage(row, column) % Read distance from distance image (not optical RGB image)
  댓글 수: 6
Gideon Oladipupo
Gideon Oladipupo 2019년 7월 5일
Sent above is the optical image which was was saved as image tool and the matlab functions which I tweaked around. Am still learning on the job. Not sure if the code I sent is what you desire. Essentially, I used imfindcircle function to detect the red cycle in the first image. RGB camera parameter is 'BGR_1920x1080'. Hope the information I provided will be okay to help me further. Regards.
Image Analyst
Image Analyst 2019년 7월 5일
Kinect gives you two images. You forgot to attach the distance image - the other image (NOT the optical RGB image) where the values are the distance from the Kinect camera to objects in the scene. Please attach it. But anyway, my original answer gave you the code for getting the distance.

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


Gideon Oladipupo
Gideon Oladipupo 2019년 7월 5일
So sorry for the omission, attached is the depth image in png format. The depth camera parameter is 'Depth_512x424'.depth_image.png
  댓글 수: 1
Gideon Oladipupo
Gideon Oladipupo 2019년 7월 5일
I was able to get the point cloud of the wheel using the depth camera. Will like to confirm steps to take in getting the real distance of the wheel from the camera. Any link to understand how it works would be appreciated. Attached is my point cloud extractedpc_depth_light.jpg

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by