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(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 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.
|
static RectifyCalibrated |
createCalibrated()
Rectification for calibrated stereo pairs.
|
static RectifyFundamental |
createUncalibrated()
Rectification for uncalibrated stereo pairs using the fundamental matrix.
|
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.
|
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.
|
static <T extends boofcv.struct.image.ImageSingleBand> |
rectifyImage(org.ejml.data.DenseMatrix64F rectify,
boofcv.core.image.border.BorderType borderType,
java.lang.Class<T> imageType)
Creates an
ImageDistort for rectifying an image given its rectification matrix. |
static <T extends boofcv.struct.image.ImageSingleBand> |
rectifyImage(IntrinsicParameters param,
org.ejml.data.DenseMatrix64F rectify,
boofcv.core.image.border.BorderType borderType,
java.lang.Class<T> imageType)
Creates an
ImageDistort for rectifying an image given its radial distortion and
rectification matrix. |
static boofcv.struct.distort.PointTransform_F32 |
transformPixelToRect_F32(IntrinsicParameters param,
org.ejml.data.DenseMatrix64F rectify)
Creates a transform that applies rectification to unrectified distorted pixels.
|
static boofcv.struct.distort.PointTransform_F64 |
transformPixelToRect_F64(IntrinsicParameters param,
org.ejml.data.DenseMatrix64F rectify)
Creates a transform that applies rectification to unrectified distorted pixels.
|
static boofcv.struct.distort.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.
|
static boofcv.struct.distort.PointTransform_F32 |
transformRectToPixel_F32(IntrinsicParameters param,
org.ejml.data.DenseMatrix64F rectify)
Creates a transform that goes from rectified to original distorted pixel coordinates.
|
static boofcv.struct.distort.PointTransform_F64 |
transformRectToPixel_F64(IntrinsicParameters param,
org.ejml.data.DenseMatrix64F 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.DenseMatrix64F, org.ejml.data.DenseMatrix64F)
and allInsideLeft(int, int, org.ejml.data.DenseMatrix64F, org.ejml.data.DenseMatrix64F).
RectifyFundamentalpublic 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.
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.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.
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(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.
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.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.
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.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.
param - Intrinsic parameters.rectify - Transform for rectifying the image.public static boofcv.struct.distort.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.
param - Intrinsic parameters.rectify - Transform for rectifying the image.public static boofcv.struct.distort.PointTransform_F32 transformPixelToRect_F32(IntrinsicParameters param, org.ejml.data.DenseMatrix64F 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.PointTransform_F64 transformPixelToRect_F64(IntrinsicParameters param, org.ejml.data.DenseMatrix64F 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.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.
param - Intrinsic parameters.rectify - Transform for rectifying the image.rectifyK - Camera calibration matrix after rectificationpublic static <T extends boofcv.struct.image.ImageSingleBand> boofcv.alg.distort.ImageDistort<T,T> rectifyImage(org.ejml.data.DenseMatrix64F 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.ImageSingleBand> boofcv.alg.distort.ImageDistort<T,T> rectifyImage(IntrinsicParameters param, org.ejml.data.DenseMatrix64F rectify, boofcv.core.image.border.BorderType borderType, java.lang.Class<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.