Class RectifyImageOps
- java.lang.Object
-
- boofcv.alg.geo.RectifyImageOps
-
public class RectifyImageOps extends java.lang.ObjectOperations 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 Summary
Constructors Constructor and Description RectifyImageOps()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidallInsideLeft(int imageWidth, int imageHeight, org.ejml.data.DenseMatrix64F rectifyLeft, org.ejml.data.DenseMatrix64F rectifyRight)Adjust the rectification such that only pixels which overlap the original left image can be seen.static voidallInsideLeft(IntrinsicParameters paramLeft, org.ejml.data.DenseMatrix64F rectifyLeft, org.ejml.data.DenseMatrix64F rectifyRight, org.ejml.data.DenseMatrix64F rectifyK)Adjust the rectification such that only pixels which overlap the original left image can be seen.static RectifyCalibratedcreateCalibrated()Rectification for calibrated stereo pairs.static RectifyFundamentalcreateUncalibrated()Rectification for uncalibrated stereo pairs using the fundamental matrix.static voidfullViewLeft(int imageWidth, int imageHeight, org.ejml.data.DenseMatrix64F rectifyLeft, org.ejml.data.DenseMatrix64F rectifyRight)Adjust the rectification such that the entire original left image can be seen.static voidfullViewLeft(IntrinsicParameters paramLeft, org.ejml.data.DenseMatrix64F rectifyLeft, org.ejml.data.DenseMatrix64F rectifyRight, org.ejml.data.DenseMatrix64F rectifyK)Adjust the rectification such that the entire original left image can be seen.static <T extends ImageGray>
ImageDistort<T,T>rectifyImage(org.ejml.data.DenseMatrix64F rectify, BorderType borderType, java.lang.Class<T> imageType)Creates anImageDistortfor rectifying an image given its rectification matrix.static <T extends ImageBase>
ImageDistort<T,T>rectifyImage(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify, BorderType borderType, ImageType<T> imageType)Creates anImageDistortfor rectifying an image given its radial distortion and rectification matrix.static PointTransform_F32transformPixelToRect_F32(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify)Creates a transform that applies rectification to unrectified distorted pixels.static PointTransform_F64transformPixelToRect_F64(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify)Creates a transform that applies rectification to unrectified distorted pixels.static PointTransform_F64transformPixelToRectNorm_F64(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify, org.ejml.data.DenseMatrix64F rectifyK)Creates a transform that applies rectification to unrectified distorted pixels and outputs normalized pixel coordinates.static PointTransform_F32transformRectToPixel_F32(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify)Creates a transform that goes from rectified to original distorted pixel coordinates.static PointTransform_F64transformRectToPixel_F64(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify)Creates a transform that goes from rectified to original distorted pixel coordinates.
-
-
-
Method Detail
-
createCalibrated
public static RectifyCalibrated createCalibrated()
Rectification for calibrated stereo pairs. Two stereo camera care considered calibrated if their baseline is known.
After the rectification has been found it might still need to be adjusted for maximum viewing area. See fullViewLeft and allInsideLeft for adjusting the rectification.
- Returns:
RectifyCalibrated
-
createUncalibrated
public static RectifyFundamental createUncalibrated()
Rectification for uncalibrated stereo pairs using the fundamental matrix. Uncalibrated refers to the stereo baseline being unknown. For this technique to work the fundamental matrix needs to be known very accurately. See comments in
RectifyFundamentalfor more details.After the rectification has been found it might still need to be adjusted for maximum viewing area. See
fullViewLeft(int, int, org.ejml.data.DenseMatrix64F, org.ejml.data.DenseMatrix64F)andallInsideLeft(int, int, org.ejml.data.DenseMatrix64F, org.ejml.data.DenseMatrix64F).- Returns:
RectifyFundamental
-
fullViewLeft
public static void fullViewLeft(IntrinsicParameters paramLeft, org.ejml.data.DenseMatrix64F rectifyLeft, org.ejml.data.DenseMatrix64F rectifyRight, org.ejml.data.DenseMatrix64F rectifyK)
Adjust the rectification such that the entire original left image can be seen. For use with calibrated stereo images having a known baseline. Due to lens distortions it is possible for large parts of the rectified image to have no overlap with the original and will appear to be black. This can cause issues when processing the image
WARNING: There are pathological conditions where this will fail. If the new rotated image view and a pixel are parallel it will require infinite area.
- Parameters:
paramLeft- Intrinsic parameters for left camera. Not modified.rectifyLeft- Rectification matrix for left image. Input and Output. Modified.rectifyRight- Rectification matrix for right image. Input and Output. Modified.rectifyK- Rectification calibration matrix. Input and Output. Modified.
-
fullViewLeft
public static void fullViewLeft(int imageWidth, int imageHeight, org.ejml.data.DenseMatrix64F rectifyLeft, org.ejml.data.DenseMatrix64F rectifyRight)Adjust the rectification such that the entire original left image can be seen. For use with uncalibrated stereo images with unknown baseline.
Input rectification matrices are overwritten with adjusted values on output.
- Parameters:
imageWidth- Width of left image.imageHeight- Height of left image.rectifyLeft- Rectification matrix for left image. Input and Output. Modified.rectifyRight- Rectification matrix for right image. Input and Output. Modified.
-
allInsideLeft
public static void allInsideLeft(IntrinsicParameters paramLeft, org.ejml.data.DenseMatrix64F rectifyLeft, org.ejml.data.DenseMatrix64F rectifyRight, org.ejml.data.DenseMatrix64F rectifyK)
Adjust the rectification such that only pixels which overlap the original left image can be seen. For use with calibrated stereo images having a known baseline. Image processing is easier since only the "true" image pixels are visible, but information along the image border has been discarded. The rectification matrices are overwritten with adjusted values on output.
- Parameters:
paramLeft- Intrinsic parameters for left camera. Not modified.rectifyLeft- Rectification matrix for left image. Input and Output. Modified.rectifyRight- Rectification matrix for right image. Input and Output. Modified.rectifyK- Rectification calibration matrix. Input and Output. Modified.
-
allInsideLeft
public static void allInsideLeft(int imageWidth, int imageHeight, org.ejml.data.DenseMatrix64F rectifyLeft, org.ejml.data.DenseMatrix64F rectifyRight)Adjust the rectification such that only pixels which overlap the original left image can be seen. For use with uncalibrated images with unknown baselines. Image processing is easier since only the "true" image pixels are visible, but information along the image border has been discarded. The rectification matrices are overwritten with adjusted values on output.
- Parameters:
imageWidth- Width of left image.imageHeight- Height of left image.rectifyLeft- Rectification matrix for left image. Input and Output. Modified.rectifyRight- Rectification matrix for right image. Input and Output. Modified.
-
transformRectToPixel_F32
public static PointTransform_F32 transformRectToPixel_F32(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify)
Creates a transform that goes from rectified to original distorted pixel coordinates. Rectification includes removal of lens distortion. Used for rendering rectified images.
- Parameters:
param- Intrinsic parameters.rectify- Transform for rectifying the image.- Returns:
- Transform from rectified to unrectified pixels
-
transformRectToPixel_F64
public static PointTransform_F64 transformRectToPixel_F64(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify)
Creates a transform that goes from rectified to original distorted pixel coordinates. Rectification includes removal of lens distortion. Used for rendering rectified images.
- Parameters:
param- Intrinsic parameters.rectify- Transform for rectifying the image.- Returns:
- Transform from rectified to unrectified pixels
-
transformPixelToRect_F32
public static PointTransform_F32 transformPixelToRect_F32(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify)
Creates a transform that applies rectification to unrectified distorted pixels.
- Parameters:
param- Intrinsic parameters. Not modified.rectify- Transform for rectifying the image. Not modified.- Returns:
- Transform from unrectified to rectified pixels
-
transformPixelToRect_F64
public static PointTransform_F64 transformPixelToRect_F64(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify)
Creates a transform that applies rectification to unrectified distorted pixels.
- Parameters:
param- Intrinsic parameters. Not modified.rectify- Transform for rectifying the image. Not modified.- Returns:
- Transform from distorted pixel to rectified pixels
-
transformPixelToRectNorm_F64
public static PointTransform_F64 transformPixelToRectNorm_F64(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify, org.ejml.data.DenseMatrix64F rectifyK)
Creates a transform that applies rectification to unrectified distorted pixels and outputs normalized pixel coordinates.
- Parameters:
param- Intrinsic parameters.rectify- Transform for rectifying the image.rectifyK- Camera calibration matrix after rectification- Returns:
- Transform from unrectified to rectified normalized pixels
-
rectifyImage
public static <T extends ImageGray> ImageDistort<T,T> rectifyImage(org.ejml.data.DenseMatrix64F rectify, BorderType borderType, java.lang.Class<T> imageType)
Creates anImageDistortfor 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> ImageDistort<T,T> rectifyImage(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify, BorderType borderType, ImageType<T> imageType)
Creates anImageDistortfor 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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG