From d2ddb5a9db9a3a42a8aee49baa36602964b2a1c2 Mon Sep 17 00:00:00 2001 From: Ken Haagh Date: Thu, 14 Dec 2023 16:26:49 +0100 Subject: [PATCH] z_pos update 2 Signed-off-by: Ken Haagh --- people_tracking/src/people_tracking/person_detection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/people_tracking/src/people_tracking/person_detection.py b/people_tracking/src/people_tracking/person_detection.py index 6474cf6..7d6ac69 100755 --- a/people_tracking/src/people_tracking/person_detection.py +++ b/people_tracking/src/people_tracking/person_detection.py @@ -160,8 +160,9 @@ def process_latest_image(self): cv2.fillPoly(mask_depth, [seg], (255, 255, 255)) # Extract the values based on the mask - masked_pixels = cv_depth_image[mask_depth] - median_color = cv2.mean(cv_depth_image, mask=mask_depth)#np.median(masked_pixels) + # masked_pixels = cv_depth_image[mask_depth] + masked_pixels = cv_depth_image[y1:y2, x1:x2] + median_color = cv2.mean(masked_pixels)#np.median(masked_pixels) # print("Median color:", median_color)