Class ImageOps.Core

java.lang.Object
qupath.opencv.ops.ImageOps.Core
Enclosing class:
ImageOps

public static class ImageOps.Core extends Object
Core operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static ImageOp
    add(double... values)
    Add a constant to all pixels.
    static ImageOp
    Create an op that ceils floating point values.
    static ImageOp
    clip(double min, double max)
    Create an op that clips Mat values to the specified minimum and maximum.
    static ImageOp
    divide(double... values)
    Divide all pixels by a constant.
    static ImageOp
    Convert the Mat to match a specified pixel type.
    static ImageOp
    exp()
    Create an op that returns Euler's number e raise to the power of the Mat values.
    static ImageOp
    Create an op that floors floating point values.
    static ImageOp
    Create an op that returns its input unchanged.
    static ImageOp
    log()
    Create an op that returns the natural logarithm of values.
    static ImageOp
    multiply(double... values)
    Multiply all pixels by a constant.
    static ImageOp
    power(double value)
    Raise every pixel element to a power.
    static ImageOp
    replace(double originalValue, double newValue)
    Create an op that replaces one pixel value in an image with another.
    static ImageOp
    replaceNaNs(double replaceValue)
    Create an op that replaces NaNs with a specified value.
    static ImageOp
    Create an op that rounds floating point values.
    static ImageOp
    sequential(Collection<? extends ImageOp> ops)
    Apply a collection of ops sequentially, chaining the output of one op as the input for the next.
    static ImageOp
    Apply an array of ops sequentially, chaining the output of one op as the input for the next.
    static ImageOp
    splitAdd(ImageOp opLeft, ImageOp opRight)
    Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by adding corresponding values.
    static ImageOp
    splitDivide(ImageOp opTop, ImageOp opBottom)
    Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by dividing corresponding values.
    static ImageOp
    splitMerge(Collection<? extends ImageOp> ops)
    Create an op that applies all the specified ops to the input Mat, concatenating the results as channels of the output.
    static ImageOp
    Create an op that applies all the specified ops to the input Mat, concatenating the results as channels of the output.
    static ImageOp
    splitMultiply(ImageOp opLeft, ImageOp opRight)
    Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by multiplying corresponding values.
    static ImageOp
    splitSubtract(ImageOp opLeft, ImageOp opRight)
    Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by subtracting corresponding values.
    static ImageOp
    Calculate the square root of all pixel values.
    static ImageOp
    subtract(double... values)
    Subtract a constant from all pixels.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Core

      public Core()
  • Method Details

    • ensureType

      public static ImageOp ensureType(PixelType type)
      Convert the Mat to match a specified pixel type.
      Parameters:
      type - the pixel type that the Mat should be converted to
      Returns:
    • multiply

      public static ImageOp multiply(double... values)
      Multiply all pixels by a constant.
      Parameters:
      values - either a single value to apply to all channels, or an array of Mat.channels() values.
      Returns:
    • divide

      public static ImageOp divide(double... values)
      Divide all pixels by a constant.
      Parameters:
      values - either a single value to apply to all channels, or an array of Mat.channels() values.
      Returns:
    • add

      public static ImageOp add(double... values)
      Add a constant to all pixels.
      Parameters:
      values - either a single value to apply to all channels, or an array of Mat.channels() values.
      Returns:
    • subtract

      public static ImageOp subtract(double... values)
      Subtract a constant from all pixels.
      Parameters:
      values - either a single value to apply to all channels, or an array of Mat.channels() values.
      Returns:
    • power

      public static ImageOp power(double value)
      Raise every pixel element to a power.
      Parameters:
      value -
      Returns:
    • sqrt

      public static ImageOp sqrt()
      Calculate the square root of all pixel values.
      Returns:
    • sequential

      public static ImageOp sequential(Collection<? extends ImageOp> ops)
      Apply a collection of ops sequentially, chaining the output of one op as the input for the next.
      Parameters:
      ops -
      Returns:
      an op that represents the result of chaining the other ops together
    • sequential

      public static ImageOp sequential(ImageOp... ops)
      Apply an array of ops sequentially, chaining the output of one op as the input for the next.
      Parameters:
      ops -
      Returns:
      an op that represents the result of chaining the other ops together
    • splitMerge

      public static ImageOp splitMerge(Collection<? extends ImageOp> ops)
      Create an op that applies all the specified ops to the input Mat, concatenating the results as channels of the output.
      Parameters:
      ops -
      Returns:
      a single op that combines all other ops by split and merge
    • splitMerge

      public static ImageOp splitMerge(ImageOp... ops)
      Create an op that applies all the specified ops to the input Mat, concatenating the results as channels of the output.
      Parameters:
      ops -
      Returns:
      a single op that combines all other ops by split and merge
    • identity

      public static ImageOp identity()
      Create an op that returns its input unchanged. This is useful where an op is required, but no processing should be performed (e.g. with splitSubtract(ImageOp, ImageOp)).
      Returns:
    • exp

      public static ImageOp exp()
      Create an op that returns Euler's number e raise to the power of the Mat values.
      Returns:
    • log

      public static ImageOp log()
      Create an op that returns the natural logarithm of values.
      Returns:
    • round

      public static ImageOp round()
      Create an op that rounds floating point values. Non-finite input values are left unchanged.
      Returns:
    • floor

      public static ImageOp floor()
      Create an op that floors floating point values. Non-finite input values are left unchanged.
      Returns:
    • ceil

      public static ImageOp ceil()
      Create an op that ceils floating point values. Non-finite input values are left unchanged.
      Returns:
    • replaceNaNs

      public static ImageOp replaceNaNs(double replaceValue)
      Create an op that replaces NaNs with a specified value.
      Parameters:
      replaceValue - the value to replace NaNs
      Returns:
    • replace

      public static ImageOp replace(double originalValue, double newValue)
      Create an op that replaces one pixel value in an image with another.
      Parameters:
      originalValue - the value in the input image to replace
      newValue - the value to use in the output image
      Returns:
    • splitAdd

      public static ImageOp splitAdd(ImageOp opLeft, ImageOp opRight)
      Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by adding corresponding values.
      Parameters:
      opLeft - op to apply to first duplicate
      opRight - op to apply to second duplicate
      Returns:
      new split-combine op
    • splitSubtract

      public static ImageOp splitSubtract(ImageOp opLeft, ImageOp opRight)
      Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by subtracting corresponding values.
      Parameters:
      opLeft - op to apply to first duplicate
      opRight - op to apply to second duplicate
      Returns:
      new split-combine op
    • splitMultiply

      public static ImageOp splitMultiply(ImageOp opLeft, ImageOp opRight)
      Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by multiplying corresponding values.
      Parameters:
      opLeft - op to apply to first duplicate
      opRight - op to apply to second duplicate
      Returns:
      new split-combine op
    • splitDivide

      public static ImageOp splitDivide(ImageOp opTop, ImageOp opBottom)
      Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by dividing corresponding values.
      Parameters:
      opTop - op to apply to first duplicate
      opBottom - op to apply to second duplicate
      Returns:
      new split-combine op
    • clip

      public static ImageOp clip(double min, double max)
      Create an op that clips Mat values to the specified minimum and maximum.
      Parameters:
      min -
      max -
      Returns:
      Since:
      v0.3.1