public class LensDistortionOps
extends java.lang.Object
| Constructor and Description |
|---|
LensDistortionOps() |
| Modifier and Type | Method and Description |
|---|---|
static georegression.struct.shapes.RectangleLength2D_F32 |
boundBoxInside(int srcWidth,
int srcHeight,
boofcv.struct.distort.PixelTransform_F32 transform)
Finds the maximum area axis-aligned rectangle contained inside the transformed image which
does not include any pixels outside the sources border.
|
static georegression.struct.shapes.RectangleLength2D_F64 |
boundBoxInside(int srcWidth,
int srcHeight,
boofcv.struct.distort.PixelTransform_F64 transform)
Finds the maximum area axis-aligned rectangle contained inside the transformed image which
does not include any pixels outside the sources border.
|
static <T extends boofcv.struct.image.ImageBase> |
imageRemoveDistortion(AdjustmentType type,
boofcv.core.image.border.BorderType borderType,
IntrinsicParameters param,
IntrinsicParameters paramAdj,
boofcv.struct.image.ImageType<T> imageType)
Creates an
ImageDistort class which will remove the lens distortion. |
static void |
roundInside(georegression.struct.shapes.RectangleLength2D_F32 bound)
Adjust bound to ensure the entire image is contained inside, otherwise there might be
single pixel wide black regions
|
static void |
roundInside(georegression.struct.shapes.RectangleLength2D_F64 bound)
Adjust bound to ensure the entire image is contained inside, otherwise there might be
single pixel wide black regions
|
static boofcv.struct.distort.PointTransform_F32 |
transform_F32(AdjustmentType type,
IntrinsicParameters param,
IntrinsicParameters paramAdj,
boolean undistortedToDistorted)
Creates a
PointTransform_F32 for adding and removing lens distortion. |
static boofcv.struct.distort.PointTransform_F64 |
transform_F64(AdjustmentType type,
IntrinsicParameters param,
IntrinsicParameters paramAdj,
boolean undistortedToDistorted)
Creates a
PointTransform_F64 for adding and removing lens distortion. |
static LensDistortionPinhole |
transformPoint(IntrinsicParameters param)
Creates the
lens distortion for the specified camera parameters. |
public static <T extends boofcv.struct.image.ImageBase> boofcv.alg.distort.ImageDistort<T,T> imageRemoveDistortion(AdjustmentType type, boofcv.core.image.border.BorderType borderType, IntrinsicParameters param, IntrinsicParameters paramAdj, boofcv.struct.image.ImageType<T> imageType)
Creates an ImageDistort class which will remove the lens distortion. The user
can select how the view is adjusted.
If BorderType.VALUE then pixels outside the image will be filled in with a value of 0. For viewing purposes it is recommended that BorderType.VALUE be used and BorderType.EXTENDED in computer vision applications. VALUE creates harsh edges which can cause false positives when detecting features, which EXTENDED minimizes.
type - The type of adjustment it will doborderType - Specifies how the image border is handled. Null means borders are ignored.param - Original intrinsic parameters.paramAdj - (output) Intrinsic parameters which reflect the undistorted image. Can be null.imageType - Type of image it will undistortpublic static boofcv.struct.distort.PointTransform_F32 transform_F32(AdjustmentType type, IntrinsicParameters param, IntrinsicParameters paramAdj, boolean undistortedToDistorted)
PointTransform_F32 for adding and removing lens distortion.type - The type of adjustment it will apply to the transformparam - Intrinsic camera parameters.paramAdj - If not null, the new camera parameters for the undistorted view are stored here.undistortedToDistorted - If true then the transform's input is assumed to be pixels in the adjusted undistorted
image and the output will be in distorted image, if false then the reverse transform
is returned.public static boofcv.struct.distort.PointTransform_F64 transform_F64(AdjustmentType type, IntrinsicParameters param, IntrinsicParameters paramAdj, boolean undistortedToDistorted)
PointTransform_F64 for adding and removing lens distortion.type - The type of adjustment it will apply to the transformparam - Intrinsic camera parameters.paramAdj - If not null, the new camera parameters for the undistorted view are stored here.undistortedToDistorted - If true then the transform's input is assumed to be pixels in the adjusted undistorted
image and the output will be in distorted image, if false then the reverse transform
is returned.public static LensDistortionPinhole transformPoint(IntrinsicParameters param)
Creates the lens distortion for the specified camera parameters.
Call this to create transforms to and from pixel and normalized image coordinates with and without
lens distortion. Automatically switches algorithm depending on the type of distortion or lack thereof.
Example:
PointTransform_F64 normToPixel = LensDistortionOps.distortTransform(param).distort_F64(false,true);Creates a transform from normalized image coordinates into pixel coordinates.
public static georegression.struct.shapes.RectangleLength2D_F32 boundBoxInside(int srcWidth,
int srcHeight,
boofcv.struct.distort.PixelTransform_F32 transform)
srcWidth - Width of the source imagesrcHeight - Height of the source imagetransform - Transform being applied to the imagepublic static georegression.struct.shapes.RectangleLength2D_F64 boundBoxInside(int srcWidth,
int srcHeight,
boofcv.struct.distort.PixelTransform_F64 transform)
srcWidth - Width of the source imagesrcHeight - Height of the source imagetransform - Transform being applied to the imagepublic static void roundInside(georegression.struct.shapes.RectangleLength2D_F32 bound)
public static void roundInside(georegression.struct.shapes.RectangleLength2D_F64 bound)