I noticed that ippiQualityIndex may return a NaN for parameter pQualityIndex, even with comparing images that don't contain a NaN themselves. The result code is ippStsNoErr. I guess the cause is division by zero.
I suggest to return 0.0 rather than NaN in concerning cases.
Adriaan van Os
Hello Adriaan van Os,
I can't understand what do you mean return a NaN for parameter pQualityIndex. The range of values for the index Q is [-1, 1]. The best value 1 is achieved if and only if the images are identical.
I hope you understand what a NaN is and how they occur in software. If not, please read the IEEE-754 standard. As I already noted, the cause of the NaN is probably that the software is dividing by zero internally. But it could be something else.
To reproduce, I can provide two images for which ippiQualityIndex returns a NaN.
Adriaan van Os
Adriaan van Os，
Thanks for your explanation. And so sorry didn't back to your question for a long time because our website changed from Forum to Community.
Anyway, have you tested with our latest IPP version (2021.2)? If still have any question with our latest version, how about sending us your simple reproducer if you don't mind? Then it will help us investigate the issue.
We are closing the thread now and will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only. Thanks.