Closed lucianzhong closed 1 year ago
Due to the absence of depth-sensing sensors, distance is roughly estimated through image analysis. Based on the known dimensions of the target object prior to actual driving, distance is calculated using pixel size.
Of course, referring to the actual height and width of the target object is an average.
Got it. Thanks for explanation.
Thanks for your explanation. However, The distance detection in my data set doesn't look very accurate. What is the unit of f (focal length)? And I don't understand the decision condition "ymax <= 650" in the code.
if label in self.object_list and ymax <= 650: point_x = (xmax + xmin) // 2 point_y = ymax
try :
distance = (self.RefSizeDict[label][0] * self.f)/ (ymax - ymin)
distance = distance/12*0.3048 # 1ft = 0.3048 m
self.distance_points.append([point_x, point_y, distance])
Looking forward to your reply!
'ymax <= 650' is just because I use a frame size of (1280, 720), and sometimes it detects the vehicle's own body, leading to a false detection of a vehicle ahead. The focal length is filled in based on the camera's focal length.
Thanks for this great work. Just wondering the accuracy of the distance_calculate? The distance calculate using fixed obstacle size for each label?
Best regards