unreal.OpenCVLensDistortionLibrary

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

Bases: unreal.BlueprintFunctionLibrary

Open CVLens Distortion Blueprint Library

C++ Source:

  • Plugin: OpenCVLensDistortion
  • Module: OpenCVLensDistortion
  • File: OpenCVLensDistortionBlueprintLibrary.h
classmethod create_undistort_uv_displacement_map(lens_parameters, image_size, cropping_factor) -> (Texture2D, camera_view_info=OpenCVCameraViewInfo)

Creates a texture containing a DisplacementMap in the Red and the Green channel for undistorting a camera image. This call can take quite some time to process depending on the resolution.

Parameters:
  • lens_parameters (OpenCVLensDistortionParameters) – The Lens distortion parameters with which to compute the UV displacement map.
  • image_size (IntPoint) – The size of the camera image to be undistorted in pixels. Scaled down resolution will have an impact.
  • cropping_factor (float) – One means OpenCV will attempt to crop out all empty pixels resulting from the process (essentially zooming the image). Zero will keep all pixels.
Returns:

Texture2D containing the distort to undistort space displacement map.

camera_view_info (OpenCVCameraViewInfo): Information computed by OpenCV about the undistorted space. Can be used with SceneCapture to adjust FOV.

Return type:

OpenCVCameraViewInfo

classmethod draw_displacement_map_to_render_target(world_context_object, output_render_target, pre_computed_undistort_displacement_map) → None

Draws UV displacement map within the output render target. - Red & green channels hold the distort to undistort displacement; - Blue & alpha channels hold the undistort to distort displacement.

Parameters:
  • world_context_object (Object) – Current world to get the rendering settings from (such as feature level).
  • output_render_target (TextureRenderTarget2D) – The render target to draw to. Don’t necessarily need to have same resolution or aspect ratio as distorted render.
  • pre_computed_undistort_displacement_map (Texture2D) – Distort to undistort displacement pre computed using OpenCV in engine or externally.
classmethod equal_equal_compare_lens_distortion_models(a, b) → bool

Returns true if A is equal to B (A == B)

Parameters:
Returns:

Return type:

bool

classmethod not_equal_compare_lens_distortion_models(a, b) → bool

Returns true if A is not equal to B (A != B)

Parameters:
Returns:

Return type:

bool