I am looking for solving this problem with training a deep learning-based classifier or image processing techniques. ps. I exactly do not need to know how much is distance, I only need to know whether trucks are intruded the certain distance or not.


One possible approach will be to use an algorithm which detects lines (Ex. Hough lines or any deep neural net trained to detect lanes) and use some threshold range so that we can get the lane and the edges of truck, then after extracting the lines, you can easily find the distance between them.

Then you need to experiment out on few images to get the threshold distance that you are expecting the truck to maintain as the real distance and the distance calculated using images are not same

If you want to classify using deep learning, you may need to preprocess the images and send them. As it will become very difficult to directly learn to classify based on image, you may need to first detect the lanes, then apply a mask and then send the masked image to your network to make the network to converge.

| improve this answer | |
  • $\begingroup$ thanks for the reply, I tried the Hough lines and circle. HoughCircle detection, for example, it doesn't detect all the wheels and will also detect random circles in the foliage and as you see the wheels projections are ellipses and not circles, what should I do for that? could you pls elaborate on the second method as well? $\endgroup$ – programmer Jun 26 '19 at 9:44
  • $\begingroup$ You can possibly remove the random circles by specifying a threshold area or use contours. I was expecting that hough lines will be able to detect the edges of the truck trailer (which has straight edges) and the lanes, and calculating gap from those. So, to use deep learning for classification we need lot of data or data which already has some good amount of information that network needs to learn for the task, here the information that network would probably learn is first identifying the lanes and truck, so if we preprocess the image and send those as input the learning process gets easier $\endgroup$ – SaiVinay007 Jun 27 '19 at 2:10
  • $\begingroup$ where can I find more readings about how to calculate distance? I really need to read about them $\endgroup$ – programmer Jun 27 '19 at 14:17
  • $\begingroup$ I don't think there are direct articles on calculating distances in this kind of situtations. I feel this problem can be solved by applying different concepts. Mostly its about image processing that you need to know after you get the lanes and edges of truck or some boundaries of truck to calculate distances. Book by Richard Szeliski which has almost everything related to computer vision. You may also try out image segmentation and find distances on the output $\endgroup$ – SaiVinay007 Jun 27 '19 at 14:44
  • $\begingroup$ what programing language do you think would give better results? do you think using image processing would be robust enough for this project? for example, if the truck changes? $\endgroup$ – programmer Jun 27 '19 at 15:45

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.