public class RectifyImageOps
extends java.lang.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:
| Constructor and Description |
|---|
RectifyImageOps() |
| Modifier and Type | Method and Description |
|---|---|
static void |
allInsideLeft(CameraPinholeRadial paramLeft,
org.ejml.data.DMatrixRMaj rectifyLeft,
org.ejml.data.DMatrixRMaj rectifyRight,
org.ejml.data.DMatrixRMaj rectifyK)
Adjust the rectification such that only pixels which overlap the original left image can be seen.
|
static void |
allInsideLeft(CameraPinholeRadial paramLeft,
org.ejml.data.FMatrixRMaj rectifyLeft,
org.ejml.data.FMatrixRMaj rectifyRight,
org.ejml.data.FMatrixRMaj rectifyK)
Adjust the rectification such that only pixels which overlap the original left image can be seen.
|
static void |
allInsideLeft(int imageWidth,
int imageHeight,
org.ejml.data.DMatrixRMaj rectifyLeft,
org.ejml.data.DMatrixRMaj rectifyRight)
Adjust the rectification such that only pixels which overlap the original left image can be seen.
|
static void |
allInsideLeft(int imageWidth,
int imageHeight,
org.ejml.data.FMatrixRMaj rectifyLeft,
org.ejml.data.FMatrixRMaj rectifyRight)
Adjust the rectification such that only pixels which overlap the original left image can be seen.
|
static RectifyCalibrated |
createCalibrated()
Rectification for calibrated stereo pairs.
|
static RectifyFundamental |
createUncalibrated()
Rectification for uncalibrated stereo pairs using the fundamental matrix.
|
static void |
fullViewLeft(CameraPinholeRadial paramLeft,
org.ejml.data.DMatrixRMaj rectifyLeft,
org.ejml.data.DMatrixRMaj rectifyRight,
org.ejml.data.DMatrixRMaj rectifyK)
Adjust the rectification such that the entire original left image can be seen.
|
static void |
fullViewLeft(CameraPinholeRadial paramLeft,
org.ejml.data.FMatrixRMaj rectifyLeft,
org.ejml.data.FMatrixRMaj rectifyRight,
org.ejml.data.FMatrixRMaj rectifyK)
Adjust the rectification such that the entire original left image can be seen.
|
static void |
fullViewLeft(int imageWidth,
int imageHeight,
org.ejml.data.DMatrixRMaj rectifyLeft,
org.ejml.data.DMatrixRMaj rectifyRight)
Adjust the rectification such that the entire original left image can be seen.
|
static void |
fullViewLeft(int imageWidth,
int imageHeight,
org.ejml.data.FMatrixRMaj rectifyLeft,
org.ejml.data.FMatrixRMaj rectifyRight)
Adjust the rectification such that the entire original left image can be seen.
|
static <T extends boofcv.struct.image.ImageBase<T>> |
rectifyImage(CameraPinholeRadial param,
org.ejml.data.FMatrixRMaj rectify,
boofcv.core.image.border.BorderType borderType,
boofcv.struct.image.ImageType<T> imageType)
Creates an
ImageDistort for rectifying an image given its radial distortion and
rectification matrix. |
static <T extends boofcv.struct.image.ImageGray<T>> |
rectifyImage(org.ejml.data.FMatrixRMaj rectify,
boofcv.core.image.border.BorderType borderType,
java.lang.Class<T> imageType)
Creates an
ImageDistort for rectifying an image given its rectification matrix. |
static boofcv.struct.distort.Point2Transform2_F64 |
transformPixelToRect(CameraPinholeRadial param,
org.ejml.data.DMatrixRMaj rectify)
Creates a transform that applies rectification to unrectified distorted pixels.
|
static boofcv.struct.distort.Point2Transform2_F32 |
transformPixelToRect(CameraPinholeRadial param,
org.ejml.data.FMatrixRMaj rectify)
Creates a transform that applies rectification to unrectified distorted pixels.
|
static boofcv.struct.distort.Point2Transform2_F64 |
transformPixelToRectNorm(CameraPinholeRadial param,
org.ejml.data.DMatrixRMaj rectify,
org.ejml.data.DMatrixRMaj rectifyK)
Creates a transform that applies rectification to unrectified distorted pixels and outputs
normalized pixel coordinates.
|
static boofcv.struct.distort.Point2Transform2_F32 |
transformPixelToRectNorm(CameraPinholeRadial param,
org.ejml.data.FMatrixRMaj rectify,
org.ejml.data.FMatrixRMaj rectifyK)
Creates a transform that applies rectification to unrectified distorted pixels and outputs
normalized pixel coordinates.
|
static boofcv.struct.distort.Point2Transform2_F64 |
transformRectToPixel(CameraPinholeRadial param,
org.ejml.data.DMatrixRMaj rectify)
Creates a transform that goes from rectified to original distorted pixel coordinates.
|
static boofcv.struct.distort.Point2Transform2_F32 |
transformRectToPixel(CameraPinholeRadial param,
org.ejml.data.FMatrixRMaj rectify)
Creates a transform that goes from rectified to original distorted pixel coordinates.
|
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.
RectifyCalibratedpublic 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 RectifyFundamental for 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.DMatrixRMaj, org.ejml.data.DMatrixRMaj)
and allInsideLeft(int, int, org.ejml.data.DMatrixRMaj, org.ejml.data.DMatrixRMaj).
RectifyFundamentalpublic static void fullViewLeft(CameraPinholeRadial paramLeft, org.ejml.data.DMatrixRMaj rectifyLeft, org.ejml.data.DMatrixRMaj rectifyRight, org.ejml.data.DMatrixRMaj 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.
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.public static void fullViewLeft(CameraPinholeRadial paramLeft, org.ejml.data.FMatrixRMaj rectifyLeft, org.ejml.data.FMatrixRMaj rectifyRight, org.ejml.data.FMatrixRMaj 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.
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.public static void fullViewLeft(int imageWidth,
int imageHeight,
org.ejml.data.DMatrixRMaj rectifyLeft,
org.ejml.data.DMatrixRMaj 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.
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.public static void fullViewLeft(int imageWidth,
int imageHeight,
org.ejml.data.FMatrixRMaj rectifyLeft,
org.ejml.data.FMatrixRMaj 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.
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.public static void allInsideLeft(CameraPinholeRadial paramLeft, org.ejml.data.DMatrixRMaj rectifyLeft, org.ejml.data.DMatrixRMaj rectifyRight, org.ejml.data.DMatrixRMaj 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.
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.public static void allInsideLeft(CameraPinholeRadial paramLeft, org.ejml.data.FMatrixRMaj rectifyLeft, org.ejml.data.FMatrixRMaj rectifyRight, org.ejml.data.FMatrixRMaj 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.
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.public static void allInsideLeft(int imageWidth,
int imageHeight,
org.ejml.data.DMatrixRMaj rectifyLeft,
org.ejml.data.DMatrixRMaj 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.
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.public static void allInsideLeft(int imageWidth,
int imageHeight,
org.ejml.data.FMatrixRMaj rectifyLeft,
org.ejml.data.FMatrixRMaj 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.
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.public static boofcv.struct.distort.Point2Transform2_F64 transformRectToPixel(CameraPinholeRadial param, org.ejml.data.DMatrixRMaj rectify)
Creates a transform that goes from rectified to original distorted pixel coordinates. Rectification includes removal of lens distortion. Used for rendering rectified images.
param - Intrinsic parameters.rectify - Transform for rectifying the image.public static boofcv.struct.distort.Point2Transform2_F32 transformRectToPixel(CameraPinholeRadial param, org.ejml.data.FMatrixRMaj rectify)
Creates a transform that goes from rectified to original distorted pixel coordinates. Rectification includes removal of lens distortion. Used for rendering rectified images.
param - Intrinsic parameters.rectify - Transform for rectifying the image.public static boofcv.struct.distort.Point2Transform2_F64 transformPixelToRect(CameraPinholeRadial param, org.ejml.data.DMatrixRMaj rectify)
Creates a transform that applies rectification to unrectified distorted pixels.
param - Intrinsic parameters. Not modified.rectify - Transform for rectifying the image. Not modified.public static boofcv.struct.distort.Point2Transform2_F32 transformPixelToRect(CameraPinholeRadial param, org.ejml.data.FMatrixRMaj rectify)
Creates a transform that applies rectification to unrectified distorted pixels.
param - Intrinsic parameters. Not modified.rectify - Transform for rectifying the image. Not modified.public static boofcv.struct.distort.Point2Transform2_F64 transformPixelToRectNorm(CameraPinholeRadial param, org.ejml.data.DMatrixRMaj rectify, org.ejml.data.DMatrixRMaj rectifyK)
Creates a transform that applies rectification to unrectified distorted pixels and outputs normalized pixel coordinates.
param - Intrinsic parameters.rectify - Transform for rectifying the image.rectifyK - Camera calibration matrix after rectificationpublic static boofcv.struct.distort.Point2Transform2_F32 transformPixelToRectNorm(CameraPinholeRadial param, org.ejml.data.FMatrixRMaj rectify, org.ejml.data.FMatrixRMaj rectifyK)
Creates a transform that applies rectification to unrectified distorted pixels and outputs normalized pixel coordinates.
param - Intrinsic parameters.rectify - Transform for rectifying the image.rectifyK - Camera calibration matrix after rectificationpublic static <T extends boofcv.struct.image.ImageGray<T>> boofcv.alg.distort.ImageDistort<T,T> rectifyImage(org.ejml.data.FMatrixRMaj rectify,
boofcv.core.image.border.BorderType borderType,
java.lang.Class<T> imageType)
ImageDistort for rectifying an image given its rectification matrix.
Lens distortion is assumed to have been previously removed.rectify - Transform for rectifying the image.imageType - Type of single band image the transform is to be applied to.public static <T extends boofcv.struct.image.ImageBase<T>> boofcv.alg.distort.ImageDistort<T,T> rectifyImage(CameraPinholeRadial param, org.ejml.data.FMatrixRMaj rectify, boofcv.core.image.border.BorderType borderType, boofcv.struct.image.ImageType<T> imageType)
ImageDistort for rectifying an image given its radial distortion and
rectification matrix.param - Intrinsic parameters.rectify - Transform for rectifying the image.imageType - Type of single band image the transform is to be applied to.