HALCON Reference Manual 10.0.2
Table of Contents / Calibration / Calibration Object ClassesClassesClasses | | | Operators

gen_caltabgen_caltabgen_caltabGenCaltabGenCaltab (Operator)

Name

gen_caltabgen_caltabgen_caltabGenCaltabGenCaltab — Generate a calibration plate description file and a corresponding PostScript file.

Signature

gen_caltab( : : XNum, YNum, MarkDist, DiameterRatio, CalTabDescrFile, CalTabPSFile : )

Herror gen_caltab(const Hlong XNum, const Hlong YNum, double MarkDist, double DiameterRatio, const char* CalTabDescrFile, const char* CalTabPSFile)

Herror T_gen_caltab(const Htuple XNum, const Htuple YNum, const Htuple MarkDist, const Htuple DiameterRatio, const Htuple CalTabDescrFile, const Htuple CalTabPSFile)

Herror gen_caltab(const HTuple& XNum, const HTuple& YNum, const HTuple& MarkDist, const HTuple& DiameterRatio, const HTuple& CalTabDescrFile, const HTuple& CalTabPSFile)

void HOperatorSetX.GenCaltab(
[in] VARIANT XNum, [in] VARIANT YNum, [in] VARIANT MarkDist, [in] VARIANT DiameterRatio, [in] VARIANT CalTabDescrFile, [in] VARIANT CalTabPSFile)

void HMiscX.GenCaltab(
[in] Hlong XNum, [in] Hlong YNum, [in] double MarkDist, [in] double DiameterRatio, [in] BSTR CalTabDescrFile, [in] BSTR CalTabPSFile)

static void HOperatorSet.GenCaltab(HTuple XNum, HTuple YNum, HTuple markDist, HTuple diameterRatio, HTuple calTabDescrFile, HTuple calTabPSFile)

static void HMisc.GenCaltab(int XNum, int YNum, double markDist, double diameterRatio, string calTabDescrFile, string calTabPSFile)

Description

gen_caltabgen_caltabgen_caltabGenCaltabGenCaltab generates the description of a standard calibration plate for HALCON. This calibration plate consists of XNumXNumXNumXNumXNum times YNumYNumYNumYNumYNum black circular marks on a white plane which are surrounded by a black frame. The marks are arranged in a rectangular grid with YNumYNumYNumYNumYNum and XNumXNumXNumXNumXNum equidistant rows and columns. The distances between these rows and columns defines the parameter MarkDistMarkDistMarkDistMarkDistmarkDist in meter. The marks' diameter can be set by the parameter DiameterRatioDiameterRatioDiameterRatioDiameterRatiodiameterRatio and is defined by the equation Diameter = MarkDist * DiameterRatio . Using a distance between marks of 0.01 m and a diameter ratio of 0.5, the width of the dark surrounding frame becomes 8 cm, and the radius of the marks is set to 2.5 mm. The coordinate system of the calibration plate is located in the barycenter of all marks, its z-axis points into the calibration plate, its x-axis to the right, and its y-axis downwards.

The file CalTabDescrFileCalTabDescrFileCalTabDescrFileCalTabDescrFilecalTabDescrFile contains the calibration plate description, e.g., the number of rows and columns of the calibration plate, the geometry of the surrounding frame (see find_caltabfind_caltabfind_caltabFindCaltabFindCaltab), the triangular orientation mark, an offset of the coordinate system to the plate's surface in z-direction, and the x,y coordinates and the radius of all calibration plate marks given in the calibration plate coordinate system. The definition of the orientation and the offset, indicated by t and z, is optional and can be commented out. The default HALCON file extension for the calibration plate description is 'descr'. A file generated by gen_caltabgen_caltabgen_caltabGenCaltabGenCaltab looks like the following (comments are marked by a '#' at the beginning of a line):

  # Plate Description Version 2
  # HALCON Version 7.1 --  Fri Jun 24 16:41:00 2005
  # Description of the standard calibration plate
  # used for the camera calibration in HALCON
  # (generated by gen_caltab)
  #
  #
  # 7 rows x 7 columns
  # Width, height of the black frame [meter]: 0.1, 0.1
  # Distance between mark centers [meter]: 0.0125

  # Number of marks in y-dimension (rows)
  r 7

  # Number of marks in x-dimension (columns)
  c 7

  #   offset of coordinate system in z-dimension [meter] (optional):
  z 0

  # Rectangular border (rim and black frame) of calibration plate
  #   rim of the calibration plate (min x, max y, max x, min y) [meter]:
  o -0.05125 0.05125 0.05125 -0.05125
  #   outer border of the black frame (min x, max y, max x, min y) [meter]:
  i -0.05 0.05 0.05 -0.05
  #   triangular corner mark given by two corner points (x,y, x,y) [meter]
  #   (optional):
  t -0.05 -0.0375 -0.0375 -0.05

  #   width of the black frame [meter]:
  w 0.003125

  # calibration marks:  x y radius [meter]

  # calibration marks at y = -0.0375 m
  -0.0375 -0.0375 0.003125
  -0.025 -0.0375 0.003125
  -0.0125 -0.0375 0.003125
  -3.46945e-018 -0.0375 0.003125
  0.0125 -0.0375 0.003125
  0.025 -0.0375 0.003125
  0.0375 -0.0375 0.003125

  # calibration marks at y = -0.025 m
  -0.0375 -0.025 0.003125
  -0.025 -0.025 0.003125
  -0.0125 -0.025 0.003125
  -3.46945e-018 -0.025 0.003125
  0.0125 -0.025 0.003125
  0.025 -0.025 0.003125
  0.0375 -0.025 0.003125

  # calibration marks at y = -0.0125 m
  -0.0375 -0.0125 0.003125
  -0.025 -0.0125 0.003125
  -0.0125 -0.0125 0.003125
  -3.46945e-018 -0.0125 0.003125
  0.0125 -0.0125 0.003125
  0.025 -0.0125 0.003125
  0.0375 -0.0125 0.003125

  # calibration marks at y = -3.46945e-018 m
  -0.0375 -3.46945e-018 0.003125
  -0.025 -3.46945e-018 0.003125
  -0.0125 -3.46945e-018 0.003125
  -3.46945e-018 -3.46945e-018 0.003125
  0.0125 -3.46945e-018 0.003125
  0.025 -3.46945e-018 0.003125
  0.0375 -3.46945e-018 0.003125

  # calibration marks at y = 0.0125 m
  -0.0375 0.0125 0.003125
  -0.025 0.0125 0.003125
  -0.0125 0.0125 0.003125
  -3.46945e-018 0.0125 0.003125
  0.0125 0.0125 0.003125
  0.025 0.0125 0.003125
  0.0375 0.0125 0.003125

  # calibration marks at y = 0.025 m
  -0.0375 0.025 0.003125
  -0.025 0.025 0.003125
  -0.0125 0.025 0.003125
  -3.46945e-018 0.025 0.003125
  0.0125 0.025 0.003125
  0.025 0.025 0.003125
  0.0375 0.025 0.003125

  # calibration marks at y = 0.0375 m
  -0.0375 0.0375 0.003125
  -0.025 0.0375 0.003125
  -0.0125 0.0375 0.003125
  -3.46945e-018 0.0375 0.003125
  0.0125 0.0375 0.003125
  0.025 0.0375 0.003125
  0.0375 0.0375 0.003125

The file CalTabPSFileCalTabPSFileCalTabPSFileCalTabPSFilecalTabPSFile contains the corresponding PostScript description of the calibration plate.

Attention

Depending on the accuracy of the used output device (e.g., laser printer), the printed calibration plate may not match the values in the calibration plate descripton file CalTabDescrFileCalTabDescrFileCalTabDescrFileCalTabDescrFilecalTabDescrFile exactly. Thus, the coordinates of the calibration marks in the calibration plate description file may have to be corrected!

Parallelization

Parameters

XNumXNumXNumXNumXNum (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of marks in x direction.

Default value: 7

Suggested values: 5, 7, 9

Recommended increment: 1

Restriction: XNum > 1

YNumYNumYNumYNumYNum (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of marks in y direction.

Default value: 7

Suggested values: 5, 7, 9

Recommended increment: 1

Restriction: YNum > 1

MarkDistMarkDistMarkDistMarkDistmarkDist (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Distance of the marks in meters.

Default value: 0.0125

Suggested values: 0.1, 0.0125, 0.00375, 0.00125

Restriction: 0.0 < MarkDist

DiameterRatioDiameterRatioDiameterRatioDiameterRatiodiameterRatio (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Ratio of the mark diameter to the mark distance.

Default value: 0.5

Suggested values: 0.5, 0.55, 0.6, 0.65

Restriction: (0.0 < DiameterRatio) < 1.0

CalTabDescrFileCalTabDescrFileCalTabDescrFileCalTabDescrFilecalTabDescrFile (input_control)  filename.write HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

File name of the calibration plate description.

Default value: 'caltab.descr' "caltab.descr" "caltab.descr" "caltab.descr" "caltab.descr"

List of values: 'caltab.descr'"caltab.descr""caltab.descr""caltab.descr""caltab.descr", 'caltab_10mm.descr'"caltab_10mm.descr""caltab_10mm.descr""caltab_10mm.descr""caltab_10mm.descr", 'caltab_30mm.descr'"caltab_30mm.descr""caltab_30mm.descr""caltab_30mm.descr""caltab_30mm.descr", 'caltab_100mm.descr'"caltab_100mm.descr""caltab_100mm.descr""caltab_100mm.descr""caltab_100mm.descr", 'caltab_200mm.descr'"caltab_200mm.descr""caltab_200mm.descr""caltab_200mm.descr""caltab_200mm.descr"

File extension: .descr

CalTabPSFileCalTabPSFileCalTabPSFileCalTabPSFilecalTabPSFile (input_control)  filename.write HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

File name of the PostScript file.

Default value: 'caltab.ps' "caltab.ps" "caltab.ps" "caltab.ps" "caltab.ps"

File extension: .ps

Example (HDevelop)

*  Create calibration plate with width = 80 cm
gen_caltab( 7, 7, 0.1, 0.5, 'caltab.descr', 'caltab.ps')

Example (HDevelop)

*  Create calibration plate with width = 80 cm
gen_caltab( 7, 7, 0.1, 0.5, 'caltab.descr', 'caltab.ps')

Example (C++)

// Create calibration plate with width = 80 cm
gen_caltab( 7, 7, 0.1, 0.5, "caltab.descr", "caltab.ps");

Example (HDevelop)

*  Create calibration plate with width = 80 cm
gen_caltab( 7, 7, 0.1, 0.5, 'caltab.descr', 'caltab.ps')

Example (HDevelop)

*  Create calibration plate with width = 80 cm
gen_caltab( 7, 7, 0.1, 0.5, 'caltab.descr', 'caltab.ps')

Result

gen_caltabgen_caltabgen_caltabGenCaltabGenCaltab returns 2 (H_MSG_TRUE) if all parameter values are correct and both files have been written successfully. If necessary, an exception is raised.

Possible Successors

read_cam_parread_cam_parread_cam_parReadCamParReadCamPar, caltab_pointscaltab_pointscaltab_pointsCaltabPointsCaltabPoints

See also

find_caltabfind_caltabfind_caltabFindCaltabFindCaltab, find_marks_and_posefind_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPose, camera_calibrationcamera_calibrationcamera_calibrationCameraCalibrationCameraCalibration, disp_caltabdisp_caltabdisp_caltabDispCaltabDispCaltab, sim_caltabsim_caltabsim_caltabSimCaltabSimCaltab

Module

Foundation


Table of Contents / Calibration / Calibration Object ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH