IDS peak ICV v1.1.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"]
 
 _intrinsic_parameters = 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, call set_capture_information() beforehand with matching metadata.

Limitations

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

Definition at line 47 of file undistortion.py.

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

Definition at line 82 of file undistortion.py.

◆ __del__()

None __del__ ( self)

Destroys the undistortion object and releases any associated resources.

Since
ids_peak_icv 1.1

Definition at line 144 of file undistortion.py.

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

Definition at line 99 of file undistortion.py.

◆ 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

Definition at line 120 of file undistortion.py.

◆ interpolation() [1/2]

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

Definition at line 200 of file undistortion.py.

◆ 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

Definition at line 216 of file undistortion.py.

◆ 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.

Note
If the input image specifies a region, that region is also undistorted. When no region is specified (i.e., the full image is used), the output will also represent the full image.
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 capture information does not match the undistortion configuration.
Since
ids_peak_icv 1.1

Definition at line 154 of file undistortion.py.

Field Documentation

◆ _handle

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

Definition at line 90 of file undistortion.py.

◆ _intrinsic_parameters

_intrinsic_parameters = intrinsic_parameters
protected

Definition at line 108 of file undistortion.py.

◆ _new_intrinsic_parameters

_new_intrinsic_parameters = kwargs["_new_intrinsic_parameters"]
protected

Definition at line 96 of file undistortion.py.