Obtain the rgb
image of the camera, and perform grayscale and binarization processing on the image. Then use the pytesseract
text recognition library to recognize the English letters or numbers of the image, and post the recognition result to the detect_word_reslut
topic.
<aside> 💡 Note: Before running the command, please make sure that the programs in other terminals have been terminated. The termination command is: Ctrl+c
</aside>
Launch node management, and enter the command in the terminal:
roscore
Enter the command and start the text recognition.
rosrun vision detect_node.py
Execute rostopic echo /detect_word_reslut
to view the recognized results.
rostopic echo /detect_word_reslut
The idea of using OpenCV for color recognition in ROS is to use cv_bridge
to convert the ROS image message into OpenCV format, and then apply color threshold filtering on the image to extract the color range of interest. Label detection results, e.g. by drawing bounding boxes, and publish the results to a new ROS topic for use by other nodes. The process includes image acquisition, color space conversion, threshold processing, and result release, allowing the robot to identify target color areas in real-time.
<aside> 💡 Note: Before running the command, please make sure that the programs in other terminals have been terminated. The termination command is: Ctrl+c.
</aside>
Enter the command to launch the color recognition.
rosrun limo_visions recognition
The idea of using OpenCV for color recognition in ROS is to use cv_bridge
to convert the ROS image message into OpenCV format, and then apply color threshold filtering on the image to extract the color range of interest. Mark the detection results, and then determine whether it is necessary to publish data to the /cmd_vel topic based on the detection results.
<aside> 💡 Note: Before running the command, please make sure that the programs in other terminals have been terminated. The termination command is: Ctrl+c.
</aside>
Enter the following command to launch the color following.
roslaunch limo_visions follow.launch