Package qupath.opencv.ops
Class ImageOps.PaddedOp
java.lang.Object
qupath.opencv.ops.ImageOps.PaddedOp
- All Implemented Interfaces:
UriResource
,ImageOp
- Enclosing class:
- ImageOps
Abstract
ImageOp
to simplify the process of handling padding.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApply operation to the image.protected abstract Padding
Calculate the required padding.Get the padding requested for this operation.protected abstract Mat
transformPadded
(Mat input) Transform, but ignoring padding.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface qupath.opencv.ops.ImageOp
getChannels, getOutputType, getURIs, updateURIs
Methods inherited from interface qupath.lib.io.UriResource
getUris, updateUris
-
Constructor Details
-
PaddedOp
public PaddedOp()
-
-
Method Details
-
calculatePadding
Calculate the required padding.- Returns:
-
transformPadded
Transform, but ignoring padding. Non-empty padding will be removed automatically elsewhere.- Parameters:
input
-- Returns:
-
apply
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)
. -
getPadding
Description copied from interface:ImageOp
Get the padding requested for this operation. The default is to returnPadding.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 theMat
that is output will be smaller than theMat
that was input.- Specified by:
getPadding
in interfaceImageOp
- Returns:
- the padding requested by this operation
-