SynthShapes.hist
MatchHistogram
Bases: Module
Histogram Matching Module to map the intensity values of an image to follow a normal distribution.
| PARAMETER | DESCRIPTION |
|---|---|
mean
|
Mean of the normal distribution, by default 0.0.
TYPE:
|
std
|
Standard deviation of the normal distribution, by default 0.2.
TYPE:
|
num_bins
|
Number of bins for histogram, by default 256.
TYPE:
|
Source code in SynthShapes/hist.py
calculate_cdf
Calculate the cumulative distribution function (CDF) for a histogram.
forward
Forward pass to perform histogram matching.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
Source image (HxW), normalized between -1 and 1.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
matched
|
The transformed source image with histogram matching a normal distribution.
TYPE:
|