当前位置:网站首页>Opencv face recognition of ros2 foxy~galactic~humble
Opencv face recognition of ros2 foxy~galactic~humble
2022-06-13 09:20: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 senseHow 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.
边栏推荐
- ROS2之OpenCV人脸识别foxy~galactic~humble
- 马斯克的「元宇宙」梦
- Batch read all voice files under the folder
- 20211028 adjustment and tracking
- Mttr/mttf/mtbf diagram
- JUC 原子累加器 源码之 LongAdder
- Spectre record
- Download address of QT source code of each version
- Solov2 source code analysis
- C language: deep understanding of pointers and arrays
猜你喜欢

Can the operation of the new BMW I3 meet the expectations of the famous products of the 3 series?

阿里高级专家剖析 | Protocol的标准设计

Some websites of QT (software download, help documents, etc.)

Solov2 source code analysis

C language: Simulated Implementation of library function strcpy

turtle库显示系统时间

Overview of common layers of image recognition neural network (under update)

Jenkins接入Openldap用户认证

Yolov5 face learning notes

Storage mode of drawings
随机推荐
Neo4j環境搭建
Necessary and sufficient conditions for diagonalization of 20211115 matrix; The full rank matrix does not necessarily have n linearly independent eigenvectors; Symmetric matrices must be diagonalized
an error occurred while trying to rename a file in the destination directory code 5
Two good kids
C language: shortcut keys commonly used in VS
C language: Simulated Implementation of library function strcpy
Routing - static routing
20211005 Hermite matrix and some properties
[implementation of depth first search]
LeetCode 5259. Calculate the total tax payable
SQL ROW_ The number() function uses
C language: data storage in memory
批量讀取文件夾下的全部語音文件
C language: recursive function to realize Hanoi Tower
Tutorial (5.0) 04 Fortint cloud services and scripts * fortiedr * Fortinet network security expert NSE 5
20211104 why are the traces of similar matrices the same
20220524 how to install coppeliasim to disk D
线上调试工具Arthas基础
JUC atomic integer
turtle库的使用数字时钟模拟时钟动态显示