0
$\begingroup$

Rosanswers logo

Hello everyone! Is something here who knows a site where can I learn about blob recognition for turtlebot3? Or for robots which uses Compressed images data type? I search on internet but I couldn't find any.


Originally posted by oovidiustr on ROS Answers with karma: 41 on 2019-11-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You first need to decompress your image, you can do so by adding following to your launch file

<node name="republish" type="republish" pkg="image_transport" output="screen" args="compressed in:=/compressed_image out:=/raw_image" />

Here is one post I found for blob detection using opencv for both python and c++. You will also need cv_bridge to convert your subscribed raw_image to opencv format.


Originally posted by Choco93 with karma: 685 on 2019-11-14

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by oovidiustr on 2019-11-15:
Hi! Thanks for reply! Do you have some example of code in python of how to decompress the image? I am really noob at this point so I need something concrete. Thanks!

Comment by Choco93 on 2019-11-18:
you don't need code, you just add this node to your launch file and it will decompress images for you

Comment by oovidiustr on 2019-11-19:
Ok... but in my main program I will use "Compressed" msg type or "Image" ?

Comment by Choco93 on 2019-11-19:
I will explain it once more. Adding this node to your launch file (with correct topic) will decompress your compressed images. Then you need to subscribe to decompressed image topic of type sensor_msgs/Image. Now your goal is work with on image using opencv but the image you subscribed to is ros_image. So you use cv_bridge to convert it to opencv format and then you can use blob detection on it.

Comment by oovidiustr on 2019-11-19:
Thank you!! Now I understand :D

Comment by oovidiustr on 2019-11-19:
How can I see if there is something publishing? I tried to echo the /raw_image topic but nothing comes out.

Comment by Choco93 on 2019-11-19:
rosnode list to list all the nodes, rosnode info /node_name to see info of a node. In info you can see all the topics that are subscribed and are being published by node, also services

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.