# niqe

## 说明

score = niqe(A) 使用自然图像质量评估方法 (NIQE) 计算图像 A 的无参考图像质量分数。niqeA 与基于自然场景图像计算的默认模型进行比较。分数越小，表示感知质量越好。

score = niqe(A,model) 使用自定义模型计算图像质量分数。

## 示例

Inoise = imnoise(I,'salt & pepper',0.02);
Iblur = imgaussfilt(I,2);

figure
montage({I,Inoise,Iblur},'Size',[1 3])
title('Original Image | Noisy Image | Blurry Image')

niqeI = niqe(I);
fprintf('NIQE score for original image is %0.4f.\n',niqeI)
NIQE score for original image is 2.5455.
niqeInoise = niqe(Inoise);
fprintf('NIQE score for noisy image is %0.4f.\n',niqeInoise)
NIQE score for noisy image is 10.8770.
niqeIblur = niqe(Iblur);
fprintf('NIQE score for blurry image is %0.4f.\n',niqeIblur)
NIQE score for blurry image is 5.2661.

setDir = fullfile(toolboxdir('images'),'imdata');
imds = imageDatastore(setDir,'FileExtensions',{'.jpg'});

model = fitniqe(imds);
Extracting features from 33 images.
....
Completed 14 of 33 images.  Time: Calculating...
..
Done.

imshow(I)

niqeI = niqe(I,model);
fprintf('NIQE score for the image is %0.4f.\n',niqeI)
NIQE score for the image is 2.6700.

## 算法

NIQE 测量从图像 A 计算得到的基于 NSS 的特征与从训练模型的图像数据库得到的特征之间的距离。这些特征建模为多维高斯分布。

## 参考

[1] Mittal, A., R. Soundararajan, and A. C. Bovik. "Making a Completely Blind Image Quality Analyzer." IEEE Signal Processing Letters. Vol. 22, Number 3, March 2013, pp. 209–212.