Package boofcv.alg.distort
Class ImageDistortBasic<Input extends boofcv.struct.image.ImageBase<Input>,Output extends boofcv.struct.image.ImageBase<Output>,Interpolate extends InterpolatePixel<Input>>
- java.lang.Object
-
- boofcv.alg.distort.ImageDistortBasic<Input,Output,Interpolate>
-
- All Implemented Interfaces:
ImageDistort<Input,Output>
- Direct Known Subclasses:
ImageDistortBasic_IL,ImageDistortBasic_IL_MT,ImageDistortBasic_SB,ImageDistortBasic_SB_MT
public abstract class ImageDistortBasic<Input extends boofcv.struct.image.ImageBase<Input>,Output extends boofcv.struct.image.ImageBase<Output>,Interpolate extends InterpolatePixel<Input>> extends java.lang.Object implements ImageDistort<Input,Output>
Most basic implementation ofImageDistort. Computes the distortion from the dst to src image for each pixel. The dst pixel value is then set to the interpolated value of the src image.
-
-
Field Summary
Fields Modifier and Type Field Description protected OutputdstImgprotected boofcv.struct.distort.PixelTransform<georegression.struct.point.Point2D_F32>dstToSrcprotected Interpolateinterpprotected booleanrenderAllprotected InputsrcImgprotected intx0protected intx1protected inty0protected inty1
-
Constructor Summary
Constructors Constructor Description ImageDistortBasic(Interpolate interp)Specifies configuration parameters
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidapply(Input srcImg, Output dstImg)Applies the transform to the entire destination image.voidapply(Input srcImg, Output dstImg, int dstX0, int dstY0, int dstX1, int dstY1)Applies the transform to only the specified region inside the destination image.voidapply(Input srcImg, Output dstImg, boofcv.struct.image.GrayU8 mask)Applies the transform, but marks pixels in the mask as 1 = inside, 0 = outside.protected abstract voidapplyAll()protected abstract voidapplyAll(boofcv.struct.image.GrayU8 mask)protected abstract voidapplyOnlyInside()protected abstract voidapplyOnlyInside(boofcv.struct.image.GrayU8 mask)boofcv.struct.distort.PixelTransform<georegression.struct.point.Point2D_F32>getModel()Returns the distortion model.booleangetRenderAll()Returns the render all flagprotected voidinit(Input srcImg, Output dstImg)voidsetModel(boofcv.struct.distort.PixelTransform<georegression.struct.point.Point2D_F32> dstToSrc)Specifies how pixel coordinates are transformed from the destination to source images.voidsetRenderAll(boolean renderAll)Specifies if the entire output image should be rendered, even if mapping to the source image is outside the source image.
-
-
-
Field Detail
-
dstToSrc
protected boofcv.struct.distort.PixelTransform<georegression.struct.point.Point2D_F32> dstToSrc
-
interp
protected Interpolate extends InterpolatePixel<Input> interp
-
x0
protected int x0
-
y0
protected int y0
-
x1
protected int x1
-
y1
protected int y1
-
renderAll
protected boolean renderAll
-
-
Constructor Detail
-
ImageDistortBasic
public ImageDistortBasic(Interpolate interp)
Specifies configuration parameters- Parameters:
interp- Interpolation algorithm
-
-
Method Detail
-
setModel
public void setModel(boofcv.struct.distort.PixelTransform<georegression.struct.point.Point2D_F32> dstToSrc)
Description copied from interface:ImageDistortSpecifies how pixel coordinates are transformed from the destination to source images.
-
apply
public void apply(Input srcImg, Output dstImg)
Description copied from interface:ImageDistortApplies the transform to the entire destination image.
-
apply
public void apply(Input srcImg, Output dstImg, boofcv.struct.image.GrayU8 mask)
Description copied from interface:ImageDistortApplies the transform, but marks pixels in the mask as 1 = inside, 0 = outside. Where inside pixels are pixels in the dst image with an equivalent pixel in the src image's bounds
-
apply
public void apply(Input srcImg, Output dstImg, int dstX0, int dstY0, int dstX1, int dstY1)
Description copied from interface:ImageDistortApplies the transform to only the specified region inside the destination image.- Specified by:
applyin interfaceImageDistort<Input extends boofcv.struct.image.ImageBase<Input>,Output extends boofcv.struct.image.ImageBase<Output>>- Parameters:
srcImg- Input image. Not modified.dstImg- Output image. Modified.dstX0- Left most crop boundary. Inclusive.dstY0- Top most crop boundary. Inclusive.dstX1- Right most crop boundary. Exclusive.dstY1- Bottom most crop boundary. Exclusive.
-
applyAll
protected abstract void applyAll()
-
applyAll
protected abstract void applyAll(boofcv.struct.image.GrayU8 mask)
-
applyOnlyInside
protected abstract void applyOnlyInside()
-
applyOnlyInside
protected abstract void applyOnlyInside(boofcv.struct.image.GrayU8 mask)
-
setRenderAll
public void setRenderAll(boolean renderAll)
Description copied from interface:ImageDistortSpecifies if the entire output image should be rendered, even if mapping to the source image is outside the source image.- Specified by:
setRenderAllin interfaceImageDistort<Input extends boofcv.struct.image.ImageBase<Input>,Output extends boofcv.struct.image.ImageBase<Output>>- Parameters:
renderAll- true to render all pixels. If false then only pixels inside the source image
-
getRenderAll
public boolean getRenderAll()
Description copied from interface:ImageDistortReturns the render all flag- Specified by:
getRenderAllin interfaceImageDistort<Input extends boofcv.struct.image.ImageBase<Input>,Output extends boofcv.struct.image.ImageBase<Output>>- Returns:
- render all flag
-
getModel
public boofcv.struct.distort.PixelTransform<georegression.struct.point.Point2D_F32> getModel()
Description copied from interface:ImageDistortReturns the distortion model.
-
-