DecorrelationStretch2d
Enhances the color differences found in a color image.
Access to parameter description
This algorithm maximizes (stretches) the difference between different bands of data, by trying to remove the inter-bands correlation found in the input pixels.
By using eigenvectors and a covariance matrix, the data is "rotated" into a new space where the values are then maximized, and returned to the original space.
The transformation matrix $T$ applied at each pixel is composed from a rotation matrix $R$ and a stretching vector $s$:
$T = R^tsR$
Where $R$ denotes the matrix of eigenvectors and $s$ is formed by taking the reciprocal of the square root of each element in the eigenvalue vector and by multiplying it by the desired standard deviation for the output image bands.
Decorrelation stretching is a process that is usually used to enhance the color differences found in a color image.
The input image must reach the two following conditions:
Figure 1. The decorrelation stretching effect
See also
Access to parameter description
This algorithm maximizes (stretches) the difference between different bands of data, by trying to remove the inter-bands correlation found in the input pixels.
By using eigenvectors and a covariance matrix, the data is "rotated" into a new space where the values are then maximized, and returned to the original space.
The transformation matrix $T$ applied at each pixel is composed from a rotation matrix $R$ and a stretching vector $s$:
$T = R^tsR$
Where $R$ denotes the matrix of eigenvectors and $s$ is formed by taking the reciprocal of the square root of each element in the eigenvalue vector and by multiplying it by the desired standard deviation for the output image bands.
Decorrelation stretching is a process that is usually used to enhance the color differences found in a color image.
The input image must reach the two following conditions:
- In one band, at least one pixel value has to be different than other pixel values.
- For each pixel, the value in one band cannot be a linear combination of the values in the other bands.
Figure 1. The decorrelation stretching effect
See also
Function Syntax
This function returns outputColorImage.
// Function prototype
std::shared_ptr< iolink::ImageView > decorrelationStretch2d( std::shared_ptr< iolink::ImageView > inputColorImage, std::shared_ptr< iolink::ImageView > outputColorImage = NULL );
This function returns outputColorImage.
// Function prototype. decorrelation_stretch_2d( input_color_image, output_color_image = None )
This function returns outputColorImage.
// Function prototype. public static IOLink.ImageView DecorrelationStretch2d( IOLink.ImageView inputColorImage, IOLink.ImageView outputColorImage = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
inputColorImage |
The color input image. | Image | Multispectral | nullptr | |
outputColorImage |
The color output image. Its dimensions and type are forced to the same values as the input. | Image | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
input_color_image |
The color input image. | image | Multispectral | None | |
output_color_image |
The color output image. Its dimensions and type are forced to the same values as the input. | image | None |
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
inputColorImage |
The color input image. | Image | Multispectral | null | |
outputColorImage |
The color output image. Its dimensions and type are forced to the same values as the input. | Image | null |
Object Examples
std::shared_ptr< iolink::ImageView > ateneub = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "ateneub.jpg" ); DecorrelationStretch2d decorrelationStretch2dAlgo; decorrelationStretch2dAlgo.setInputColorImage( ateneub ); decorrelationStretch2dAlgo.execute(); std::cout << "outputColorImage:" << decorrelationStretch2dAlgo.outputColorImage()->toString();
ateneub = ioformat.read_image(imagedev_data.get_image_path("ateneub.jpg")) decorrelation_stretch_2d_algo = imagedev.DecorrelationStretch2d() decorrelation_stretch_2d_algo.input_color_image = ateneub decorrelation_stretch_2d_algo.execute() print( "output_color_image:", str( decorrelation_stretch_2d_algo.output_color_image ) )
ImageView ateneub = ViewIO.ReadImage( @"Data/images/ateneub.jpg" ); DecorrelationStretch2d decorrelationStretch2dAlgo = new DecorrelationStretch2d { inputColorImage = ateneub }; decorrelationStretch2dAlgo.Execute(); Console.WriteLine( "outputColorImage:" + decorrelationStretch2dAlgo.outputColorImage.ToString() );
Function Examples
std::shared_ptr< iolink::ImageView > ateneub = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "ateneub.jpg" ); auto result = decorrelationStretch2d( ateneub ); std::cout << "outputColorImage:" << result->toString();
ateneub = ioformat.read_image(imagedev_data.get_image_path("ateneub.jpg")) result = imagedev.decorrelation_stretch_2d( ateneub ) print( "output_color_image:", str( result ) )
ImageView ateneub = ViewIO.ReadImage( @"Data/images/ateneub.jpg" ); IOLink.ImageView result = Processing.DecorrelationStretch2d( ateneub ); Console.WriteLine( "outputColorImage:" + result.ToString() );