yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
AI View Depth camera📖
01.Linux basic course
  • 1.Introduction to Linux system
  • 2.Ubuntu file system
  • 3.Ubuntu common commands
  • 4.Ubuntu common editors
  • 5.Ubuntu software operation commands
  • 6.Virtual machine installation
  • 7.SSH remote control
  • 8.VNC remote control
  • 9.Transfer files remotely
  • 10.Driver library and communication
  • 11.Static IP and hotspot mode
  • 12.Bind device ID
  • 13.Capacity expansion and resource allocation
  • 14.Update system software sources
  • 15.Set root user password
  • 16.sudo free password
  • 17.Connect to WiFi network
  • 18.View system version
  • 19.Customized service management
  • 20.Back up system image
02.ROS1-camera usage course
  • 1. Camera usage instructions
  • 2. Environment Construction
  • 3. Camera recording video
03.ROS1-OpenCV course
  • 1.Opencv Source CV Introduction
  • 2.Image reading and display
  • 3.Picture writing
  • 4.Picture Quality
  • 5.Pixel Operation
  • 6.Picture scaling
  • 7.Picture cutting
  • 8.Picture translation
  • 9.Picture mirroring
  • 10.Affine transformation
  • 11.Picture rotation
  • 12.Perspective transformation
  • 13.Grayscale processing
  • 14.Image binarization
  • 15.Edge detection
  • 16.Line segment drawing
  • 17.Rectangle and circle drawing
  • 18.Text and picture drawing
4.ROS1-basic course
  • 1.ROS introduction
  • 2.ROS installation
  • 3.ROS common command tools
  • 4.ROS workspace
  • 5.ROS function package
  • 6.ROS node
  • 7.ROS topic publisher
  • 8.ROS topic subscribers
  • 9.ROS service client
  • 10.ROS service server
  • 11.ROS action client
  • 12.ROS action server
  • 13.ROS custom message reception
  • 14.ROS-launch file
  • 15.ROS-TF transformation
  • 16.ROS parameter service
  • 17.ROS-rviz use
  • 18.ROS-rqt tool usage
  • 19.Topic message recording and playback
  • 20.urdf model introduction
  • 21.gazebo introduction
  • 22.ROS distributed communication
5.ROS1-Mediapipe course
  • 1.Hand detection
  • 2.Posture detection
  • 3.Overall detection
  • 4.Face detection
  • 5.Face recognition
  • 6.Face effects
  • 7.3D object recognition
  • 8.Brush
  • 9.Finger control
  • 10.Gesture recognition
6.ROS+Opencv application
  • 1.Camera calibration
  • 2.QR code
  • 3.Human body pose estimation
  • 4.Target detection
  • 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 line detection
  • 21.HSV color filtering
  • 22.LK optical flow algorithm
  • 23.Human body detection algorithm
  • 24.Phase-related 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
  • 32.View point cloud data
  • 33.AR vision
  • 34.AR QR code tracking
  • 35.Color tracking
  • 36.Object tracking
07.ROS2-camera usage course
  • Instructions for using camera
08.ROS2-basic course
  • 1.Introduction to ROS2
  • 2.ROS2 install Humble
  • 3.ROS2 development environment
  • 4.ROS2 workspace
  • 5.ROS2 function package
  • 6.ROS2 node
  • 7.ROS2 topic communication
  • 8.ROS2 service communication
  • 9.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 rqt toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
09.ROS2-OpenCV course
  • 1. ROS+opencv application
  • 2. QR code creation and recognition
  • 3. AR vision
10.ROS2-Mediapipe course
  • 1.Hand detection
  • 2.Posture detection
  • 3.Overall detection
  • 4.Face detection
  • 5.Personal insurance identification
11.ROS2-Depth camera course
  • 1. Use of depth camera
  • 2. Camera internal parameter calibration
  • 3. Color tracking
  • 4. KCF object tracking
  • 5. ORB_SLAM2 basics
  • 6. ORB_SLAM2 PCL mapping
  • 7. ORB_SLAM2 Octomap mapping
12.Bracket installation video
  • Bracket installation video
Download
  • VM_ROS1
  • VM_ROS2
  • Code-ROS1
  • Code-ROS2
  • 3D_File
  • ROS_Basic_VM
Download ZIP

Welcome to AI View Depth camera repository

34.AR QR code tracking

  • 34. AR QR code tracking

    AR function package location: ~/ArTrack_ws/src/ar_track_alvar/ar_track_alvar

    34.1. Overview

    ARTag (AR tag, AR means "augmented reality") is a fiducial marking system, which can be understood as a reference for other objects. It looks similar to a QR code, but its encoding system is very different from that of a QR code. It is mostly used in camera calibration, robot positioning, augmented reality (AR) and other applications. One of its important functions is to identify the position relationship between the object and the camera. ARTag can be attached to an object or an ARTag tag can be attached to a plane to calibrate the camera. After the camera recognizes the ARTag, it can calculate the position and posture of the tag in the camera coordinates.

    ar_track_alvar has 4 main functions:

    • Generate AR tags of different sizes, resolutions and data/ID codes.

    • Identify and track poses of individual AR tags, optionally integrating kinect depth data (when kinect is available) for better pose estimation.

    • Automatically compute spatial relationships between tags in a bundle using camera images so that users don't have to manually measure and enter tag positions in an XML file to use bundle functionality.

    Alvar is newer and more advanced than ARToolkit, which has been the basis for several other ROS AR tag packages. Alvar features adaptive thresholding to handle various lighting conditions, optical flow-based tracking for more stable pose estimation, and an improved tag identification method that doesn't slow down significantly as the number of tags increases.

    34.2. Create ARTag

    • Continuously generate multiple tags on one image

    xxxxxxxxxx
    roscore
    rosrun ar_track_alvar createMarker

    image-20231017204924314

    You can enter [ID] and location information here, and enter [-1] to end. You can generate one or more, and design the layout yourself.

    image-20231017204952621

    • Generate a single number

    Command + parameter directly generates a digital image; for example,

    xxxxxxxxxx
    rosrun ar_track_alvar createMarker 11
    rosrun ar_track_alvar createMarker -s 5 33

    11: The QR code of the number 11. -s: Specify the image size. 5: 5x5 image. 33: The QR code of the number 33.

    The generated AR QR code is saved in the directory of the terminal running the command.

    34.3, ARTag recognition and tracking

    Note: When starting the camera, you need to load the camera calibration file, otherwise it cannot be recognized. The supporting virtual machine has calibrated the parameter file required when starting usb_cam. If there is no such parameter file, you need to calibrate it according to the following tutorial.

    34.3.1, Camera internal parameter calibration

    Install the camera calibration function package,

    xxxxxxxxxx
    sudo apt install ros-noetic-camera-calibration -y
    sudo apt install ros-noetic-usb-cam

    Use usb-cam to drive the camera,

    xxxxxxxxxx
    roslaunch usb_cam usb_cam-test.launch

    Start the calibration node program,

    xxxxxxxxxx
    rosrun camera_calibration cameracalibrator.py image:=/usb_cam/image_raw --size 9x6 --square 0.02

    size: the number of internal corner points of the calibration chessboard, for example, 9X6, the corner points have six rows and nine columns.

    square: the side length of the chessboard, in meters.

    image: set the image topic published by the camera.

    image-20231017210526744

    Place the prepared calibration chessboard (7*10|size:20mm) in front of the camera,

    image-20231017210356125

    X: The chessboard moves left and right in the camera's field of view

    Y: The chessboard moves up and down in the camera's field of view

    Size: The chessboard moves forward and backward in the camera's field of view

    Skew: The chessboard tilts and rotates in the camera's field of view

    After successful startup, put the chessboard in the center of the screen and change different postures. The system will recognize it autonomously. The best situation is that the lines under [X], [Y], [Size], and [Skew] change from red to yellow and then to green as data is collected, and fill them as much as possible.

    Click [CALIBRATE] to calculate the camera internal parameters. The more pictures there are, the longer it will take. Just wait. (Sixty or seventy pictures is enough. Too many will cause the camera to get stuck.)

    image-20231017211223006

    Click [SAVE] to save the calibration results. The calibration results are saved in the directory of the terminal where the calibration program is run. Use the following command to move it out.

    xxxxxxxxxx
    sudo mv /tmp/calibrationdata.tar.gz ~

    After decompression, there are the pictures just calibrated, an ost.txt file and an ost.yaml file. The yaml file is what we need, but it needs to be modified before it can be used.

    • Change ost.yaml to head_camera.yaml

    • Move the file to the ~/.ros/camera_info folder

    xxxxxxxxxx
    cd ~/.ros
    sudo mkdir camera_info
    sudo cp ~/calibrationdata/head_camera.yaml ~/.ros/camera_info

    34.3.2, Start ARTag recognition and tracking

    xxxxxxxxxx
    roslaunch astra_visual ar_track.launch

    image-20231017212135425

    In rviz, you need to set the corresponding camera topic name,

    • Image_Topic: Obbec's camera is [/camera/color/image_raw].

    • Marker: The display component of rviz, different blocks show the location of the AR QR code.

    • TF: Display component of rviz, used to display the coordinate system of the AR QR code.

    • Camera: Display component of rviz, displaying the camera screen.

    • World: World coordinate system.

    • Camera_link: Camera coordinate system.

    launch file parsing,

    ​x
    <launch>
    <arg name="open_rviz" default="true"/>
    <arg name="marker_size" default="5.0"/>
    <arg name="max_new_marker_error" default="0.08"/>
    <arg name="max_track_error" default="0.2"/>
    <!-- Dabai_dcw2 camera configuration parameters-->
    <arg name="cam_image_topic" default="/camera/color/image_raw"/>
    <arg name="cam_info_topic" default="/camera/color/camera_info"/>
    <arg name="output_frame" default="/camera_link"/>
    <!-- Camera launch node-->
    <include file="$(find orbbec_camera)/launch/orbbec_camera.launch"/>
    <node pkg="tf" type="static_transform_publisher" name="world_to_cam"
    args="0 0 0.5 0 0 0 world camera_link 10"/>
    <node name="ar_track_alvar" pkg="ar_track_alvar" type="individualMarkersNoKinect" respawn="false" output="screen">
    <param name="marker_size" type="double" value="$(arg marker_size)"/>
    <param name="max_new_marker_error" type="double" value="$(arg max_new_marker_error)"/>
    <param name="max_track_error" type="double" value="$(arg max_track_error)"/>
    <param name="output_frame" type="string" value="$(arg output_frame)"/>
    <remap from="camera_image" to="$(arg cam_image_topic)"/>
    <remap from="camera_info" to="$(arg cam_info_topic)"/>
    </node>
    <group if="$(arg open_rviz)">
    <node pkg="rviz" type="rviz" name="rviz" args="-d $(find astra_visual)/rviz/ar_track.rviz"/>
    </group>
    </launch>
    
    

    Node parameters:

    • marker_size (double) : The width of one side of the black square marker border in centimeters.

    • max_new_marker_error (double) : A threshold for determining when a new marker can be detected under uncertainty.

    • max_track_error (double) : A threshold for how much tracking error can be observed before a marker disappears.

    • camera_image (string) : Provides the subject name of the image used to detect AR tags. This can be either monochrome or color, but should be an unrectified image, as rectification is performed in this package.

    • camera_info (string) : Provides the camera calibration parameters in order to rectify the subject name of the image.

    • output_frame (string): The coordinate position of the published AR tag in the camera coordinate system.

    34.3.3, View the node graph

    xxxxxxxxxx
    rqt_graph

    image-20231017212356262

    34.3.4, View the TF tree

    xxxxxxxxxx
    rosrun rqt_tf_tree rqt_tf_tree

    image-20231017212447101

    34.3.5, View the output topic information

    xxxxxxxxxx
    rostopic echo /ar_pose_marker

    Shown as follows:

    image-20231017212613058

    • frame_id: camera coordinate system name

    • id: the recognized number is 8

    • pose: QR code pose

    • position: the position of the QR code coordinate system relative to the camera coordinate system

    • orientation: the orientation of the QR code coordinate system relative to the camera coordinate system

AR vision
Color tracking

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/中文