unreal.OpenCVLensCalibrator

class unreal.OpenCVLensCalibrator(outer=None, name='None')

Bases: unreal.Object

Open CVLens Calibrator

C++ Source:

  • Plugin: OpenCVLensDistortion
  • Module: OpenCVLensCalibration
  • File: OpenCVLensCalibrator.h

Editor Properties: (see get_editor_property/set_editor_property)

  • maximum_corner_coordinates (Vector2D): [Read-Only] Biggest coordinates of a grid corner that was found. For best result, try to cover full resolution of the input.
  • minimum_corner_coordinates (Vector2D): [Read-Only] Smallest coordinates of a grid corner that was found. For best result, try to cover full resolution of the input.
calculate_lens_parameters() → (lens_distortion_parameters=OpenCVLensDistortionParameters, margin_of_error=float, camera_view_info=OpenCVCameraViewInfo) or None
Returns:true if there was enough data to calculate the distortion

lens_distortion_parameters (OpenCVLensDistortionParameters): the calculated distortion data from the images passed into the calibrator.

margin_of_error (float): returned reprojection error of the calibration

camera_view_info (OpenCVCameraViewInfo): returned information about the camera view obtained from calibration parameters

Return type:tuple or None
classmethod create_calibrator(board_width=7, board_height=5, square_size=3.000000, use_fisheye_model=False) → OpenCVLensCalibrator
Parameters:
  • board_width (int32) – The width of the checkerboard used to calibrate the camera counted as number of inner edges.
  • board_height (int32) – The height of the checkerboard used to calibrate the camera counted as number of inner edges.
  • square_size (float) – The width of each square in (potentially arbitrary) world units.
  • use_fisheye_model (bool) – Specifies if the calibrator is to use the fisheye camera model from OpenCV
Returns:

Return type:

OpenCVLensCalibrator

feed_image(file_path) → bool

Feeds an image to the calibration. It must contain a checkerboard somewhere in the image. The images fed in should come from the same camera.

Parameters:file_path (str) –
Returns:true if the calibrator found a checkerboard in the image.
Return type:bool
feed_render_target(texture_render_target) → bool

Feeds a render target to the calibration. It must contain a checkerboard somewhere in the image. The images fed in should come from the same camera.

Parameters:texture_render_target (TextureRenderTarget2D) –
Returns:true if the calibrator found a checkerboard in the image.
Return type:bool
maximum_corner_coordinates

(Vector2D) – [Read-Only] Biggest coordinates of a grid corner that was found. For best result, try to cover full resolution of the input.

minimum_corner_coordinates

(Vector2D) – [Read-Only] Smallest coordinates of a grid corner that was found. For best result, try to cover full resolution of the input.