yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
AI Vision USB Camera📖
01.Basic course
  • 1.Camera parameters
  • 2.Camera detect
  • 3.Camera preview screen
02.Docker
  • 1.Docker overview and docker installation
  • 2.Common commands for docker image containers
  • 3.Docker images deeply understand and publish images
  • 4.Docker hardware interaction and data processing
  • 5.Enter the bot's docker container
  • 6.Robot development environment construction in Docker
  • 7.How customers can update docker images in the future
03.ROS vision course
  • 0.Camera preview screen
  • 1.QR code
  • 2.Human pose estimation
  • 3.Target Detection
  • 4.AR vision
  • 5.ROS+Opencv basics
  • 6.Face recognition
  • 7.harris corner detection
  • 8.Target tracking algorithm
  • 9.Contour moment
  • 10.Polygon outline
  • 11.Discrete fourier transform algorithm
  • 12.Edge detection algorithm
  • 13.Face detection algorithm
  • 14.Optical flow detection algorithm
  • 15.Contour detection
  • 16.General contour detection
  • 17.Feature point tracking
  • 18.HLS color filtering
  • 19.Hough circle detection
  • 20.Hough linear detection
  • 21.HSV color filtering
  • 22.LK optical flow algorithm
  • 23.Detection algorithm
  • 24.Phase dependent displacement detection
  • 25.Image pyramid sampling algorithm
  • 26.RGB color filtering
  • 27.Clear background detection algorithm
  • 28.Simplified optical flow algorithm
  • 29.Simple filter
  • 30.Threshold image processing
  • 31.Watershed segmentation algorithm
04.Mediapipe course
  • 1.Hand detection
  • 2.Attitude detection
  • 3.Overall inspection
  • 4.Face detection
  • 5.Face recognition
  • 6.Face effects
  • 7.3D object recognition
  • 8.Brush
  • 9.Finger control
  • 10.Gesture recognition
05.Robot Vision course
  • Tracking color line
06.Camera preview and frame rate test
  • Camera preview and frame rate test
Download
  • Docker Image
  • PC_Software
Download ZIP

Welcome to AI Vision USB Camera repository

6.Face recognition

Face recognition

1.Overview

wiki:http://wiki.ros.org/opencv_apps

Source code:https://github.com/ros-perception/opencv_apps.git

Most of the code was originally taken from:https://github.com/Itseez/opencv/tree/master/samples/cpp

Functional package:~/software/library_ws/src/opencv_apps

The topic subscribed by this function package is [/image]. What we have to do is to open the camera node, write a topic that converts the camera topic into a [/image] node, and publish the [/image] topic.

Turn on the camera and publish the path of the node of the [/image] topic:

~/yahboomcar_ws/src/yahboomcar_visual/scripts/pub_image.py

The opencv_apps program provides various nodes that internally run the functions of opencv and publish the results to a ROS topic. When using the opencv_apps program, you only need to run a launch file according to your own business needs, so that you no longer have to write program codes for these functions.

ROS Wiki has related node analysis, topic subscription and topic publishing of the corresponding node, introduction of related parameters, etc. See the ROS WiKi for details.

2. Use

Code path: ~/yahboomcar_ws/src/opencv_apps/launch

  • Start the camera
xxxxxxxxxx
roslaunch yahboomcar_visual opencv_apps.launch img_flip:=false

img_flip parameter: whether the image needs to be flipped horizontally, the default is false.

The [usb_cam-test.launch] file opens the [web_video_server] node by default, and you can directly use the [IP:8080] web page to view images in real time.

  • Start up Opencv.apps function
xxxxxxxxxx
roslaunch opencv_apps face_recognition.launch             # face recognition

The debug_view for some functions is turned off. If no screen appears, you can view the effect in the following two ways.

xxxxxxxxxx
The reason for closing debug_view is that it will generate errors on the terminal, but the actual effect has not been affected.
  • Local view screen

Enter the following command and select the corresponding topic to see the effect.

xxxxxxxxxx
rqt_image_view
  • LAN viewing screen

In the same local area network, enter IP+port (8080) in the browser, for example:

xxxxxxxxxx
192.168.2.150:8080 #IP refers to the host IP address

3. Face recognition display

This case is based on autonomous training and real-time recognition by collecting images of people in real time, and the steps are slightly complicated.

ParameterTypeDefaultAnalyze
~approximate_syncboolfalseSubscribe to the topic [camera_info] to get the default coordinate system ID, otherwise use the image information directly.
~queue_sizeint100Queue size for subscribing topics
~model_methodstring"eigen"Face recognition method: "eigen", "fisher" or "LBPH"
~use_saved_databooltrueLoad training data from ~data_dir path
~save_train_databooltrueSave training data to ~data_dir path for retraining
~data_dirstring"~/opencv_apps/face_data"Save training data path
~face_model_widthint190Width of training face images
~face_model_heightint90Training face image height
~face_paddingdouble0.1Filling ratio of each face
~model_num_componentsint0The number of components of the face recognizer model (0 is considered unlimited)
~model_thresholddouble8000.0Face recognition model threshold
~lbph_radiusint1Radius parameter (for LBPH method only)
~lbph_neighborsint8Neighborhood parameters (only for LBPH method)
~lbph_grid_xint8Grid x parameter (only for LBPH method)
~lbph_grid_yint8Grid y parameter (only for LBPH method)
~queue_sizeint100Image subscriber queue size

Operation steps:

  1. First, enter the character’s name after the colon in the picture below: Yahboom
  2. Confirm name: y
  3. Then place the face in the center of the image and click OK.
  4. Add a photo in a loop: y, click to confirm.
  5. To end image collection, enter: n and click Confirm.
  6. Close the launch file and restart.

If you need to enter the recognized identifications, cycle through steps 1 to 5 until all identified persons have been entered, and then proceed to step six.

image-20210903213928003

Step 3: Ensure that faces can be recognized

image-20210906103107655

Final recognition effect

image-20210906103143423

ROS+Opencv basics
harris corner detection

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文