IDS peak ICV v1.6.0
Loading...
Searching...
No Matches
Undistortion Class Reference

Public Member Functions

None __init__ (self, *Any args, **Any kwargs)
 In order to create an Image, please refer to the classmethods create_from_intrinsics and create_from_intrinsics_and_metadata.
 
Undistortion create_from_intrinsics (cls, IntrinsicParameters intrinsic_parameters)
 
Undistortion create_from_intrinsics_and_metadata (cls, IntrinsicParameters intrinsic_parameters, Metadata metadata)
 
None __del__ (self)
 Destroys the undistortion object and releases any associated resources.
 
UndistortedImage process (self, Union[Image, ids_peak_ipl.Image] image)
 Applies undistortion to the specified image.
 
Interpolation interpolation (self)
 
None interpolation (self, Interpolation interpolation)
 Sets the interpolation method used for undistortion.
 

Protected Attributes

 _handle
 
 _new_intrinsic_parameters = kwargs["_new_intrinsic_parameters"]
 

Detailed Description

Represents an undistortion transformation for images.

Provides geometric correction to remove lens distortion using intrinsic calibration parameters. The parameters can be obtained using CameraCalibration.process().

This class also supports undistorting images with binning factors that differ from those used during calibration, as long as the image metadata includes valid binning information. The binning factor of the image to be undistorted must be greater than or equal to that of the calibration images.

Note
If the metadata of the images to be undistorted differs from the metadata used during calibration (e.g. due to different binning), internal parameters may need to be reinitialized. In such cases, the first call to process() may take longer. To avoid this, create the object with create_from_intrinsics_and_metadata with matching metadata.

Limitations

  • In-place undistortion is not supported.
  • Maximum supported image size is 32767 × 32767 pixels.
Since
ids_peak_icv 1.1

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self,
*Any args,
**Any kwargs )

In order to create an Image, please refer to the classmethods create_from_intrinsics and create_from_intrinsics_and_metadata.

Since
ids_peak_icv 1.1

◆ __del__()

None __del__ ( self)

Destroys the undistortion object and releases any associated resources.

Since
ids_peak_icv 1.1

Member Function Documentation

◆ create_from_intrinsics()

Undistortion create_from_intrinsics ( cls,
IntrinsicParameters intrinsic_parameters )
Parameters
intrinsic_parametersIntrinsic parameters derived from a camera calibration.
Returns
Since
ids_peak_icv 1.1

◆ create_from_intrinsics_and_metadata()

Undistortion create_from_intrinsics_and_metadata ( cls,
IntrinsicParameters intrinsic_parameters,
Metadata metadata )
Parameters
intrinsic_parametersIntrinsic parameters derived from a camera calibration.
metadataMetadata of an image which contains information about the image capture settings.
Returns
Since
ids_peak_icv 1.1

◆ interpolation() [1/2]

Interpolation interpolation ( self)
Returns
The current interpolation method used by the undistortion.
Since
ids_peak_icv 1.1

◆ interpolation() [2/2]

None interpolation ( self,
Interpolation interpolation )

Sets the interpolation method used for undistortion.

Parameters
interpolationInterpolation method to use.
Since
ids_peak_icv 1.1

◆ process()

UndistortedImage process ( self,
Union[Image, ids_peak_ipl.Image] image )

Applies undistortion to the specified image.

This function undistorts the image and returns an UndistortedImage that includes updated intrinsic parameters.

The returned image has the same size and pixel format as the input image.

The image region is also undistorted.

Note
In the rare case that the Metadata ROI (MetadataKey.ROI) is set such that the principal point of the calibration parameters lies outside the ROI, invalid data may appear at the image border. The image region is therefore restricted to points within the valid area.
Parameters
imageThe image to be undistorted.
Supported pixel formats
  • Mono8
  • Mono10
  • Mono12
  • Mono16
  • RGB8
  • RGBa8
  • BGR8
  • BGRa8
  • Coord3D_C32f
  • Coord3D_ABC32f

See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.

Returns
An undistorted image with updated intrinsic parameters.
Exceptions
NotPossibleExceptionThe image binning factor is too small for the undistortion configuration.
MismatchExceptionThe image size or metadata does not match the undistortion configuration.
Since
ids_peak_icv 1.1

Field Documentation

◆ _handle

_handle
protected
Initial value:
= check_init_for_classes_with_classmethods_only(self.__class__.__name__,
peak_icv_undistortion_handle,
*args, **kwargs)

◆ _new_intrinsic_parameters

_new_intrinsic_parameters = kwargs["_new_intrinsic_parameters"]
protected