Processing math: 100%
ImageDev

SsimValue3d

Computes the mean structural similarity (SSIM) index between two three-dimensional images.

Access to parameter description

This algorithm provides a measure of similarity by computing the SSIM value for each pixel of the couple of image and by returning the mean of all these values.
For each pixel, we compute the SSIM value by using the following formula :
SSIM(I1,I2)=(2μ1μ2+C1)(2σ12+C2)(μ21+μ22+C1)(σ21+σ22+C2)
Where: Reference:
Z. Wang, A.C. Bovik, H.R. Sheikh, and E.P. Simoncelli. "Image quality assessment: From error visibility to structural similarity". IEEE Transactions on Image Processing , vol. 13, pp. 600-612, Apr. 2004.

See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
SsimValueMsr::Ptr ssimValue3d( std::shared_ptr< iolink::ImageView > inputImage1, std::shared_ptr< iolink::ImageView > inputImage2, iolink::Vector3u32 tileSize, SsimValue3d::RangeMode rangeMode, double range, double k1, double k2, SsimValueMsr::Ptr outputMeasurement = nullptr );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage1
The first input image to compare. Image Grayscale nullptr
input
inputImage2
The second input image to compare. Image Binary, Label, Grayscale or Multispectral nullptr
input
tileSize
The X, Y and Z sizes, in pixels, of the tile used to compute the SSIM for each pixel. Vector3u32 >=1 {8, 8, 8}
input
rangeMode
The way to consider the dynamic range used to compute the regularization constants C1 and C2 of the similarity formula.
DATA_TYPE_RANGE The data range is determined by the theoretical maximum and minimum values of the data type.
OTHER The data range is user-defined by the range parameter.
Enumeration DATA_TYPE_RANGE
input
range
The data range used to compute the constants C1 and C2 of the similarity formula. It corresponds to the distance between the maximum and minimum of the representative image intensities. It is used only if rangeMode parameter is set to OTHER value. Float64 >0 255
input
k1
The small weight used to compute the regularization constant C1 of the similarity formula. Float64 >0 0.01
input
k2
The small weight used to compute the regularization constant C2 of the similarity formula. Float64 >0 0.03
output
outputMeasurement
The output measurement results containing the SSIM value. SsimValueMsr nullptr

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );
auto foam_gaussian_noise = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_gaussian_noise.vip" );

SsimValue3d ssimValue3dAlgo;
ssimValue3dAlgo.setInputImage1( foam );
ssimValue3dAlgo.setInputImage2( foam_gaussian_noise );
ssimValue3dAlgo.setTileSize( {6, 6, 6} );
ssimValue3dAlgo.setRangeMode( SsimValue3d::RangeMode::DATA_TYPE_RANGE );
ssimValue3dAlgo.setRange( 255 );
ssimValue3dAlgo.setK1( 0.01 );
ssimValue3dAlgo.setK2( 0.03 );
ssimValue3dAlgo.execute();

std::cout << "ssim: " << ssimValue3dAlgo.outputMeasurement()->ssim( 0 ) ;

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );
auto foam_gaussian_noise = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_gaussian_noise.vip" );

auto result = ssimValue3d( foam, foam_gaussian_noise, {6, 6, 6}, SsimValue3d::RangeMode::DATA_TYPE_RANGE, 255, 0.01, 0.03 );

std::cout << "ssim: " << result->ssim( 0 ) ;