4
$\begingroup$

After reading the most famous object detection CNN based methods : YOLO ,YOLO 9000, r-cnn, faster r-cnn...., I was wondering if there is an architecture that can calculate the distance to the obstacle after detection ?? Thank you

$\endgroup$
4
$\begingroup$

Actually, I don't think this is a problem that could be solved just from the image because it could be a small object that is really close or and big object really far. As far as I know, self driving cars use sensors for this. From what I found here, you would need the actual height of the object to calculate it from one image.

I strongly suspect you could also calculate the distance by having two images and then using the distance between the two cameras, and the Pythagorean theorem to calculate it. But that's just conjecture.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ CNNs can distinguish objects from each other, how is that different from learning that distances could change depending on what kind of object it is? You can estimate the distance based on what type of objects they are, right? $\endgroup$ – Jan van der Vegt Feb 14 '18 at 16:13
  • $\begingroup$ I am using this for Self Driving Cars what do you think I should do for this case ? $\endgroup$ – hbdz Feb 14 '18 at 20:27
  • 1
    $\begingroup$ @hbdz that's easier, you can use car's average height, it doesn't differ that much except in the case of special vehicles or trucks. But you can use the height of a regular car as a baseline and then extrapolate from there. Then you follow the first link I gave you about calculating the distance knowing the height, should be a good approximation. $\endgroup$ – zimio Feb 14 '18 at 20:32
  • $\begingroup$ Using two cameras and the pythagorean theorem is called stereo vision, and is a common way of estimating distances. It is very similar to binocular vision in animals. $\endgroup$ – craq Aug 19 '19 at 2:19
2
$\begingroup$

As far as I am aware there are no direct architectures that solve this at this moment in time, but I don't think this is a big issue for CNNs in general. For your training set you could choose to either train directly to estimate a distance if it's always the same object or if there are multiple objects and you want to detect them you can add the distance to the loss function. You need to tune the weighting between these two different objectives however and it might not be obvious how to do this if you don't know how these object detectors work.

EDIT: Based on your additional information:

It mostly depends on the training data you have available, if you have historical distances between the camera and the vehicle then I think a system like I proposed will work significantly better because it allows you to train the network end-to-end.

I could imagine you only have bounding boxes, then you might need to find a different solution, either by approximating the size of the car (by identifying the type of car for example) and using the size of the predicted bounding box as an indicator for how far away it really is. Different cameras might make this tricky due to different types of distortion.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I am using this for Self Driving Cars what do you think I should do for this case ? $\endgroup$ – hbdz Feb 14 '18 at 20:27
  • 1
    $\begingroup$ I added some information based on this $\endgroup$ – Jan van der Vegt Feb 15 '18 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.