MeasureGaussianNoise
Computes an estimation of a gaussian noise standard deviation in an image.
Access to parameter description
This algorithm filters the input image using a zero mean operator that is almost insensitive to image structures. The variance of the result is an estimate of the noise variance. The kernel for filtering the image is $$K = \begin{bmatrix} 1 & -2 & 1\\ -2 & 4 & -2\\ 1 & -2 & 1 \end{bmatrix} $$ which has a zero mean and variance of 36 times the image noise variance. In 2D, the variance of the noise $n$ contained in the image $I$ can then be estimated as $$ \sigma^2_n=\frac{1}{36(M-2)(N-2)}\sum^{M}_{i=1}\sum^{N}_{j=1}(I(i,j)\ast K)^2$$ where $M$ is the image height in pixels, $N$ the image width in pixels and $I(i,j)\ast K$ is the convolution of the image $I$ by the kernel $K$ at the position $(i,j)$.
Reference
J. Immerkoer, "Fast Noise Variance Estimation". Computer Vision and Image Understanding. vol. 64, no. 2, pp. 300-302, Sep. 1996.
See also
Access to parameter description
This algorithm filters the input image using a zero mean operator that is almost insensitive to image structures. The variance of the result is an estimate of the noise variance. The kernel for filtering the image is $$K = \begin{bmatrix} 1 & -2 & 1\\ -2 & 4 & -2\\ 1 & -2 & 1 \end{bmatrix} $$ which has a zero mean and variance of 36 times the image noise variance. In 2D, the variance of the noise $n$ contained in the image $I$ can then be estimated as $$ \sigma^2_n=\frac{1}{36(M-2)(N-2)}\sum^{M}_{i=1}\sum^{N}_{j=1}(I(i,j)\ast K)^2$$ where $M$ is the image height in pixels, $N$ the image width in pixels and $I(i,j)\ast K$ is the convolution of the image $I$ by the kernel $K$ at the position $(i,j)$.
Reference
J. Immerkoer, "Fast Noise Variance Estimation". Computer Vision and Image Understanding. vol. 64, no. 2, pp. 300-302, Sep. 1996.
See also
Function Syntax
This function returns outputMeasurement.
// Function prototype
GaussianNoiseMsr::Ptr measureGaussianNoise( std::shared_ptr< iolink::ImageView > inputImage, GaussianNoiseMsr::Ptr outputMeasurement = nullptr );
This function returns outputMeasurement.
// Function prototype. measure_gaussian_noise(input_image: idt.ImageType, output_measurement: Union[Any, None] = None) -> GaussianNoiseMsr
This function returns outputMeasurement.
// Function prototype. public static GaussianNoiseMsr MeasureGaussianNoise( IOLink.ImageView inputImage, GaussianNoiseMsr outputMeasurement = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | nullptr | |
outputMeasurement |
The output measurement result. | GaussianNoiseMsr | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
input_image |
The input image. | image | Binary, Label, Grayscale or Multispectral | None | |
output_measurement |
The output measurement result. | GaussianNoiseMsr | None |
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | null | |
outputMeasurement |
The output measurement result. | GaussianNoiseMsr | null |
Object Examples
auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); MeasureGaussianNoise measureGaussianNoiseAlgo; measureGaussianNoiseAlgo.setInputImage( polystyrene ); measureGaussianNoiseAlgo.execute(); std::cout << "standardDeviation: " << measureGaussianNoiseAlgo.outputMeasurement()->standardDeviation( 0 ) ;
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) measure_gaussian_noise_algo = imagedev.MeasureGaussianNoise() measure_gaussian_noise_algo.input_image = polystyrene measure_gaussian_noise_algo.execute() print("standardDeviation: ", str(measure_gaussian_noise_algo.output_measurement.standard_deviation(0)))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); MeasureGaussianNoise measureGaussianNoiseAlgo = new MeasureGaussianNoise { inputImage = polystyrene }; measureGaussianNoiseAlgo.Execute(); Console.WriteLine( "standardDeviation: " + measureGaussianNoiseAlgo.outputMeasurement.standardDeviation( 0 ) );
Function Examples
auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = measureGaussianNoise( polystyrene ); std::cout << "standardDeviation: " << result->standardDeviation( 0 ) ;
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) result = imagedev.measure_gaussian_noise(polystyrene) print("standardDeviation: ", str(result.standard_deviation(0)))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); GaussianNoiseMsr result = Processing.MeasureGaussianNoise( polystyrene ); Console.WriteLine( "standardDeviation: " + result.standardDeviation( 0 ) );