Skip to content

Commit

Permalink
saving change
Browse files Browse the repository at this point in the history
Signed-off-by: Ken Haagh <[email protected]>
  • Loading branch information
KenH2 committed Dec 14, 2023
1 parent fd0e6bc commit 65557d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions people_tracking/src/people_tracking/people_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,11 +665,11 @@ def plot_tracker(self):
latest_image = self.latest_image
cv_image = bridge.imgmsg_to_cv2(latest_image, desired_encoding='passthrough')

if not self.target_lost:
if len(self.approved_targets) > 0 and self.tracked_plottable: # Plot latest approved measurement
x_approved = self.approved_targets[-1].x
y_approved = self.approved_targets[-1].y
cv2.circle(cv_image, (x_approved, y_approved), 5, (0, 0, 255, 50), -1) # BGR
# if not self.target_lost:
if len(self.approved_targets) > 0 and self.tracked_plottable: # Plot latest approved measurement
x_approved = self.approved_targets[-1].x
y_approved = self.approved_targets[-1].y
cv2.circle(cv_image, (x_approved, y_approved), 5, (0, 0, 255, 50), -1) # BGR

# # Get location with UKF
# current_time = float(rospy.get_time())
Expand Down
3 changes: 2 additions & 1 deletion people_tracking/src/people_tracking/person_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def request_depth_image(self, time_stamp):
if time_stamp is not None:
response = self.depth_proxy(int(time_stamp))
return response
# rospy.loginfo(f"Depth: {response}")
rospy.loginfo(f"Depth: {response}")
except rospy.ServiceException as e:
rospy.logerr("Failed to get depth: %s", str(e))

Expand Down Expand Up @@ -114,6 +114,7 @@ def process_latest_image(self):
# Save Image
if save_data:
cv2.imwrite(f"{save_path}{batch_nr}.jpg", cv_image)
cv2.imwrite(f"{save_path}{batch_nr}_depth.jpg", cv_image)
# People detection
classes, segmentations, bounding_box_corners = self.detect(self.model, cv_image)
if classes is None or segmentations is None:
Expand Down

0 comments on commit 65557d8

Please sign in to comment.