Class ImageOps
ImageOp and ImageDataOp objects.
 The Gson types in v0.2.0 are subject to change in later version. Specifically, each category will likely have an additional part to the subtype. This is currently the case with "core", but not other subtypes.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classChannel and color operations.static classCore operations.static classFiltering operations.static classMachine learning operations.static classNormalization operations.static classAbstractImageOpto simplify the process of handling padding.static classThresholding operations.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic ImageDataOpbuildImageDataOp(Collection<? extends ColorTransforms.ColorTransform> inputChannels) Create anImageDataOp, optionally using a specified collection of input channels.static ImageDataOpbuildImageDataOp(ColorTransforms.ColorTransform... inputChannels) Create anImageDataOp, optionally using a specified array of input channels.static ImageDataServer<BufferedImage> buildServer(ImageData<BufferedImage> imageData, ImageDataOp dataOp, PixelCalibration resolution) static ImageDataServer<BufferedImage> buildServer(ImageData<BufferedImage> imageData, ImageDataOp dataOp, PixelCalibration resolution, int tileWidth, int tileHeight) static MatpadAndApply(ImageOp op, Mat mat) Apply an op after adding symmetric (reflection) padding.static MatpadAndApply(ImageOp op, Mat mat, int padType) Apply an op after adding specified padding.static voidregisterDataOp(Class<? extends ImageDataOp> cls, String label) Register anImageDataOpclass for JSON serialization/deserialization.static voidregisterOp(Class<? extends ImageOp> cls, String label) Register anImageOpclass for JSON serialization/deserialization.
- 
Constructor Details- 
ImageOpspublic ImageOps()
 
- 
- 
Method Details- 
registerOpRegister anImageOpclass for JSON serialization/deserialization.Labels should typically be all lowercase and begin with "op." and include "ext" if the op is added via an extension. For example, an "op.threshold.ext.triangle" would be a suitable label for an op added via an extension to apply a threshold using the triangle method. - Parameters:
- cls- the op to register; this must be compatible with JSON serialization.
- label- an identifying label; that this must be unique. If it does not start with "op." a warning will be logged.
 
- 
registerDataOpRegister anImageDataOpclass for JSON serialization/deserialization.Labels should typically be all lowercase and begin with "data.op." and include "ext" if the op is added via an extension. - Parameters:
- cls- the op to register; this must be compatible with JSON serialization.
- label- an identifying label; that this must be unique. If it does not start with "data.op." a warning will be logged.
 
- 
buildServerpublic static ImageDataServer<BufferedImage> buildServer(ImageData<BufferedImage> imageData, ImageDataOp dataOp, PixelCalibration resolution) Build anImageServerthat generates pixels on demand from anImageDataby applying anImageDataOp.Warning! Because ImageDataare mutable, this can potentially result in inconsistencies if a change is made that impacts the behavior of the op while tiles are still being requested.- Parameters:
- imageData- the- ImageDatato wrap
- dataOp- the op performing pixel transformations
- resolution- the resolution at which the op should be applied
- Returns:
- the ImageDataServer
 
- 
buildServerpublic static ImageDataServer<BufferedImage> buildServer(ImageData<BufferedImage> imageData, ImageDataOp dataOp, PixelCalibration resolution, int tileWidth, int tileHeight) Build anImageServerthat generates pixels on demand from anImageDataby applying anImageDataOp.Warning! Because ImageDataare mutable, this can potentially result in inconsistencies if a change is made that impacts the behavior of the op while tiles are still being requested.- Parameters:
- imageData- the- ImageDatato wrap
- dataOp- the op performing pixel transformations
- resolution- the resolution at which the op should be applied
- tileWidth- the tile width for the server
- tileHeight- the tile height of the server
- Returns:
- the ImageDataServer
 
- 
buildImageDataOpCreate anImageDataOp, optionally using a specified array of input channels.- Parameters:
- inputChannels- array of- ColorTransforms.ColorTransformobjects used to extract the pixels that will form the channels of the output- Mat. If empty, the original image channels will be used.
- Returns:
- the ImageDataOp
 
- 
buildImageDataOppublic static ImageDataOp buildImageDataOp(Collection<? extends ColorTransforms.ColorTransform> inputChannels) Create anImageDataOp, optionally using a specified collection of input channels.- Parameters:
- inputChannels- array of- ColorTransforms.ColorTransformobjects used to extract the pixels that will form the channels of the output- Mat. If empty, the original image channels will be used.
- Returns:
- the ImageDataOp
 
- 
padAndApplyApply an op after adding specified padding.This is useful when applying padded ops to Mats directly, rather than via an ImageDataOp. Because the op will strip off any padding, callingop.apply(mat)directly often results in a smaller output than the input image. Using this method instead gives an output image that is the same size as the input.- Parameters:
- op- the op to apply
- mat- the image to process
- padType- the OpenCV boundary padding type
- Returns:
- the result of applying the op to the input image; note that this is often a modified version of the input image itself, since many ops work in-place.
- See Also:
 
- 
padAndApplyApply an op after adding symmetric (reflection) padding.This is useful when applying padded ops to Mats directly, rather than via an ImageDataOp. Because the op will strip off any padding, calling op.apply(mat) directly often results in a smaller output than the input image. Using this method instead gives an output image that is the same size as the input.- Parameters:
- op- the op to apply
- mat- the image to process
- Returns:
- the result of applying the op to the input image; note that this is often a modified version of the input image itself, since many ops work in-place.
 
 
-