当前位置:网站首页>Opencv face recognition of ros2 foxy~galactic~humble
Opencv face recognition of ros2 foxy~galactic~humble
2022-06-13 00:39:00 【zhangrelay】
OpenCV Tools are widely used . About the ROS2 How to use the blog has not been updated :
Earliest ,2019 year :ROS2 Use OpenCV Basics
Recently updated some :
The exercises used in the simulation are as follows :
So how to achieve the following face recognition effects ?
Mona Lisa's smile , Always so mysterious ……
Problems encountered, such as :
[INFO] [1655036597.738995500] [face_detection]: Receiving image
Traceback (most recent call last):
File "/opt/ros/humble/local/lib/python3.10/dist-packages/cv_bridge/core.py", line 194, in imgmsg_to_cv2
res = cvtColor2(im, img_msg.encoding, desired_encoding)
RuntimeError: [8UC3] is not a color format. but [bgr8] is. The conversion does not make sense
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/zhangrelay/ros_ws/opencv_ros2-main/opencv_ros2/face_detection.py", line 95, in <module>
main()
File "/home/zhangrelay/ros_ws/opencv_ros2-main/opencv_ros2/face_detection.py", line 84, in main
rclpy.spin(face_detection)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/__init__.py", line 222, in spin
executor.spin_once()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 712, in spin_once
raise handler.exception()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
self._handler.send(None)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 418, in handler
await call_coroutine(entity, arg)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 343, in _execute_subscription
await await_or_execute(sub.callback, msg)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
return callback(*args)
File "/home/zhangrelay/ros_ws/opencv_ros2-main/opencv_ros2/face_detection.py", line 53, in listener_callback
current_frame = self.br.imgmsg_to_cv2(data, "bgr8")
File "/opt/ros/humble/local/lib/python3.10/dist-packages/cv_bridge/core.py", line 196, in imgmsg_to_cv2
raise CvBridgeError(e)
cv_bridge.core.CvBridgeError: [8UC3] is not a color format. but [bgr8] is. The conversion does not make sense
How to solve it ?
Tips :
current_frame = self.br.imgmsg_to_cv2(data, "rgb8")
answer :
[8UC3] is not a color format. but [rgb8] is.
[email protected]:~$ ros2 node list
/face_detection
/image_publisher
/rqt_gui_py_node_1492
[email protected]:~$ ros2 node info /face_detection
/face_detection
Subscribers:
/image_raw: sensor_msgs/msg/Image
Publishers:
/parameter_events: rcl_interfaces/msg/ParameterEvent
/rosout: rcl_interfaces/msg/Log
Service Servers:
/face_detection/describe_parameters: rcl_interfaces/srv/DescribeParameters
/face_detection/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
/face_detection/get_parameters: rcl_interfaces/srv/GetParameters
/face_detection/list_parameters: rcl_interfaces/srv/ListParameters
/face_detection/set_parameters: rcl_interfaces/srv/SetParameters
/face_detection/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
Service Clients:
Action Servers:
Action Clients:
[email protected]:~$
Basic concepts
What is face detection ?
In computer vision , One of the basic problems that we try to solve is to automatically detect objects in images without human intervention . Face detection can be considered as the problem of detecting faces in images . There may be subtle differences in human faces , But on the whole , To be sure , Certain features are related to all human faces . There are many face detection algorithms .
Face detection is usually the first step of many face related technologies , For example, face recognition or verification . However , Face detection can have very useful applications . The most successful application of face detection is probably photographing . When you take pictures of your friends , The built-in face detection algorithm of the digital camera will detect the position of the face and adjust the focus accordingly .
What is? OpenCV
In the field of artificial intelligence , Computer vision is one of the most interesting and challenging tasks . Computer vision is like a bridge between computer software and the visualization around us . It allows computer software to understand and understand the visualization of the surrounding environment . for example : According to color 、 Shape and size determine the fruit . This task may be easy for the human brain , But in the computer vision pipeline , First we collect data , Then perform data processing activities , Then train and teach the model to know how to distinguish fruits according to their size , The shape and color of the fruit .
at present , There are various software packages to perform machine learning 、 Deep learning and computer vision tasks . up to now , Computer vision is the best module for such complex activities . OpenCV It's an open source library . It is supported by various programming languages , for example R、Python. It can run on most platforms , for example Windows、Linux and MacOS.
边栏推荐
- 安全事故等级划分为哪几级
- Learning and Development notes of mongdb
- [ciscn2019 North China Day2 web1]hack world --buuctf
- [C] Inverts the binary of a decimal number and outputs it
- Basic operations of FreeMarker
- Also on STM32 using dma+ serial port to obtain variable length data
- Ad14 component pin name disappeared
- The e-commerce employee changed the product price to 10% off after leaving the company, and has been detained
- [LeetCode]21. Merge two ordered linked lists twenty-nine
- 通过抓包下载钉钉直播回放
猜你喜欢
Another year 1024, happy programmer's Day!
63. different paths II
Several interview questions in TCP three grips and four swings
【SCA-CNN 解读】空间与通道注意力:Spatial and Channel-wise Attention
Kali system -- host, dig, dnsenum, imtry for DNS collection and analysis
Win10 home vs pro vs enterprise vs enterprise LTSC
In / out / inout details of MySQL stored procedures
ROS2之OpenCV人脸识别foxy~galactic~humble
Successfully installed opencv under delphixe
On the parameters of main function in C language
随机推荐
新增博客地址
[LeetCode]1. Sum of two numbers thirty-four
Summary of openstack installation problems
Set sail
TypeError: wave.ensureState is not a function
What are the levels of safety accidents
硬(磁)盘(一)
Using STM32 DMA to drive 4-wire SPI interface OLED high-speed display
[LeetCode]21. Merge two ordered linked lists twenty-nine
[LeetCode]14. Longest common prefix thirty-eight
MySQL query table field information
Pipelines in go concurrency mode
OceanBase 雄踞墨天轮2021年度中国数据库魔力象限领导者
Transaction verification of btcd transaction process (2)
Go implements concurrent non blocking caching
Information collection for network security (2)
Composite key relationships using Sqlalchemy - relationships on composite keys using Sqlalchemy
Kali system -- dnsmap for DNS collection and analysis
Cve-2021-24078 vulnerability analysis
Mysql批量插入数据时如何解决重复问题?