QualityIndex

Computes the universal image quality index.

Syntax

Case 1: Operation on one-channel data

IppStatus ippiQualityIndex_<mod>(const Ipp<srcDatatype>* pSrc1, int src1Step, const Ipp<srcDatatype>* pSrc2, int src2Step, IppiSize roiSize, Ipp<dstDatatype>* pQualityIndex);

Supported values for mod:

8u32f_C1R

16u32f_C1R

32f_C1R

Case 2: Operation on multi-channel data

IppStatus ippiQualityIndex_<mod>(const Ipp<srcDatatype>* pSrc1, int src1Step, const Ipp<srcDatatype>* pSrc2, int src2Step, IppiSize roiSize, Ipp<dstDatatype> qualityIndex[3]);

Supported values for mod:

8u32f_C3R

16u32f_C3R

32f_C3R

8u32f_AC4R

16u32f_AC4R

32f_AC4R

Parameters

pSrc1, pSrc2

Pointers to the source images ROI.

src1Step, src2Step

Distance in bytes between starts of consecutive lines in the source images.

roiSize

Size of the source ROI in pixels.

pQualityIndex

Pointer to the computed quality index value.

qualityIndex

An array containing the computed quality index values for separate channels in case of multi-channel data.

Description

The function ippiQualityIndex is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP). This function computes the universal image quality index for two images pSrc1 and pSrc2 according to the formula in the introduction section above.The computed value of the index for one-channel image is stored in pQualityIndex. For multi-channel images, the quality index is computed separately for each channel and stored in the array qualityIndex.

Example “Using of the function ippiQualityIndex” shows how to use the function ippiQualityIndex_32f_C1R.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.

ippStsSizeErr

Indicates an error condition if roiSize has a field with zero or negative value.

ippStsStepErr

Indicates an error condition if src1Step or src2Step has a zero or negative value.

ippStsQualityIndexErr

Indicates an error condition if pixel values of one of the images are constatnt.

ippStsMemAllocErr

Indicates an error condition if memory allocation fails.

Using of the function ippiQualityIndex

void func_qualityindex()
{
    Ipp32f pSrc1[256*256];
    Ipp32f pSrc2[256*256];
    int src1Step = 256*sizeof(Ipp32f);
    int src2Step = 256*sizeof(Ipp32f);;
    Ipp32f pQIndex;
    IppiSize roiSize = {256,256};
    unsigned int pSeed = 3;

		
// creating reference image (image1) and distorted image (image2)
    ippiImageJaehne_32f_C1R(pSrc1, src1Step, roiSize); // image1
    ippiImageJaehne_32f_C1R(pSrc2, src2Step, roiSize); 
    ippiAddRandUniform_Direct_32f_C1IR(pSrc2, src2Step, roiSize, 0, 1, &pSeed);
//image2 = image1 + RandUniform

		
    ippiQualityIndex_32f_C1R(pSrc1, src1Step, pSrc2, src2Step, roiSize, 
                            
 &pQIndex);
}
 



Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.