boofcv.alg.distort
Class DistortImageOps
- java.lang.Object
-
- boofcv.alg.distort.DistortImageOps
-
public class DistortImageOps extends java.lang.ObjectProvides common function for distorting images.
-
-
Constructor Summary
Constructors Constructor and Description DistortImageOps()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description static <T extends ImageBase>
voidaffine(T input, T output, BorderType borderType, TypeInterpolate interpType, double a11, double a12, double a21, double a22, double dx, double dy)Deprecated.As of v0.19. UseFDistortinsteadstatic RectangleLength2D_F32boundBox_F32(int srcWidth, int srcHeight, PixelTransform_F32 transform)Finds an axis-aligned bounding box which would contain a image after it has been transformed.static RectangleLength2D_F64boundBox_F64(int srcWidth, int srcHeight, PixelTransform_F64 transform)Finds an axis-aligned bounding box which would contain a image after it has been transformed.static RectangleLength2D_I32boundBox(int srcWidth, int srcHeight, int dstWidth, int dstHeight, PixelTransform_F32 transform)Finds an axis-aligned bounding box which would contain a image after it has been transformed.static RectangleLength2D_I32boundBox(int srcWidth, int srcHeight, PixelTransform_F32 transform)Finds an axis-aligned bounding box which would contain a image after it has been transformed.static <Input extends ImageGray,Output extends ImageGray>
ImageDistort<Input,Output>createImageDistort(PointTransform_F32 transform, TypeInterpolate interpType, BorderType borderType, java.lang.Class<Input> inputType, java.lang.Class<Output> outputType)Deprecated.As of v0.19. UseFDistortinsteadstatic <Input extends ImageGray,Output extends ImageGray,M extends Planar<Input>,N extends Planar<Output>>
voiddistortPL(M input, N output, PixelTransform_F32 transform, BorderType borderType, TypeInterpolate interpType)Deprecated.As of v0.19. UseFDistortinsteadstatic <Input extends ImageGray,Output extends ImageGray>
voiddistortPL(Planar<Input> input, Planar<Output> output, ImageDistort<Input,Output> distortion)Deprecated.As of v0.19. UseFDistortinsteadstatic <Input extends ImageGray,Output extends ImageGray>
voiddistortSingle(Input input, Output output, boolean renderAll, PixelTransform_F32 transform, InterpolatePixelS<Input> interp)Deprecated.As of v0.19. UseFDistortinsteadstatic <Input extends ImageGray,Output extends ImageGray>
voiddistortSingle(Input input, Output output, PixelTransform_F32 transform, TypeInterpolate interpType, BorderType borderType)Deprecated.As of v0.19. UseFDistortinsteadstatic <T extends ImageBase>
voidrotate(T input, T output, BorderType borderType, TypeInterpolate interpType, float angleInputToOutput)Deprecated.As of v0.19. UseFDistortinsteadstatic <T extends ImageBase>
voidscale(T input, T output, BorderType borderType, TypeInterpolate interpType)Deprecated.
-
-
-
Method Detail
-
affine
@Deprecated public static <T extends ImageBase> void affine(T input, T output, BorderType borderType, TypeInterpolate interpType, double a11, double a12, double a21, double a22, double dx, double dy)
Deprecated. As of v0.19. UseFDistortinsteadApplies an affine transformation from the input image to the output image.
Input coordinates (x,y) to output coordinate (x',y')
x' = a11*x + a12*y + dx
y' = a21*x + a22*y + dy- Parameters:
input- Which which is being rotated.output- The image in which the output is written to.borderType- Describes how pixels outside the image border should be handled.interpType- Which type of interpolation will be used.
-
distortSingle
public static <Input extends ImageGray,Output extends ImageGray> void distortSingle(Input input, Output output, PixelTransform_F32 transform, TypeInterpolate interpType, BorderType borderType)
Deprecated. As of v0.19. UseFDistortinsteadApplies a pixel transform to a single band image. Easier to use function.- Parameters:
input- Input (source) image.output- Where the result of transforming the image image is written to.transform- The transform that is being applied to the imageinterpType- Which type of pixel interpolation should be used. BILINEAR is in general recommendedborderType- Specifies how to handle image borders.
-
distortSingle
public static <Input extends ImageGray,Output extends ImageGray> void distortSingle(Input input, Output output, boolean renderAll, PixelTransform_F32 transform, InterpolatePixelS<Input> interp)
Deprecated. As of v0.19. UseFDistortinsteadApplies a pixel transform to a single band image. More flexible but order to use function.- Parameters:
input- Input (source) image.output- Where the result of transforming the image image is written to.renderAll- true it renders all pixels, even ones outside the input image.transform- The transform that is being applied to the imageinterp- Interpolation algorithm.
-
distortPL
public static <Input extends ImageGray,Output extends ImageGray,M extends Planar<Input>,N extends Planar<Output>> void distortPL(M input, N output, PixelTransform_F32 transform, BorderType borderType, TypeInterpolate interpType)
Deprecated. As of v0.19. UseFDistortinsteadApplies a pixel transform to aPlanarimage.- Parameters:
input- Input (source) image.output- Where the result of transforming the image image is written to.transform- The transform that is being applied to the imageborderType- Describes how pixels outside the image border should be handled.interpType- Which type of pixel interpolation should be used.
-
createImageDistort
public static <Input extends ImageGray,Output extends ImageGray> ImageDistort<Input,Output> createImageDistort(PointTransform_F32 transform, TypeInterpolate interpType, BorderType borderType, java.lang.Class<Input> inputType, java.lang.Class<Output> outputType)
Deprecated. As of v0.19. UseFDistortinsteadEasy way to createImageDistortgivenPixelTransform_F32. To improve performance the distortion is automatically cached.- Parameters:
transform- Image transform.interpType- Which interpolation. Try bilinear.inputType- Image of single band image it will process.- Returns:
- The
ImageDistort - See Also:
FactoryDistort,FactoryInterpolation
-
scale
@Deprecated public static <T extends ImageBase> void scale(T input, T output, BorderType borderType, TypeInterpolate interpType)
Deprecated.Rescales the input image and writes the results into the output image. The scale factor is determined independently of the width and height.- Parameters:
input- Input image. Not modified.output- Rescaled input image. Modified.borderType- Describes how pixels outside the image border should be handled.interpType- Which interpolation algorithm should be used.
-
rotate
@Deprecated public static <T extends ImageBase> void rotate(T input, T output, BorderType borderType, TypeInterpolate interpType, float angleInputToOutput)
Deprecated. As of v0.19. UseFDistortinsteadRotates the image using the specified interpolation type. The rotation is performed around the specified center of rotation in the input image.
Input coordinates (x,y) to output coordinate (x',y')
x' = x_c + c*(x-x_c) - s(y - y_c)
y' = y_c + s*(x-x_c) + c(y - y_c)- Parameters:
input- Which which is being rotated.output- The image in which the output is written to.borderType- Describes how pixels outside the image border should be handled.interpType- Which type of interpolation will be used.angleInputToOutput- Angle of rotation in radians. From input to output, CCW rotation.
-
distortPL
public static <Input extends ImageGray,Output extends ImageGray> void distortPL(Planar<Input> input, Planar<Output> output, ImageDistort<Input,Output> distortion)
Deprecated. As of v0.19. UseFDistortinsteadApplies a distortion to aPlanarimage.- Type Parameters:
Input- Band type.- Parameters:
input- Image being distorted. Not modified.output- Output image. modified.distortion- The distortion model
-
boundBox
public static RectangleLength2D_I32 boundBox(int srcWidth, int srcHeight, int dstWidth, int dstHeight, PixelTransform_F32 transform)
Finds an axis-aligned bounding box which would contain a image after it has been transformed. A sanity check is done to made sure it is contained inside the destination image's bounds. If it is totally outside then a rectangle with negative width or height is returned.- Parameters:
srcWidth- Width of the source imagesrcHeight- Height of the source imagedstWidth- Width of the destination imagedstHeight- Height of the destination imagetransform- Transform being applied to the image- Returns:
- Bounding box
-
boundBox
public static RectangleLength2D_I32 boundBox(int srcWidth, int srcHeight, PixelTransform_F32 transform)
Finds an axis-aligned bounding box which would contain a image after it has been transformed. The returned bounding box can be larger then the original image.- Parameters:
srcWidth- Width of the source imagesrcHeight- Height of the source imagetransform- Transform being applied to the image- Returns:
- Bounding box
-
boundBox_F32
public static RectangleLength2D_F32 boundBox_F32(int srcWidth, int srcHeight, PixelTransform_F32 transform)
Finds an axis-aligned bounding box which would contain a image after it has been transformed. The returned bounding box can be larger then the original image.- Parameters:
srcWidth- Width of the source imagesrcHeight- Height of the source imagetransform- Transform being applied to the image- Returns:
- Bounding box
-
boundBox_F64
public static RectangleLength2D_F64 boundBox_F64(int srcWidth, int srcHeight, PixelTransform_F64 transform)
Finds an axis-aligned bounding box which would contain a image after it has been transformed. The returned bounding box can be larger then the original image.- Parameters:
srcWidth- Width of the source imagesrcHeight- Height of the source imagetransform- Transform being applied to the image- Returns:
- Bounding box
-
-
DataMelt 3.0 © DataMelt by jWork.ORG