Class ImageOps.Normalize
- Enclosing class:
- ImageOps
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic ImageOpchannelSoftmax(double maxValue) Apply softmax, with the specified output maxValue.static ImageOpchannelSum(double maxValue) Normalize channels so that they sum to the specified value.static ImageOplocalNormalization(double sigmaMean, double sigmaVariance) Apply local 2D normalization using Gaussian-weighted mean subtraction and (optionally) variance estimation.static ImageOplocalNormalizationMinMax(int radius, double sigma) Apply local 2D normalization using local min and max values, optionally smoothing with a Gaussian filter to reduce sharp edges.static ImageOpminMax()Normalize the minimum and maximum values of the image to fall into the range 0 - 1.static ImageOpminMax(double outputMin, double outputMax) Normalize the minimum and maximum values of the image to fall into the range 'outputMin - outputMax'.static ImageOppercentile(double percentileMin, double percentileMax) Normalize the image, per channel, using low and high percentiles.static ImageOppercentile(double percentileMin, double percentileMax, boolean perChannel, double eps) Normalize the image using low and high percentiles.static ImageOpsigmoid()Replace Mat values by1.0/(1.0 + Math.exp(-value))static ImageOpzeroMeanUnitVariance(boolean perChannel) Normalize a Mat by subtracting the mean value and dividing by the standard deviation.static ImageOpzeroMeanUnitVariance(boolean perChannel, double eps) Normalize a Mat by subtracting the mean value and dividing by the standard deviation + eps.
- 
Constructor Details- 
Normalizepublic Normalize()
 
- 
- 
Method Details- 
minMaxNormalize 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:
 
- 
minMaxNormalize the minimum and maximum values of the image to fall into the range 0 - 1.This method is applied per-channel. - Returns:
 
- 
percentileNormalize 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. Approximately100-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:
 
- 
percentilepublic 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. Approximately100-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:
 
- 
channelSumNormalize 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:
 
- 
channelSoftmaxApply 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:
 
- 
sigmoidReplace Mat values by1.0/(1.0 + Math.exp(-value))- Returns:
- Since:
- v0.3.1
 
- 
zeroMeanUnitVarianceNormalize 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:
- Implementation Note
- if the standard deviation is 0, the output is also 0. If the standard deviation is not finite, the output is NaN. This implementation may change if it proves problematic in the future.
 
- 
zeroMeanUnitVarianceNormalize 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
- Implementation Note
- if the standard deviation and eps are both 0, the output is also 0. If the standard deviation is not finite, the output is NaN. This implementation may change if it proves problematic in the future.
 
- 
localNormalizationApply 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:
 
- 
localNormalizationMinMaxApply local 2D normalization using local min and max values, optionally smoothing with a Gaussian filter to reduce sharp edges.This method is applied per-channel. - Parameters:
- radius- radius for the local min and max filters
- sigma- sigma for Gaussian filter to smooth the min and max filtered images
- Returns:
 
 
-