Class ImageOps.Normalize
- Enclosing class:
ImageOps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
minMax()
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
sigmoid()
Replace Mat values by1.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.
-
Constructor Details
-
Normalize
public Normalize()
-
-
Method Details
-
minMax
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
Normalize the minimum and maximum values of the image to fall into the range 0 - 1.This method is applied per-channel.
- Returns:
-
percentile
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. 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:
-
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. Approximately100-percentileMin-percentileMax %
of the values then fall in the range 0-1.- Parameters:
percentileMin
- lower percentilepercentileMax
- upper percentileperChannel
- if true, each channel is normalized separately; if false, channels are normalized jointlyeps
- used to calculate the denominator (percentileMax - percentileMin + eps)- Returns:
-
channelSum
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
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
Replace Mat values by1.0/(1.0 + Math.exp(-value))
- Returns:
- Since:
- v0.3.1
-
zeroMeanUnitVariance
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
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 deviationeps
- added to the standard deviation before division, for numerical stability.- Returns:
- Since:
- v0.4.0
-
localNormalization
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 subtractionsigmaVariance
- sigma for Gaussian filter to use for local variance estimation- Returns:
-