jason-li-831202 / Vehicle-CV-ADAS

The project can achieve FCWS, LDWS, and LKAS functions solely using only visual sensors. using YOLOv5 / YOLOv5-lite / YOLOv6 / YOLOv7 / YOLOv8 / YOLOv9 / EfficientDet and Ultra-Fast-Lane-Detection-v2 .
GNU General Public License v3.0
162 stars 38 forks source link

accuracy of calcDistance(self, boxes) function #5

Closed lucianzhong closed 1 year ago

lucianzhong commented 1 year ago

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

jason-li-831202 commented 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.

image

Of course, referring to the actual height and width of the target object is an average.

lucianzhong commented 1 year ago

Got it. Thanks for explanation.

nj888-art commented 4 months ago

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!

jason-li-831202 commented 4 months ago

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