Class ImageOps.Normalize

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

public static class ImageOps.Normalize extends Object
Normalization operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static ImageOp
    channelSoftmax(double maxValue)
    Apply softmax, with the specified output maxValue.
    static ImageOp
    channelSum(double maxValue)
    Normalize channels so that they sum to the specified value.
    static ImageOp
    localNormalization(double sigmaMean, double sigmaVariance)
    Apply local 2D normalization using Gaussian-weighted mean subtraction and (optionally) variance estimation.
    static ImageOp
    Normalize the minimum and maximum values of the image to fall into the range 0 - 1.
    static ImageOp
    minMax(double outputMin, double outputMax)
    Normalize the minimum and maximum values of the image to fall into the range 'outputMin - outputMax'.
    static ImageOp
    percentile(double percentileMin, double percentileMax)
    Normalize the image, per channel, using low and high percentiles.
    static ImageOp
    percentile(double percentileMin, double percentileMax, boolean perChannel, double eps)
    Normalize the image using low and high percentiles.
    static ImageOp
    Replace Mat values by 1.0/(1.0 + Math.exp(-value))
    static ImageOp
    zeroMeanUnitVariance(boolean perChannel)
    Normalize a Mat by subtracting the mean value and dividing by the standard deviation.
    static ImageOp
    zeroMeanUnitVariance(boolean perChannel, double eps)
    Normalize a Mat by subtracting the mean value and dividing by the standard deviation + eps.

    Methods inherited from class java.lang.Object

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

    • Normalize

      public Normalize()
  • Method Details

    • minMax

      public static ImageOp minMax(double outputMin, double outputMax)
      Normalize the minimum and maximum values of the image to fall into the range 'outputMin - outputMax'.

      This method is applied per-channel.

      Parameters:
      outputMin -
      outputMax -
      Returns:
    • minMax

      public static ImageOp minMax()
      Normalize the minimum and maximum values of the image to fall into the range 0 - 1.

      This method is applied per-channel.

      Returns:
    • percentile

      public static ImageOp percentile(double percentileMin, double percentileMax)
      Normalize the image, per channel, using low and high percentiles.

      This is similar to minMax(), but using low and high percentiles rather than minimum and maximum respectively. Approximately 100-percentileMin-percentileMax % of the values then fall in the range 0-1.

      This method is applied per-channel, with no eps added to the denominator if min and max are the same. See percentile(double, double, boolean, double) for more control.

      Parameters:
      percentileMin -
      percentileMax -
      Returns:
      See Also:
    • percentile

      public static ImageOp percentile(double percentileMin, double percentileMax, boolean perChannel, double eps)
      Normalize the image using low and high percentiles.

      This is similar to minMax(), but using low and high percentiles rather than minimum and maximum respectively. Approximately 100-percentileMin-percentileMax % of the values then fall in the range 0-1.

      Parameters:
      percentileMin - lower percentile
      percentileMax - upper percentile
      perChannel - if true, each channel is normalized separately; if false, channels are normalized jointly
      eps - used to calculate the denominator (percentileMax - percentileMin + eps)
      Returns:
    • channelSum

      public static ImageOp channelSum(double maxValue)
      Normalize channels so that they sum to the specified value.

      Note: negative values in the input are clipped to 0. NaNs may occur if the sum is zero.

      Parameters:
      maxValue - usually 1.0, but may be different (e.g. if the output should be 8-bit)
      Returns:
    • channelSoftmax

      public static ImageOp channelSoftmax(double maxValue)
      Apply softmax, with the specified output maxValue.
      Parameters:
      maxValue - usually 1.0, but may be different (e.g. if the output should be 8-bit)
      Returns:
    • sigmoid

      public static ImageOp sigmoid()
      Replace Mat values by 1.0/(1.0 + Math.exp(-value))
      Returns:
      Since:
      v0.3.1
    • zeroMeanUnitVariance

      public static ImageOp zeroMeanUnitVariance(boolean perChannel)
      Normalize a Mat by subtracting the mean value and dividing by the standard deviation.
      Parameters:
      perChannel - if true, normalize each channel separately; if false, use the global mean and standard deviation
      Returns:
      Since:
      v0.3.1
      See Also:
    • zeroMeanUnitVariance

      public static ImageOp zeroMeanUnitVariance(boolean perChannel, double eps)
      Normalize a Mat by subtracting the mean value and dividing by the standard deviation + eps.
      Parameters:
      perChannel - if true, normalize each channel separately; if false, use the global mean and standard deviation
      eps - added to the standard deviation before division, for numerical stability.
      Returns:
      Since:
      v0.4.0
    • localNormalization

      public static ImageOp localNormalization(double sigmaMean, double sigmaVariance)
      Apply local 2D normalization using Gaussian-weighted mean subtraction and (optionally) variance estimation.

      This method is applied per-channel.

      Parameters:
      sigmaMean - sigma for Gaussian filter to use for subtraction
      sigmaVariance - sigma for Gaussian filter to use for local variance estimation
      Returns: