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
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.
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.