Skip to content

Commit

Permalink
fix: override width and height (tf flattens the pcl for some reason...)
Browse files Browse the repository at this point in the history
  • Loading branch information
jws-1 committed Mar 19, 2024
1 parent 6f554d9 commit 87c4440
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions common/vision/lasr_vision_yolov8/src/lasr_vision_yolov8/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,19 @@ def detect_3d(
if has_segment_masks:
detection.xyseg = result.masks.xy[i].flatten().astype(int).tolist()

centroid = cv2_pcl.seg_to_centroid(pcl_map, np.array(detection.xyseg))
centroid = cv2_pcl.seg_to_centroid(
pcl_map,
np.array(detection.xyseg),
height=request.pcl.height,
width=request.pcl.width,
)
detection.point = Point(*centroid)
min_max = cv2_pcl.seg_to_minmax_z(pcl_map, np.array(detection.xyseg))
min_max = cv2_pcl.seg_to_minmax_z(
pcl_map,
np.array(detection.xyseg),
height=request.pcl.height,
width=request.pcl.width,
)
detection.min_point = Point(*min_max[0])
detection.max_point = Point(*min_max[1])

Expand Down

0 comments on commit 87c4440

Please sign in to comment.