-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phase2 (b): Perception for TurtleBot 4 Open CV and MediaPipe: 3D Objects #12
base: main
Are you sure you want to change the base?
Phase2 (b): Perception for TurtleBot 4 Open CV and MediaPipe: 3D Objects #12
Conversation
Rebase perception branch with motion planner branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly acceptable but it would be great if we could remove the window / wait keycode and replace it with just publishing the results as new topic. Perhaps something like '\perception\blobs' and 'perception\objects'
You should get familiar with RVIZ and this RQT utility.
current_frame = self.bridge.imgmsg_to_cv2(frames_data) | ||
|
||
# Poping each and every frame | ||
cv2.imshow("TurtleBot4 Camera View", current_frame) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really shouldn't do this. You should use RVIZ or RQT to view the image as a topic.
cv2.FONT_HERSHEY_SIMPLEX, 0.6, (255, 255, 255), 2) | ||
|
||
else: | ||
cv2.putText(process_frames, 'circle', (x_point, y_point), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screams in math.
cv2.FONT_HERSHEY_SIMPLEX, 0.6, (255, 255, 255), 2) | ||
|
||
# displaying the image after drawing contours | ||
cv2.imshow('Turtlebot 4 Simple Object Detection', process_frames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I said, I would publish this as a topic.
i = 0 | ||
|
||
# list for storing names of shapes | ||
for contour in contours: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're going to want to cap the number of contours you process here. You can get in a degenerate situation where you have a large number of "blobs". I would make that number a node parameter and only highlight the n-most largest blobs by area.
|
||
resized_image = cv2.resize(current_frame, (720, 480)) | ||
|
||
# Poping each and every frame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment.
cv2.putText(image, f'FPS: {int(fps)}', (20,70), cv2.FONT_HERSHEY_SIMPLEX, 1.5, (0,255,0), 2) | ||
# displaying the image after drawing contours | ||
cv2.imshow('Turtlebot 4 Simple Object Detection', image) | ||
cv2.waitKey(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do this. You shouldn't wait inside a node loop. Same goes for the other node. Just spit the data out to a topic.
One thing I might add, it is a bit too late now, is that it would have been nice to output the detected objects as some sort of topic. The drawback here is that doing this well is a bit of a rabbit hole in terms of what the messages should look like. |
[In Progress] [(TODO) Update Description]
Implementation of the 3D object detection using openCV and MediaPipe