Skip to content

Shape Target Training

General information about Shape Target tracking can be found here.

Preparation

Before training Shape targets, prepare an image of the target in one of the following formats:

  • .jpg/jpeg
  • .png
  • .bmp

Info

For Shape targets, the trainer application only supports input images with an aspect ratio of 4:3.

A good Shape target will have certain visual features that enable accurate pose estimation and stable tracking:

Properties Explanation
Distinctive pattern Texture with many distinctive visual features (e.g. corners, blobs)
Rich texture Texture with rich visual features all over the image without empty regions
No repetitive pattern Textures with no similar patterns repeating
Non-reflective The object itself should not be reflective

Shape target training

Shape targets can be trained using the plane, box or cylinder subcommands. All shape targets require the same parameters but differ in the dimensions required to specify the physical size and the number of vertices:

TRACK-Trainer-Native.exe plane --help
Usage: plane [--help] [--version] --name VAR [--output VAR] --path VAR --physicalSize VAR... --vertices VAR... --resolution VAR... --focalLength VAR... --principalPoint VAR... --distortions VAR...

Performs training of a(n) plane target.

Optional arguments:
  -h, --help            shows help message and exits
  -v, --version         prints version information and exits
  --name                Name of the trained target [required]
  --output              Path where to save the trained target [default: "./"]
  --path                Path to the image file [required]
  --physicalSize        Physical size of the Plane (in meter) [nargs: 2] [required]
  --vertices            Vertices of the Plane [nargs: 8] [required]
  --resolution          Resolution of the camera [nargs: 2] [required]
  --focalLength         Focal length of the camera [nargs: 2] [required]
  --principalPoint      Principal point of the camera [nargs: 2] [required]
  --distortions         Distortions of the camera [nargs: 5] [required]

TRACK-Trainer-Native.exe plane --name PlaneTarget --path .\Image.png --physicalSize 1.0 1.0 --output .\PlaneTarget --vertices 24 10 493 108 497 335 22 325 --resolution 640 480 --focalLength 600 600 --principalPoint 320 240 --distortions 0.0 0.0 0.0 0.0 0.0

Copyright (C) 2023 VIRNECT CO., LTD.
All rights reserved.

The following parameters can be set for shape target training:

  • name Name of the target following the naming convention mentioned here.
  • path Path to the image, e.g. ".\Image.png" if the image is in the same folder as the Trainer CLI
  • physicalSize Physical size of the shape, the number of dimensions and meaning of each dimension varies between shape types (detailed description at the corresponding sections)
  • output Optional output path, must be a directory, e.g. ".\Targets\"
  • vertices The vertices of the shape in the input image, the number of vertices varies between shape types (detailed description at the corresponding sections)
  • resolution Camera resolution, e.g. "640 480"
  • focalLength Camera focal length, e.g. "600 600"
  • principalPoint Camera principal point, e.g. "320 240"
  • distortions Camera distortion coefficients as described here

Plane shape target

The vertices of the Plane shape need to be declared in absolute pixel coordinates of the input image.
The order is as follows: P1.x, P1.y, P2.x, P2.y, P3.x, P3.y, P4.x, P4.y

For the physical size Plane shape requires two parameters: the width (e.g. distance between P1 and P2) and height (e.g. distance between P1 and P4), both specified in meters.


Box shape target

The vertices of the Box shape need to be declared in absolute pixel coordinates of the input image.
The order is as follows: P1.x, P1.y, P2.x, P2.y, P3.x, P3.y, P4.x, P4.y, P5.x, P5.y, P6.x, P6.y, P7.x, P7.y

For the physical size Box shape requires three parameters: the width (e.g. distance between P7 and P3), the height (e.g. distance between P7 and P1) and the depth (e.g. distance between P7 and P5), all specified in meters.

Info

Currently the Box shape target only supports the perspective given in the sample.


Cylinder shape target

The vertices of the Cylinder shape need to be declared in absolute pixel coordinates of the input image.
The order is as follows: P1.x, P1.y, P2.x, P2.y, P3.x, P3.y, P4.x, P4.y, P5.x, P5.y, P6.x, P6.y

For the physical size Cylinder shape requires two parameters: the radius (not the diameter!) and height of the cylinder specified in meters.

Cylinder model training supports all common types of perspectives: