Class ImageOps.PaddedOp

java.lang.Object
qupath.opencv.ops.ImageOps.PaddedOp
All Implemented Interfaces:
UriResource, ImageOp
Enclosing class:
ImageOps

public abstract static class ImageOps.PaddedOp extends Object implements ImageOp
Abstract ImageOp to simplify the process of handling padding.
  • Constructor Details

    • PaddedOp

      public PaddedOp()
  • Method Details

    • calculatePadding

      protected abstract Padding calculatePadding()
      Calculate the required padding.
      Returns:
    • transformPadded

      protected abstract Mat transformPadded(Mat input)
      Transform, but ignoring padding. Non-empty padding will be removed automatically elsewhere.
      Parameters:
      input -
      Returns:
    • apply

      public Mat apply(Mat input)
      Description copied from interface: ImageOp
      Apply operation to the image. The input may be modified (and the operation applied in-place), therefore should be duplicated if a copy is required to be kept.

      Note that any non-empty padding will be removed, potentially giving an output image smaller than the input. If this is not desirable use ImageOps.padAndApply(ImageOp, Mat).

      Specified by:
      apply in interface ImageOp
      Parameters:
      input - input image
      Returns:
      output image, which may be the same as the input image
      See Also:
    • getPadding

      public Padding getPadding()
      Description copied from interface: ImageOp
      Get the padding requested for this operation. The default is to return Padding.empty().

      Subclasses that perform neighborhood operations should override this. If the padding is non-empty, it will be removed when ImageOp.apply(Mat) is called - and so the Mat that is output will be smaller than the Mat that was input.

      Specified by:
      getPadding in interface ImageOp
      Returns:
      the padding requested by this operation