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:
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
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:
- μ1 is the mean in the tile arround the current pixel in the image I1,
- μ2 is the mean in the tile arround the current pixel in the image I2,
- σ1 is the standard deviation in the tile arround the current pixel in the image I1,
- σ2 is the standard deviation in the tile arround the current pixel in the image I2,
- σ12 is the covariance in the tile arround the current pixel in each image I1 and I2
- C1 is a constant computed with the choosen range R and the parameter k1 as follow : C1=(k1R)2
- C2 is a constant computed with the choosen range R and the parameter k2 as follow : C2=(k2R)2
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 | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
inputImage1 |
The first input image to compare. | Image | Grayscale | nullptr | ||||
![]() |
inputImage2 |
The second input image to compare. | Image | Binary, Label, Grayscale or Multispectral | nullptr | ||||
![]() |
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} | ||||
![]() |
rangeMode |
The way to consider the dynamic range used to compute the regularization constants C1 and C2 of the similarity formula.
|
Enumeration | DATA_TYPE_RANGE | |||||
![]() |
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 | ||||
![]() |
k1 |
The small weight used to compute the regularization constant C1 of the similarity formula. | Float64 | >0 | 0.01 | ||||
![]() |
k2 |
The small weight used to compute the regularization constant C2 of the similarity formula. | Float64 | >0 | 0.03 | ||||
![]() |
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 ) ;