Main Content

niqeModel

Naturalness Image Quality Evaluator (NIQE) model

Description

A niqeModel object encapsulates a model used to calculate the Naturalness Image Quality Evaluator (NIQE) perceptual quality score of an image.

Creation

You can create a niqeModel object using the following methods:

  • fitniqe — Train a NIQE model with parameters derived from your image datastore. Use this function if you do not have a pretrained model.

  • The niqeModel function described here. Use this function if you have a pretrained NIQE model, or if the default model is sufficient for your application.

Description

example

m = niqeModel creates a NIQE model object with default property values that are derived from the pristine image database noted in [1].

example

m = niqeModel(mean,covariance,blockSize,sharpnessThreshold) creates a custom NIQE model and sets the Mean, Covariance, BlockSize, and SharpnessThreshold properties. You must provide all four arguments to create a custom model.

Properties

expand all

Mean of natural scene statistics (NSS) based image feature vectors, specified as a 36-element numeric row vector.

Example: rand(1,36)

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Covariance matrix of NSS-based image feature vectors, specified as a 36-by-36 numeric matrix.

Example: rand(36,36)

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Block size used to partition an image into nonoverlapping blocks, specified as a 2-element row vector of positive even integers. The two elements specify the number of rows and columns in each partition, respectively.

Example: [10 10]

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Sharpness threshold used to calculate feature vectors, specified as a real scalar in the range [0, 1]. The threshold determines which blocks are selected to calculate the feature vectors.

Example: 0.25

Data Types: single | double

Examples

collapse all

model = niqeModel
model = 
  niqeModel with properties:

                  Mean: [2.3167 0.7556 0.7429 0.0746 0.0951 0.1466 0.7509 0.0488 0.1082 0.1379 0.7694 -0.0182 0.1343 0.1194 0.7686 -0.0199 0.1343 0.1185 2.5733 0.7868 0.7772 0.0742 0.1062 0.1588 0.7894 0.0428 0.1221 0.1503 0.7998 ... ] (1x36 double)
            Covariance: [36x36 double]
             BlockSize: [96 96]
    SharpnessThreshold: 0

Create a niqeModel object using precomputed Mean, Covariance, BlockSize, and SharpnessThreshold properties. Random initializations are shown for illustrative purposes only.

 model = niqeModel(rand(1,36),rand(36,36),[10 10],0.25);

You can use the custom model to calculate the NIQE score for an image.

I = imread('lighthouse.png');
score = niqe(I,model)
score = 3.6866

References

[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.

Version History

Introduced in R2017b