forked from HQU-gxy/CVTH3PE
fix: Update distance calculation in playground.py to include image size parameter
- Modified the distance calculation function to accept an image size parameter, enhancing accuracy in 2D distance computations. - Improved the integration of camera parameters into the tracking logic for better performance and reliability.
This commit is contained in:
@ -762,7 +762,12 @@ for i, tracking in enumerate(trackings):
|
|||||||
tracking_2d_projection = camera.project(tracking.keypoints)
|
tracking_2d_projection = camera.project(tracking.keypoints)
|
||||||
for det in detections:
|
for det in detections:
|
||||||
delta_t = det.timestamp - tracking.last_active_timestamp
|
delta_t = det.timestamp - tracking.last_active_timestamp
|
||||||
distance_2d = calculate_distance_2d(tracking_2d_projection, det.keypoints)
|
w, h = camera.params.image_size
|
||||||
|
distance_2d = calculate_distance_2d(
|
||||||
|
tracking_2d_projection,
|
||||||
|
det.keypoints,
|
||||||
|
image_size=(w, h),
|
||||||
|
)
|
||||||
affinity_2d = calculate_affinity_2d(
|
affinity_2d = calculate_affinity_2d(
|
||||||
distance_2d,
|
distance_2d,
|
||||||
delta_t,
|
delta_t,
|
||||||
|
|||||||
Reference in New Issue
Block a user