1、Opencv application

1.1、Overview

OpenCV is a cross-platform computer vision and machine learning software library based on a BSD license (open source) that can run on Linux, Windows, Android and MacOS operating systems. It provides interfaces to languages such as Python, Ruby, and MATLAB, and supports many general algorithms in image processing and computer vision.

1.2、QR code

1.2.1、Introduction of QR code

QR code not only has large information capacity, high reliability, and low cost, but it can also express a variety of text information such as Chinese characters and images. It has strong confidentiality and anti-counterfeiting and is very convenient to use.

1.2.2、QR code structure

PictureAnalyze
imgPositioning markings: Indicate the direction of the QR code.
imgAlignment markings: If the QR code is large, these additional elements help positioning.
imgTiming pattern: Through these lines, the scanner the matrix can be can recognized.
imgVersion information: This refers to the version number of the QR code being used. There are currently 40 different versions of the QR code. The version number used in the sales industry is usually 1-7.
imgFormat information: It contains information about fault tolerance and data masking modes, and makes scanning code easier.
imgData and error correction keys: These modes save actual data.
imgQuiet zone: Its role is to separate itself from other surrounding content.

1.2.3、QR code feature

The data value in the QR code contains repeated information (redundant value). Therefore, even if up to 30% of the two-dimensional code structure is destroyed, the readability of the two-dimensional code will not be affected. The QR code has a storage space of up to 7089 digits or 4296 characters, including punctuation marks and special characters, which can be written into the QR code.

1.2.4、Create and recognize QR code

Cod path:~/transbot_ws/src/transbot_visual/simple_qrcode

Input following command to install QR code tool

Create qrcode object

QR code to add logo

Input python3 +.py execute file, then input the content to be generated, and press 【Enter】.

image-20210901153136251

Input python3 +.py execute file, then input the content to be generated, and press 【Enter】.

image-20210901152557779

1.3、Human body pose estimation

Cod path:~/transbot_ws/src/transbot_visual/detection

1.3.1、Overview

Human Posture Estimation is to estimate the posture of the human body by correctly linking the key points of the human body that have been detected in the picture. The key points of the human body usually correspond to the joints with a certain degree of freedom on the human body, such as the neck, shoulders, elbows, wrists, waist, knees, ankles, etc., as shown in the figure below.

 

 

基于图卷积的行人意图识别方法与流程

1.3.2、Principle

image-20210901161528551

Input an image, extract the features through the convolutional network to obtain a set of feature maps, and then use the CNN network to extract Part Confidence Maps and Part Affinity Fields respectively;

1.3.3、Start up

After clicking the image frame, use the keyboard【f】key to switch target detection.

Input picture

person

Output picture

result

1.4、Target Detection

The main problem to be solved in this section is how to use the dnn module in OpenCV to import a trained target detection network.

We use OpenCV3.2.0 on our Transbot system.

At present, there are three main methods for using deep learning to detect objects:

1.4.1、Model structure

The main work of MobileNet is to replace the past standard convolutions with depthwise sparable convolutions to improve the computational efficiency and parameter amount of convolutional networks. The basic structure of depthwise separable convolution is shown in the figure below:

网络解析(二):MobileNets详解

The MobileNets network is composed of many depthwise separable convolutions shown in the figure above. The specific network structure is shown in the figure below:

网络解析(二):MobileNets详解

1.4.2、About code

List of recognizable objects

Load category [object_detection_coco.txt], import model [frozen_inference_graph.pb], specify deep learning framework [TensorFlow]

Import the picture, extract the height and width, calculate the 300x300 pixel blob, and pass this blob to the neural network

1.4.3、Start up

After clicking the image frame, use the keyboard【f】key to switch the human pose estimation.

image-20210901172132630