Class ImageDistortBasic<Input extends ImageBase<Input>,​Output extends 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 ImageBase<Input>,​Output extends ImageBase<Output>,​Interpolate extends InterpolatePixel<Input>>
extends Object
implements ImageDistort<Input,​Output>
Most basic implementation of ImageDistort. 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 Details

  • Constructor Details

    • ImageDistortBasic

      protected ImageDistortBasic​(Interpolate interp)
      Specifies configuration parameters
      Parameters:
      interp - Interpolation algorithm
  • Method Details

    • setModel

      public void setModel​(PixelTransform<Point2D_F32> dstToSrc)
      Description copied from interface: ImageDistort
      Specifies how pixel coordinates are transformed from the destination to source images.
      Specified by:
      setModel in interface ImageDistort<Input extends ImageBase<Input>,​Output extends ImageBase<Output>>
      Parameters:
      dstToSrc - Pixel coordinate transformation.
    • apply

      public void apply​(Input srcImg, Output dstImg)
      Description copied from interface: ImageDistort
      Applies the transform to the entire destination image.
      Specified by:
      apply in interface ImageDistort<Input extends ImageBase<Input>,​Output extends ImageBase<Output>>
      Parameters:
      srcImg - (Input) Original image.
      dstImg - (Output) Distorted image.
    • apply

      public void apply​(Input srcImg, Output dstImg, GrayU8 mask)
      Description copied from interface: ImageDistort
      Applies 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
      Specified by:
      apply in interface ImageDistort<Input extends ImageBase<Input>,​Output extends ImageBase<Output>>
      Parameters:
      srcImg - (Input) Original image.
      dstImg - (Output) Distorted image.
      mask - (Output) Mask of inside pixels. Automatically resized to match dstImg.
    • apply

      public void apply​(Input srcImg, Output dstImg, int dstX0, int dstY0, int dstX1, int dstY1)
      Description copied from interface: ImageDistort
      Applies the transform to only the specified region inside the destination image.
      Specified by:
      apply in interface ImageDistort<Input extends ImageBase<Input>,​Output extends ImageBase<Output>>
      Parameters:
      srcImg - (Input) Original image.
      dstImg - (Output) Distorted image.
      dstX0 - Left most crop boundary. Inclusive.
      dstY0 - Top most crop boundary. Inclusive.
      dstX1 - Right most crop boundary. Exclusive.
      dstY1 - Bottom most crop boundary. Exclusive.
    • init

      protected void init​(Input srcImg, Output dstImg)
    • applyAll

      protected abstract void applyAll()
    • applyAll

      protected abstract void applyAll​(GrayU8 mask)
    • applyOnlyInside

      protected abstract void applyOnlyInside()
    • applyOnlyInside

      protected abstract void applyOnlyInside​(GrayU8 mask)
    • setRenderAll

      public void setRenderAll​(boolean renderAll)
      Description copied from interface: ImageDistort
      Specifies if the entire output image should be rendered, even if mapping to the source image is outside the source image.
      Specified by:
      setRenderAll in interface ImageDistort<Input extends ImageBase<Input>,​Output extends 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: ImageDistort
      Returns the render all flag
      Specified by:
      getRenderAll in interface ImageDistort<Input extends ImageBase<Input>,​Output extends ImageBase<Output>>
      Returns:
      render all flag
    • getModel

      public PixelTransform<Point2D_F32> getModel()
      Description copied from interface: ImageDistort
      Returns the distortion model.
      Specified by:
      getModel in interface ImageDistort<Input extends ImageBase<Input>,​Output extends ImageBase<Output>>
      Returns:
      model dst to src