Class RectifyDistortImageOps

java.lang.Object
boofcv.alg.geo.RectifyDistortImageOps

public class RectifyDistortImageOps extends Object

Operations related to rectifying stereo image pairs. Provides functions for 1) creating rectification calculation algorithms, 2) rectification transforms, and 3) image distortion for rectification.

Definition of transformed coordinate systems:

Pixel
Original image coordinates in pixels.
Rect
Rectified image coordinates in pixels. Lens distortion has been removed.
RectNorm
Rectified image coordinates in normalized coordinates.

  • Constructor Details

    • RectifyDistortImageOps

      public RectifyDistortImageOps()
  • Method Details

    • rectifyImage

      public static <T extends ImageGray<T>> ImageDistort<T,T> rectifyImage(FMatrixRMaj rectify, BorderType borderType, Class<T> imageType)
      Creates an ImageDistort for rectifying an image given its rectification matrix. Lens distortion is assumed to have been previously removed.
      Parameters:
      rectify - Transform for rectifying the image.
      imageType - Type of single band image the transform is to be applied to.
      Returns:
      ImageDistort for rectifying the image.
    • rectifyImage

      public static <T extends ImageBase<T>> ImageDistort<T,T> rectifyImage(CameraPinholeBrown param, FMatrixRMaj rectify, BorderType borderType, ImageType<T> imageType)
      Creates an ImageDistort for rectifying an image given its radial distortion and rectification matrix.
      Parameters:
      param - Intrinsic parameters.
      rectify - Transform for rectifying the image.
      imageType - Type of single band image the transform is to be applied to.
      Returns:
      ImageDistort for rectifying the image.
    • applyMask

      public static void applyMask(GrayF32 disparity, GrayU8 mask, int radius)
      Applies a mask which indicates which pixels had mappings to the unrectified image. Pixels which were outside of the original image will be set to 255. The border is extended because the sharp edge in the rectified image can cause in incorrect match between image features.
      Parameters:
      disparity - (Input) disparity
      mask - (Input) mask. 1 = mapping to unrectified. 0 = no mapping
      radius - How much the border is extended by
    • applyMask

      public static void applyMask(GrayU8 disparity, GrayU8 mask, int radius)
      Applies a mask which indicates which pixels had mappings to the unrectified image. Pixels which were outside of the original image will be set to 255. The border is extended because the sharp edge can confuse disparity algorithms.
      Parameters:
      disparity - (Input) disparity
      mask - (Input) mask. 1 = mapping to unrectified. 0 = no mapping
      radius - How much the border is extended by