Calibration

List of Sections ↓

This chapter provides information regarding camera calibration.

General Objectives

To achieve maximum accuracy of measurement for your camera setup, you have to calibrate it accordingly. Therefore, a camera model is determined, which describes the projection of a 3D world point into a (sub-)pixel in the image.

HALCON provides a wide range of operators to approach diverse tasks related to calibration, such as

This chapter gives guidance regarding the basic concept of retrieving the internal and external parameters of your camera. The following paragraphs state how to successfully calibrate a camera. In particular, they describe

Calibration Object

For a successful calibration of your camera setup, at least one calibration object with accurately known metric properties is needed, e.g., a HALCON calibration plate. For the calibration, take a series of images of the calibration object in different positions and orientations. The success of the calibration highly depends on the quality of the calibration object and the images. So you might want to exercise special diligence during the acquisition of the calibration images. See the section “How to take a set of suitable images?” for further information.

A calibration plate is covered by multiple calibration marks, which are extracted in the calibration images in order to retrieve their coordinates. The orientation of the plate has to be known distinctively, hence, a finder pattern is also part of the imprint.

Your distributor can provide you with two different types of standard HALCON calibration plates:

Calibration plate with hexagonally arranged marks:

As finder pattern, there are special groups of mark hexagons where some of the marks contain dot-shaped holes (see create_caltabcreate_caltabCreateCaltabCreateCaltabCreateCaltabcreate_caltab). One finder pattern has to be visible to locate the calibration plate. To make sure the plate is not inverted, at least a second one needs to be seen, but the plate does not have to be fully visible in the image. The origin of the coordinate system is located at the center of the central mark of the first finder pattern. The z-axis of the coordinate system is pointing into the calibration plate, its x-axis is pointing to the right, and its y-axis is pointing downwards with the direction of view along the z-axis.

When using camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration instead of calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCamerascalibrate_cameras, this calibration plate is not applicable.
HALCON calibration plate with hexagonally arranged marks.
Calibration plate with rectangularly arranged marks:
The finder pattern consists of the surrounding frame and the triangular corner marker (see gen_caltabgen_caltabGenCaltabGenCaltabGenCaltabgen_caltab). Thus, the plate has to be fully visible in the image. The origin is located in the middle of the surface of the calibration plate. The z-axis of the coordinate system is pointing into the calibration plate, its x-axis is pointing to the right, and its y-axis is pointing downwards with the direction of view along the z-axis.
HALCON calibration plate with rectangularly arranged marks.

When acquiring your calibration images, note that there are different recommendations on how to take them, depending on your used calibration plate (see section “How to take a set of suitable images?”).

Preparing the Calibration Input Data

Before calling a calibration operator (e.g., calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCamerascalibrate_cameras), you must create and adapt the calibration data model with the following steps:

  1. Create a calibration data model with the operator create_calib_datacreate_calib_dataCreateCalibDataCreateCalibDataCreateCalibDatacreate_calib_data, specifying the number of cameras in the setup and the number of used calibration objects.

  2. Specify the camera type and the initial internal camera parameters with the operator set_calib_data_cam_paramset_calib_data_cam_paramSetCalibDataCamParamSetCalibDataCamParamSetCalibDataCamParamset_calib_data_cam_param.

  3. Specify the description of all calibration objects with the operator set_calib_data_calib_objectset_calib_data_calib_objectSetCalibDataCalibObjectSetCalibDataCalibObjectSetCalibDataCalibObjectset_calib_data_calib_object.

  4. Collect observation data with the operators find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object or set_calib_data_observ_pointsset_calib_data_observ_pointsSetCalibDataObservPointsSetCalibDataObservPointsSetCalibDataObservPointsset_calib_data_observ_points, i.e., obtain the image coordinates of the extracted calibration marks of the calibration object and a roughly estimated pose of the calibration object relative to the observing camera.

  5. Configure the calibration process, e.g., exclude certain camera parameters from the optimization. You can specify these parameters with the operator set_calib_dataset_calib_dataSetCalibDataSetCalibDataSetCalibDataset_calib_data. For example, if the image sensor cell size of camera 0 is known precisely and only the rest of the parameters needs to be calibrated, you call
    set_calib_data(CalibDataID, 'camera', 0, 'excluded_settings', ['sx','sy'])set_calib_data(CalibDataID, "camera", 0, "excluded_settings", ["sx","sy"])SetCalibData(CalibDataID, "camera", 0, "excluded_settings", ["sx","sy"])SetCalibData(CalibDataID, "camera", 0, "excluded_settings", ["sx","sy"])SetCalibData(CalibDataID, "camera", 0, "excluded_settings", ["sx","sy"])set_calib_data(CalibDataID, "camera", 0, "excluded_settings", ["sx","sy"]).

Performing the Actual Camera Calibration and Obtaining its Results

Using all the information stored within the calibration data model, the actual calibration can be performed calling calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCamerascalibrate_cameras. Thereby, the input model is modified by optimizing the initial internal camera parameters, computing and adding further data like the external camera parameters or standard deviations. Furthermore, the standard deviations and covariances of the calibrated internal parameters and the root mean square error of the back projection are calculated in order to check the success of the calibration.

The results can then be queried with the operator get_calib_dataget_calib_dataGetCalibDataGetCalibDataGetCalibDataget_calib_data.

Checking the Success of the Calibration

After a successful calibration, the root mean square error (RMSE) of the back projection of the optimization is returned in ErrorErrorErrorErrorerrorerror (in pixels). The error gives a general indication whether the optimization was successful as it corresponds to the average distance (in pixels) between the back projected calibration points and their extracted image coordinates.

If only a single camera is calibrated, an ErrorErrorErrorErrorerrorerror in the order of 0.1 pixel (the typical detection error by extraction of the coordinates of the projected calibration markers) is an indication that the optimization fits the observation data well. If ErrorErrorErrorErrorerrorerror strongly differs from 0.1 pixels, the calibration did not perform well. Reasons for this might be, e.g., a poor image quality, an insufficient number of calibration images, or an inaccurate calibration plate.

For information about how to check the success of the calibration using a multi-view camera setup, see the respective section in the chapter Calibration / Multi-View.

Camera Parameters

Regarding camera parameters, you can distinguish between internal and external camera parameters.

Internal camera parameters:

These parameters describe the characteristics of the used camera, especially the dimension of the sensor itself and the projection properties of the used combination of lens, camera, and frame grabber. Below is an overview of all available camera types and their respective parameters CameraParam. In the list, “projective cameras” refers to the property that the lens performs a perspective projection on the object-side of the lens, while “telecentric cameras” refers to the property that the lens performs a telecentric projection on the object-side of the lens.

Area scan cameras

have 9 to 16 internal parameters depending on the camera type.

For reasons explained below, parameters that are marked with an * asterisk are fixed and not estimated by the algorithm.

Area scan cameras with regular lenses

Projective area scan cameras with regular lenses

  • 'area_scan_division'"area_scan_division""area_scan_division""area_scan_division""area_scan_division""area_scan_division": ['area_scan_division', Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  • 'area_scan_polynomial'"area_scan_polynomial""area_scan_polynomial""area_scan_polynomial""area_scan_polynomial""area_scan_polynomial": ['area_scan_polynomial', Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

Telecentric area scan cameras with regular lenses

  • 'area_scan_telecentric_division'"area_scan_telecentric_division""area_scan_telecentric_division""area_scan_telecentric_division""area_scan_telecentric_division""area_scan_telecentric_division": ['area_scan_telecentric_division', Magnification, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_division", Magnification, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_division", Magnification, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_division", Magnification, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_division", Magnification, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_division", Magnification, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  • 'area_scan_telecentric_polynomial'"area_scan_telecentric_polynomial""area_scan_telecentric_polynomial""area_scan_telecentric_polynomial""area_scan_telecentric_polynomial""area_scan_telecentric_polynomial": ['area_scan_telecentric_polynomial', Magnification, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

Area scan cameras with tilt lenses

Projective area scan cameras with tilt lenses

  • 'area_scan_tilt_division'"area_scan_tilt_division""area_scan_tilt_division""area_scan_tilt_division""area_scan_tilt_division""area_scan_tilt_division": ['area_scan_tilt_division', Focus, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_division", Focus, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_division", Focus, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_division", Focus, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_division", Focus, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_division", Focus, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  • 'area_scan_tilt_polynomial'"area_scan_tilt_polynomial""area_scan_tilt_polynomial""area_scan_tilt_polynomial""area_scan_tilt_polynomial""area_scan_tilt_polynomial": ['area_scan_tilt_polynomial', Focus, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_polynomial", Focus, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_polynomial", Focus, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_polynomial", Focus, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_polynomial", Focus, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_polynomial", Focus, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  • 'area_scan_tilt_image_side_telecentric_division'"area_scan_tilt_image_side_telecentric_division""area_scan_tilt_image_side_telecentric_division""area_scan_tilt_image_side_telecentric_division""area_scan_tilt_image_side_telecentric_division""area_scan_tilt_image_side_telecentric_division": ['area_scan_tilt_image_side_telecentric_division', Focus, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_division", Focus, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_division", Focus, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_division", Focus, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_division", Focus, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_division", Focus, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  • 'area_scan_tilt_image_side_telecentric_polynomial'"area_scan_tilt_image_side_telecentric_polynomial""area_scan_tilt_image_side_telecentric_polynomial""area_scan_tilt_image_side_telecentric_polynomial""area_scan_tilt_image_side_telecentric_polynomial""area_scan_tilt_image_side_telecentric_polynomial": ['area_scan_tilt_image_side_telecentric_polynomial', Focus, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_polynomial", Focus, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_polynomial", Focus, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_polynomial", Focus, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_polynomial", Focus, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_image_side_telecentric_polynomial", Focus, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]

Telecentric area scan cameras with tilt lenses

  • 'area_scan_tilt_bilateral_telecentric_division'"area_scan_tilt_bilateral_telecentric_division""area_scan_tilt_bilateral_telecentric_division""area_scan_tilt_bilateral_telecentric_division""area_scan_tilt_bilateral_telecentric_division""area_scan_tilt_bilateral_telecentric_division": ['area_scan_tilt_bilateral_telecentric_division', Magnification, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_division", Magnification, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_division", Magnification, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_division", Magnification, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_division", Magnification, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_division", Magnification, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  • 'area_scan_tilt_bilateral_telecentric_polynomial'"area_scan_tilt_bilateral_telecentric_polynomial""area_scan_tilt_bilateral_telecentric_polynomial""area_scan_tilt_bilateral_telecentric_polynomial""area_scan_tilt_bilateral_telecentric_polynomial""area_scan_tilt_bilateral_telecentric_polynomial": ['area_scan_tilt_bilateral_telecentric_polynomial', Magnification, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_bilateral_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  • 'area_scan_tilt_object_side_telecentric_division'"area_scan_tilt_object_side_telecentric_division""area_scan_tilt_object_side_telecentric_division""area_scan_tilt_object_side_telecentric_division""area_scan_tilt_object_side_telecentric_division""area_scan_tilt_object_side_telecentric_division": ['area_scan_tilt_object_side_telecentric_division', Magnification, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_division", Magnification, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_division", Magnification, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_division", Magnification, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_division", Magnification, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_division", Magnification, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  • 'area_scan_tilt_object_side_telecentric_polynomial'"area_scan_tilt_object_side_telecentric_polynomial""area_scan_tilt_object_side_telecentric_polynomial""area_scan_tilt_object_side_telecentric_polynomial""area_scan_tilt_object_side_telecentric_polynomial""area_scan_tilt_object_side_telecentric_polynomial": ['area_scan_tilt_object_side_telecentric_polynomial', Magnification, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_tilt_object_side_telecentric_polynomial", Magnification, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

Area scan cameras with hypercentric lenses

Projective area scan cameras with hypercentric lenses

  • 'area_scan_hypercentric_division'"area_scan_hypercentric_division""area_scan_hypercentric_division""area_scan_hypercentric_division""area_scan_hypercentric_division""area_scan_hypercentric_division": ['area_scan_hypercentric_division', Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_division", Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  • 'area_scan_hypercentric_polynomial'"area_scan_hypercentric_polynomial""area_scan_hypercentric_polynomial""area_scan_hypercentric_polynomial""area_scan_hypercentric_polynomial""area_scan_hypercentric_polynomial": ['area_scan_hypercentric_polynomial', Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]["area_scan_hypercentric_polynomial", Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

Description of the internal camera parameters of area scan cameras:

CameraType:

Type of the camera, as listed above.

Focus:

Focal length of the lens (only for lenses that perform a perspective projection on the object side of the lens).

The initial value is the nominal focal length of the used lens, e.g., 0.008m.

Magnification:

Magnification of the lens (only for lenses that perform a telecentric projection on the object side of the lens).

The initial value is the nominal magnification of the used telecentric lens (the image size divided by the object size), e.g., 0.2.

Kappa :

Distortion coefficient to model the radial lens distortions (only for the division model).

Use 0.0 as initial value.

K1, K2, K3, P1, P2:

Distortion coefficients to model the radial and decentering lens distortions (only for the polynomial model).

Use 0.0 as initial value for all five coefficients.

ImagePlaneDist:

Distance of the exit pupil of the lens to the image plane. The exit pupil is the (virtual) image of the aperture stop (typically the diaphragm), as viewed from the image side of the lens. Typical values are in the order of a few centimeters to very large values if the lens is close to being image-side telecentric.

Tilt, Rot:

The tilt angle describes the angle by which the optical axis is tilted with respect to the normal of the sensor plane (corresponds to a rotation around the x-axis). The rotation angle describes the rotation around the optical axis (z-axis). For a rotation the optical axis gets tilted vertically down with respect to the camera housing, corresponds to the optical axis being tilted horizontally to the left (direction of view along the z-axis), corresponds to the optical axis being tilted vertically up, and corresponds to the optical axis being tilted horizontally to the right.

These parameters are only used if a tilt lens is part of the camera setup.
image/svg+xml y x z y x z 2. tilt 1. rot ImagePlaneDist
The tilt of the lens is described by the parameters , and ImagePlaneDist. describes the orientation of the tilt axis in relation to the x-axis of the sensor and has to be applied first. describes the actual tilt of the lens. ImagePlaneDist is the distance of the exit pupil of the lens to the image plane.

These angles are typically roughly known based on the considerations that led to the use of the tilt lens or can be read off from the mechanism by which the lens is tilted.

Sx, Sy:

Scale factors. They correspond to the horizontal and vertical distance between two neighboring cells on the sensor. Since in most cases the image signal is sampled line-synchronously, is determined by the dimension of the sensor and does not need to be estimated by the calibration process.

The initial values depend on the dimensions of the used chip of the camera. See the technical specification of your camera for the actual values. Attention: These values increase if the image is subsampled!

As projective cameras are described through the pinhole camera model, it is impossible to determine FocusFocusFocusFocusfocusfocus, , and simultaneously. Therefore, the algorithm will keep fixed.

For telecentric lenses, it is impossible to determine Magnification, , and simultaneously. Therefore, the algorithm will keep fixed.

For image-side telecentric tilt lenses (see chapter “Basics”, section “Camera Model and Parameters” in the “Solution Guide III-C 3D Vision” for an overview of different types of tilt lenses), it is impossible to determine FocusFocusFocusFocusfocusfocus, , , and the tilt parameters and simultaneously. Therefore, additionally to , the algorithm will keep fixed.

For bilateral telecentric tilt lenses, it is impossible to determine Magnification, , , and the tilt parameters and simultaneously. Therefore, additionally to , the algorithm will keep fixed.

Cx, Cy:

Column ( ) and row ( ) coordinate of the principal point of the image (center of the radial distortion).

Use the half image width and height as initial values. Attention: These values decrease if the image is subsampled!

ImageWidth, Image Height:

Width and height of the sampled image. Attention: These values decrease if the image is subsampled!

Line scan cameras

have 12 or 16 internal parameters depending on the camera type.

For reasons explained below, parameters that are marked with an * asterisk are fixed and not estimated by the algorithm.

Line scan cameras with regular lenses

Projective line scan cameras with regular lenses

  • 'line_scan_division'"line_scan_division""line_scan_division""line_scan_division""line_scan_division""line_scan_division": ['line_scan_division', Focus, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_division", Focus, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_division", Focus, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_division", Focus, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_division", Focus, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_division", Focus, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]

  • 'line_scan_polynomial'"line_scan_polynomial""line_scan_polynomial""line_scan_polynomial""line_scan_polynomial""line_scan_polynomial": ['line_scan_polynomial', Focus, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]["line_scan_polynomial", Focus, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]

Telecentric line scan cameras with regular lenses

  • 'line_scan_telecentric_division'"line_scan_telecentric_division""line_scan_telecentric_division""line_scan_telecentric_division""line_scan_telecentric_division""line_scan_telecentric_division": ['line_scan_telecentric_division', Magnification, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_division", Magnification, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_division", Magnification, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_division", Magnification, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_division", Magnification, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_division", Magnification, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]

  • 'line_scan_telecentric_polynomial'"line_scan_telecentric_polynomial""line_scan_telecentric_polynomial""line_scan_telecentric_polynomial""line_scan_telecentric_polynomial""line_scan_telecentric_polynomial": ['line_scan_telecentric_polynomail', Magnification, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_polynomail", Magnification, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_polynomail", Magnification, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_polynomail", Magnification, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_polynomail", Magnification, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]["line_scan_telecentric_polynomail", Magnification, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]

Description of the internal camera parameters of line scan cameras:

CameraType:

Type of the camera, as listed above.

Focus:

Focal length of the lens (only for lenses that perform a perspective projection on the object side of the lens).

The initial value is the nominal focal length of the used lens, e.g., 0.008m.

Magnification:

Magnification of the lens (only for lenses that perform a telecentric projection on the object side of the lens).

The initial value is the nominal magnification of the used telecentric lens (the image size divided by the object size), e.g., 0.2.

Kappa :

Distortion coefficient of the division model to model the radial lens distortions.

Use 0.0 as initial value.

K1, K2, K3, P1, P2:

Distortion coefficients to model the radial and decentering lens distortions (only for the polynomial model).

Use 0.0 as initial value for all five coefficients.

Sx:

Scale factor. Corresponds to the horizontal distance between two neighboring cells on the sensor. Note that Focus or Magnification, respectively, and cannot be determined simultaneously. Therefore, is kept fixed in the calibration. The initial value for can be taken from the technical specifications of the camera. Attention: This value increases if the image is subsampled!

Sy:

Scale factor. During the calibration, it appears only in the form . Consequently, and cannot be determined simultaneously. Therefore, in the calibration, is kept fixed. describes the distance of the image center point from the sensor line in meters. The initial value for can be taken from the technical specifications of the camera. Attention: This value increases if the image is subsampled!

Cx:

Column coordinate of the image center point (center of the radial distortions). Use half of the image width as the initial value for . Attention: This value decreases if the image is subsampled!

Cy:

Distance of the image center point (center of the radial distortions) from the sensor line in scanlines. The initial value can normally be set to 0.

ImageWidth, ImageHeight:

Width and height of the sampled image. Attention: These values decrease if the image is subsampled!

Vx, Vy, Vz:

X-, Y-, and Z-component of the motion vector.

The initial values for the x-, y-, and z-component of the motion vector depend on the image acquisition setup. Assuming a camera that looks perpendicularly onto a conveyor belt and that is rotated around its optical axis such that the sensor line is perpendicular to the conveyor belt, i.e., the y-axis of the camera coordinate system is parallel to the conveyor belt, use the initial values . The initial value for can then be determined, e.g., from a line scan image of an object with known size (e.g., calibration plate, ruler):

With

If, compared to the above setup, the camera is rotated 30 degrees around its optical axis, i.e., around the z-axis of the camera coordinate system, the above determined initial values must be changed as follows:

If, compared to the first setup, the camera is rotated -20 degrees around the x-axis of the camera coordinate system, the following initial values result:

The quality of the initial values for , , and are crucial for the success of the whole calibration. If they are not precise enough, the calibration may fail.

Note that for telecentric line scan cameras, the value of has no influence on the image position of 3D points and therefore cannot be determined. Consequently, is not optimized and left at its initial value for telecentric line scan cameras. Therefore, the initial value of should be set to 0. For setups with multiple telecentric line scan cameras that share a common motion vector (for a detailed explanation, see Calibration / Multi-View), however, can be determined based on the camera poses. Therefore, in this case is optimized.

Restrictions for internal camera parameters

Note that the term focal length is not quite correct and would be appropriate only for an infinite object distance. To simplify matters, always the term focal length is used even if the image distance is meant.

For all operators that use camera parameters as input the respective parameter values are checked as to whether they fulfill the following restrictions:

For some operators the restrictions differ slightly. In particular, for operators that do not support line scan cameras the following restriction applies:

External camera parameters:

The following 6 parameters describe the 3D pose, i.e., the position and orientation of the world coordinate system relative to the camera coordinate system. The x- and y-axis of the camera coordinate system are parallel to the column and row axes of the image, while the z-axis is perpendicular to the image plane. For line scan cameras, the pose of the world coordinate system refers to the camera coordinate system of the first image line.

TransX:

Translation along the x-axis of the camera coordinate system.

TransY:

Translation along the y-axis of the camera coordinate system.

TransZ:

Translation along the z-axis of the camera coordinate system.

RotX:

Rotation around the x-axis of the camera coordinate system.

RotY:

Rotation around the y-axis of the camera coordinate system.

RotZ:

Rotation around the z-axis of the camera coordinate system.

The pose tuple contains one more element, which is the representation type of the pose. It codes the combination of the parameters OrderOfTransformOrderOfTransformOrderOfTransformOrderOfTransformorderOfTransformorder_of_transform, OrderOfRotationOrderOfRotationOrderOfRotationOrderOfRotationorderOfRotationorder_of_rotation, and ViewOfTransformViewOfTransformViewOfTransformViewOfTransformviewOfTransformview_of_transform. See create_posecreate_poseCreatePoseCreatePoseCreatePosecreate_pose for more information about 3D poses.

When using a standard HALCON calibration plate, the world coordinate system is defined by the coordinate system of the calibration plate. See the section “Calibration Object” above for further information.

If a HALCON calibration plate is used, you can use the operator find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object to determine initial values for all parameters. Using HALCON calibration plates with rectangularly arranged marks, a combination of the two operators find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab and find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose will have the same effect.

Parameter units:

HALCON calibration plates use meters as unit. The camera parameters use corresponding units. Of course, calibration can be done using different units, but in this case the related parameters have to be adapted. Here, we list the HALCON default units for the different camera parameters:

Parameter Unit
External RotX, RotY, RotZ , ,
TransX, TransY, TransZ , ,
Internal Cx, Cy ,
Focus
ImagePlaneDist
ImageWidth, ImageHeight ,
K1, K2, K3 , ,
Kappa