ImageDev

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:

<b> Figure 1.</b> The decorrelation stretching effect
Figure 1. The decorrelation stretching effect

See also

Function Syntax

This function returns the outputColorImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
decorrelationStretch2d( std::shared_ptr< iolink::ImageView > inputColorImage, std::shared_ptr< iolink::ImageView > outputColorImage = NULL );
This function returns the outputColorImage output parameter.
// Function prototype.
decorrelation_stretch_2d( input_color_image, output_color_image = None )
This function returns the outputColorImage output parameter.
// Function prototype.
public static IOLink.ImageView
DecorrelationStretch2d( IOLink.ImageView inputColorImage, IOLink.ImageView outputColorImage = null );

Class Syntax

Parameters

Class Name DecorrelationStretch2d

Parameter Name Description Type Supported Values Default Value
input
inputColorImage
The color input image. Image Multispectral nullptr
output
outputColorImage
The color output image. Its dimensions and type are forced to the same values as the input. Image nullptr

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() );