├── C++ code ├── NIQE.sln └── NIQE │ ├── NIQE.vcxproj │ ├── NIQE.vcxproj.filters │ ├── cov.txt │ ├── main.cpp │ ├── mu.txt │ ├── niqe.cpp │ └── niqe.h ├── MATLAB code ├── computefeature.m ├── computemean.m ├── computequality.m ├── cov.txt ├── estimate.m ├── estimateaggdparam.m ├── estimatemodelparam.m ├── example.m ├── modelparameters.mat ├── modelparameters_new.mat ├── mu.txt └── readme.txt ├── NIQE.pdf └── README.md /C++ code/NIQE.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NIQE", "NIQE\NIQE.vcxproj", "{A5A4B44E-77C0-460B-B97A-DE68B52FB5F8}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {A5A4B44E-77C0-460B-B97A-DE68B52FB5F8}.Debug|x64.ActiveCfg = Debug|x64 17 | {A5A4B44E-77C0-460B-B97A-DE68B52FB5F8}.Debug|x64.Build.0 = Debug|x64 18 | {A5A4B44E-77C0-460B-B97A-DE68B52FB5F8}.Debug|x86.ActiveCfg = Debug|Win32 19 | {A5A4B44E-77C0-460B-B97A-DE68B52FB5F8}.Debug|x86.Build.0 = Debug|Win32 20 | {A5A4B44E-77C0-460B-B97A-DE68B52FB5F8}.Release|x64.ActiveCfg = Release|x64 21 | {A5A4B44E-77C0-460B-B97A-DE68B52FB5F8}.Release|x64.Build.0 = Release|x64 22 | {A5A4B44E-77C0-460B-B97A-DE68B52FB5F8}.Release|x86.ActiveCfg = Release|Win32 23 | {A5A4B44E-77C0-460B-B97A-DE68B52FB5F8}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /C++ code/NIQE/NIQE.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {A5A4B44E-77C0-460B-B97A-DE68B52FB5F8} 23 | Win32Proj 24 | NIQE 25 | 8.1 26 | 27 | 28 | 29 | Application 30 | true 31 | v140 32 | Unicode 33 | 34 | 35 | Application 36 | false 37 | v140 38 | true 39 | Unicode 40 | 41 | 42 | Application 43 | true 44 | v140 45 | Unicode 46 | 47 | 48 | Application 49 | false 50 | v140 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | true 74 | 75 | 76 | true 77 | 78 | 79 | false 80 | 81 | 82 | false 83 | 84 | 85 | 86 | 87 | 88 | Level3 89 | Disabled 90 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 91 | true 92 | 93 | 94 | Console 95 | true 96 | 97 | 98 | 99 | 100 | 101 | 102 | Level3 103 | Disabled 104 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 105 | true 106 | 107 | 108 | Console 109 | true 110 | 111 | 112 | 113 | 114 | Level3 115 | 116 | 117 | MaxSpeed 118 | true 119 | true 120 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 121 | true 122 | 123 | 124 | Console 125 | true 126 | true 127 | true 128 | 129 | 130 | 131 | 132 | Level3 133 | 134 | 135 | Disabled 136 | true 137 | true 138 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 139 | true 140 | 141 | 142 | Console 143 | true 144 | true 145 | true 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /C++ code/NIQE/NIQE.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 26 | 27 | 头文件 28 | 29 | 30 | -------------------------------------------------------------------------------- /C++ code/NIQE/cov.txt: -------------------------------------------------------------------------------- 1 | 8.9973547e-02 8.2646005e-03 1.2119640e-02 4.2838275e-03 1.1746581e-03 5.7534768e-03 1.5351937e-02 2.0909003e-03 2.6822205e-03 5.6967668e-03 1.1947724e-02 3.9998450e-03 2.0394879e-03 5.2619149e-03 1.6135021e-02 8.8329890e-04 4.6000260e-03 4.6090855e-03 1.5309367e-01 1.4190385e-02 1.6701929e-02 4.1453371e-03 4.8998809e-03 1.0973868e-02 2.1323420e-02 -1.5147250e-05 8.8600428e-03 9.4941000e-03 1.3410027e-02 2.2231951e-03 5.5435744e-03 9.4286614e-03 1.8014842e-02 -3.3283008e-03 1.1545130e-02 6.2631275e-03 2 | 8.2646005e-03 3.9265776e-03 1.8475480e-03 5.2602759e-04 9.0583049e-04 1.4728265e-03 2.0552255e-03 1.9424246e-04 1.0893525e-03 1.4619494e-03 1.8759288e-03 -2.9042220e-04 1.3590220e-03 1.2395225e-03 1.8541994e-03 1.9823337e-04 1.2247058e-03 1.3170496e-03 1.1850671e-02 4.5531496e-03 1.8090385e-03 4.0937341e-05 1.2510115e-03 1.5798427e-03 1.8860438e-03 -1.7628276e-04 1.5321902e-03 1.5314791e-03 1.7644192e-03 -1.3317860e-03 2.0009954e-03 1.2644938e-03 1.6906429e-03 -2.9093502e-04 1.7410948e-03 1.3865205e-03 3 | 1.2119640e-02 1.8475480e-03 2.6786142e-03 4.6149901e-04 5.6289509e-04 1.2664425e-03 2.6250588e-03 7.1345530e-04 5.2353555e-04 1.2651679e-03 2.3507746e-03 4.4613992e-04 6.8334834e-04 1.0198119e-03 2.7167030e-03 3.2720758e-04 8.4628937e-04 1.0287916e-03 1.8353136e-02 2.5394144e-03 3.5038325e-03 -2.4723449e-04 1.4910884e-03 1.8654877e-03 3.3305438e-03 6.7223131e-04 1.3084987e-03 1.9043418e-03 2.3884512e-03 -1.6521157e-04 1.3752284e-03 1.3984833e-03 2.8557160e-03 -2.1470734e-05 1.6774318e-03 1.3732023e-03 4 | 4.2838275e-03 5.2602759e-04 4.6149901e-04 8.4597437e-04 -1.4428456e-04 3.5359606e-04 7.9360238e-04 1.7988107e-04 1.0699412e-04 2.8377283e-04 7.3266667e-04 3.7483674e-04 9.1526081e-05 3.2761466e-04 8.0803316e-04 2.8572084e-04 1.5317160e-04 2.9934968e-04 4.1104079e-03 1.4391519e-03 6.8489863e-05 8.0591411e-04 -2.4228582e-05 4.6229380e-04 4.8403286e-04 -5.2092408e-04 5.5910255e-04 2.5941643e-04 3.8704458e-04 -2.6594700e-04 4.7406163e-04 3.8520212e-04 4.0065877e-04 -1.8244149e-04 5.1042507e-04 3.1402409e-04 5 | 1.1746581e-03 9.0583049e-04 5.6289509e-04 -1.4428456e-04 3.4528964e-04 3.6501175e-04 4.4641365e-04 5.0247205e-05 2.8068335e-04 3.7794793e-04 3.9958779e-04 -1.8302624e-04 3.7245036e-04 2.7048735e-04 3.8565581e-04 -2.8314225e-05 3.1951329e-04 3.0915261e-04 2.5171446e-03 7.6728227e-04 8.3004355e-04 -3.3853229e-04 4.9461646e-04 4.0116458e-04 6.4506265e-04 2.0018986e-04 3.0448625e-04 4.7858151e-04 5.3485591e-04 -2.5700791e-04 4.6236653e-04 2.7724088e-04 5.3729575e-04 5.1718157e-05 3.5802931e-04 3.7528992e-04 6 | 5.7534768e-03 1.4728265e-03 1.2664425e-03 3.5359606e-04 3.6501175e-04 7.6650233e-04 1.3423626e-03 2.2421342e-04 4.3999787e-04 7.3898919e-04 1.1676316e-03 9.8180745e-05 5.2235700e-04 6.1768946e-04 1.3027631e-03 1.3573192e-04 5.6220412e-04 6.3190252e-04 8.6017573e-03 1.8776446e-03 1.5156912e-03 8.0761816e-05 7.1343101e-04 9.9375771e-04 1.5753594e-03 1.5030959e-05 8.4793561e-04 9.4750142e-04 1.1669588e-03 -3.3731491e-04 8.9475457e-04 7.5010848e-04 1.3042996e-03 -7.5199569e-05 9.4296445e-04 7.5885124e-04 7 | 1.5351937e-02 2.0552255e-03 2.6250588e-03 7.9360238e-04 4.4641365e-04 1.3423626e-03 3.3317262e-03 3.0207313e-04 7.7841412e-04 1.3884256e-03 2.5696035e-03 5.3638368e-04 7.0130358e-04 1.1407337e-03 3.1412598e-03 1.7682946e-04 1.0240624e-03 1.0777566e-03 2.4627039e-02 2.7959416e-03 3.4878809e-03 7.7657580e-04 1.1745348e-03 2.1780267e-03 4.2803118e-03 -9.7749788e-05 1.8519362e-03 2.0245653e-03 2.6832250e-03 1.0564937e-04 1.3501859e-03 1.6981431e-03 3.3027122e-03 -2.0483781e-04 2.0048841e-03 1.4099590e-03 8 | 2.0909003e-03 1.9424246e-04 7.1345530e-04 1.7988107e-04 5.0247205e-05 2.2421342e-04 3.0207313e-04 1.0040316e-03 -2.5458512e-04 3.1515775e-04 6.9203631e-04 3.4250540e-04 5.6887989e-05 2.3257089e-04 5.6328639e-04 4.9889353e-04 -4.3783840e-05 2.7631762e-04 -4.4180805e-04 8.9144193e-04 6.6399268e-04 -1.0442379e-03 6.8647244e-04 1.7547638e-04 -2.9273378e-04 1.0145526e-03 -2.0811688e-04 3.9043219e-04 2.7975212e-04 -4.3151257e-04 4.8089035e-04 1.6073342e-04 2.3186920e-04 7.1337978e-05 2.4182405e-04 3.5263135e-04 9 | 2.6822205e-03 1.0893525e-03 5.2353555e-04 1.0699412e-04 2.8068335e-04 4.3999787e-04 7.7841412e-04 -2.5458512e-04 4.5389718e-04 4.2312768e-04 4.8929097e-04 -1.4035239e-04 3.9873279e-04 3.4786523e-04 5.9263564e-04 -1.3436350e-04 4.3928302e-04 3.4261620e-04 5.5323021e-03 1.0140043e-03 7.4242592e-04 3.5465842e-04 2.6419972e-04 5.8607595e-04 1.1157049e-03 -3.4685717e-04 6.5137806e-04 5.0661899e-04 6.6822211e-04 -1.2406761e-04 4.6565898e-04 4.4431414e-04 7.5167031e-04 -9.3629945e-05 5.5820479e-04 3.9011634e-04 10 | 5.6967668e-03 1.4619494e-03 1.2651679e-03 2.8377283e-04 3.7794793e-04 7.3898919e-04 1.3884256e-03 3.1515775e-04 4.2312768e-04 7.8571031e-04 1.2078164e-03 8.3347546e-05 5.3564518e-04 6.1783613e-04 1.2981877e-03 1.7381378e-04 5.4294178e-04 6.4232008e-04 8.2582308e-03 1.8182630e-03 1.5865272e-03 -1.2608064e-04 8.1051351e-04 9.6138478e-04 1.5267014e-03 2.0273294e-04 7.6949402e-04 9.9546869e-04 1.1719049e-03 -3.8496915e-04 9.1762778e-04 7.2842280e-04 1.2872576e-03 -1.5859726e-05 9.1007129e-04 7.7783315e-04 11 | 1.1947724e-02 1.8759288e-03 2.3507746e-03 7.3266667e-04 3.9958779e-04 1.1676316e-03 2.5696035e-03 6.9203631e-04 4.8929097e-04 1.2078164e-03 2.5760678e-03 3.3019953e-04 7.6253823e-04 1.0165116e-03 2.5295425e-03 6.0739143e-04 6.9391449e-04 1.0350527e-03 1.5034312e-02 2.8082233e-03 2.5682412e-03 1.3558167e-04 1.1683896e-03 1.5894972e-03 2.6737461e-03 3.8110277e-04 1.2383856e-03 1.6221602e-03 2.1995700e-03 -7.8283308e-04 1.5630033e-03 1.1786558e-03 2.2466091e-03 2.8583690e-04 1.3777423e-03 1.3184234e-03 12 | 3.9998450e-03 -2.9042220e-04 4.4613992e-04 3.7483674e-04 -1.8302624e-04 9.8180745e-05 5.3638368e-04 3.4250540e-04 -1.4035239e-04 8.3347546e-05 3.3019953e-04 1.0572881e-03 -3.9282725e-04 2.5168566e-04 1.0194492e-03 -3.9032439e-04 2.2337001e-04 2.6103598e-06 5.8953135e-03 3.0010750e-04 7.4546793e-04 2.4501149e-04 1.2136791e-04 4.4897079e-04 8.5158895e-04 2.0632137e-04 2.4136689e-04 3.7372450e-04 3.3147667e-04 1.4240465e-03 -3.5133822e-04 6.6958780e-04 1.2154581e-03 -1.4032063e-03 9.9981081e-04 -1.2431301e-05 13 | 2.0394879e-03 1.3590220e-03 6.8334834e-04 9.1526081e-05 3.7245036e-04 5.2235700e-04 7.0130358e-04 5.6887989e-05 3.9873279e-04 5.3564518e-04 7.6253823e-04 -3.9282725e-04 6.1346718e-04 3.8505736e-04 4.7160394e-04 2.6994762e-04 3.3644514e-04 4.9352018e-04 2.3194599e-03 1.4275039e-03 6.5173499e-04 -1.3133517e-04 5.0326119e-04 4.7604249e-04 5.7789167e-04 -1.5515919e-05 4.7460511e-04 5.2415268e-04 6.6818033e-04 -9.5180639e-04 8.8107250e-04 2.4412508e-04 3.3661872e-04 4.8275935e-04 2.7081753e-04 5.7214264e-04 14 | 5.2619149e-03 1.2395225e-03 1.0198119e-03 3.2761466e-04 2.7048735e-04 6.1768946e-04 1.1407337e-03 2.3257089e-04 3.4786523e-04 6.1783613e-04 1.0165116e-03 2.5168566e-04 3.8505736e-04 5.7001648e-04 1.1966227e-03 1.6810991e-05 5.1450125e-04 5.1594461e-04 7.5656126e-03 1.6575405e-03 1.2105857e-03 8.0978467e-05 5.7473911e-04 8.3446667e-04 1.2949076e-03 7.2377696e-05 6.9925328e-04 8.0556975e-04 9.7555509e-04 -4.4213288e-05 6.7297073e-04 7.3581567e-04 1.2180593e-03 -3.9794718e-04 9.7166445e-04 5.8392331e-04 15 | 1.6135021e-02 1.8541994e-03 2.7167030e-03 8.0803316e-04 3.8565581e-04 1.3027631e-03 3.1412598e-03 5.6328639e-04 5.9263564e-04 1.2981877e-03 2.5295425e-03 1.0194492e-03 4.7160394e-04 1.1966227e-03 3.6291757e-03 -7.7427242e-05 1.1494026e-03 1.0738203e-03 2.6054668e-02 2.8678137e-03 3.7530492e-03 5.0936098e-04 1.2940668e-03 2.2411121e-03 4.2780203e-03 2.0701596e-04 1.7645615e-03 2.0859740e-03 2.7156752e-03 7.3851818e-04 1.1463992e-03 1.9098343e-03 3.9134758e-03 -1.0338915e-03 2.4866355e-03 1.3786314e-03 16 | 8.8329890e-04 1.9823337e-04 3.2720758e-04 2.8572084e-04 -2.8314225e-05 1.3573192e-04 1.7682946e-04 4.9889353e-04 -1.3436350e-04 1.7381378e-04 6.0739143e-04 -3.9032439e-04 2.6994762e-04 1.6810991e-05 -7.7427242e-05 1.0496752e-03 -3.4384126e-04 2.6764173e-04 -2.2828497e-03 9.2512180e-04 -1.0058995e-04 -2.5642028e-04 2.6335394e-04 9.3523421e-06 -5.8301888e-04 3.6700756e-04 -1.2783977e-04 9.4606375e-05 1.9247880e-04 -1.6197139e-03 8.3706363e-04 -2.7592250e-04 -6.6266046e-04 1.4302452e-03 -5.5847114e-04 4.3014968e-04 17 | 4.6000260e-03 1.2247058e-03 8.4628937e-04 1.5317160e-04 3.1951329e-04 5.6220412e-04 1.0240624e-03 -4.3783840e-05 4.3928302e-04 5.4294178e-04 6.9391449e-04 2.2337001e-04 3.3644514e-04 5.1450125e-04 1.1494026e-03 -3.4384126e-04 6.4594655e-04 4.3114560e-04 8.8292198e-03 1.2954992e-03 1.2838625e-03 1.7207885e-04 4.8847456e-04 8.3663573e-04 1.5585092e-03 -1.4770121e-04 7.7959221e-04 7.5968057e-04 9.1794149e-04 3.6838810e-04 4.2562029e-04 7.6897618e-04 1.4263003e-03 -7.1402339e-04 1.0836710e-03 4.7115398e-04 18 | 4.6090855e-03 1.3170496e-03 1.0287916e-03 2.9934968e-04 3.0915261e-04 6.3190252e-04 1.0777566e-03 2.7631762e-04 3.4261620e-04 6.4232008e-04 1.0350527e-03 2.6103598e-06 4.9352018e-04 5.1594461e-04 1.0738203e-03 2.6764173e-04 4.3114560e-04 5.9212047e-04 6.1299704e-03 1.7584199e-03 1.1746330e-03 -4.6329596e-05 6.5929618e-04 7.8306473e-04 1.0908717e-03 1.2084732e-04 6.4105252e-04 7.9085192e-04 9.6020006e-04 -6.0160416e-04 9.0996586e-04 5.4624605e-04 9.5641085e-04 1.4204509e-04 6.9076344e-04 7.1934422e-04 19 | 1.5309367e-01 1.1850671e-02 1.8353136e-02 4.1104079e-03 2.5171446e-03 8.6017573e-03 2.4627039e-02 -4.4180805e-04 5.5323021e-03 8.2582308e-03 1.5034312e-02 5.8953135e-03 2.3194599e-03 7.5656126e-03 2.6054668e-02 -2.2828497e-03 8.8292198e-03 6.1299704e-03 4.2346892e-01 3.3686579e-02 4.9359451e-02 8.0734138e-03 1.4002684e-02 2.7773242e-02 6.1990035e-02 -1.2437662e-03 2.2901589e-02 2.5700264e-02 3.8206236e-02 1.0988976e-02 1.2837631e-02 2.3957420e-02 5.1800015e-02 -7.1736436e-03 2.8608108e-02 1.6905817e-02 20 | 1.4190385e-02 4.5531496e-03 2.5394144e-03 1.4391519e-03 7.6728227e-04 1.8776446e-03 2.7959416e-03 8.9144193e-04 1.0140043e-03 1.8182630e-03 2.8082233e-03 3.0010750e-04 1.4275039e-03 1.6575405e-03 2.8678137e-03 9.2512180e-04 1.2954992e-03 1.7584199e-03 3.3686579e-02 1.0539186e-02 5.4768149e-03 4.9927271e-04 2.8861992e-03 3.8602206e-03 5.7733324e-03 1.7463451e-04 3.3304434e-03 3.9239530e-03 5.5456614e-03 -1.8273503e-03 4.4942319e-03 3.2732644e-03 5.5191878e-03 -4.1553933e-04 4.0485807e-03 3.5001690e-03 21 | 1.6701929e-02 1.8090385e-03 3.5038325e-03 6.8489863e-05 8.3004355e-04 1.5156912e-03 3.4878809e-03 6.6399268e-04 7.4242592e-04 1.5865272e-03 2.5682412e-03 7.4546793e-04 6.5173499e-04 1.2105857e-03 3.7530492e-03 -1.0058995e-04 1.2838625e-03 1.1746330e-03 4.9359451e-02 5.4768149e-03 1.1068815e-02 -8.6729362e-04 4.1507096e-03 4.9999461e-03 1.0164154e-02 1.4964302e-03 3.3405869e-03 5.1110583e-03 6.9651307e-03 1.2941920e-03 2.9592438e-03 3.7103458e-03 8.5007481e-03 -2.4230623e-04 4.1364190e-03 3.5023537e-03 22 | 4.1453371e-03 4.0937341e-05 -2.4723449e-04 8.0591411e-04 -3.3853229e-04 8.0761816e-05 7.7657580e-04 -1.0442379e-03 3.5465842e-04 -1.2608064e-04 1.3558167e-04 2.4501149e-04 -1.3133517e-04 8.0978467e-05 5.0936098e-04 -2.5642028e-04 1.7207885e-04 -4.6329596e-05 8.0734138e-03 4.9927271e-04 -8.6729362e-04 3.1334111e-03 -1.2111968e-03 4.6827649e-04 1.4334602e-03 -1.9819502e-03 1.0289716e-03 -1.1478744e-04 4.1273018e-04 6.3015156e-04 -1.6009942e-04 4.4698009e-04 6.4145867e-04 -3.2086373e-04 4.4804035e-04 -1.5574692e-05 23 | 4.8998809e-03 1.2510115e-03 1.4910884e-03 -2.4228582e-05 4.9461646e-04 7.1343101e-04 1.1745348e-03 6.8647244e-04 2.6419972e-04 8.1051351e-04 1.1683896e-03 1.2136791e-04 5.0326119e-04 5.7473911e-04 1.2940668e-03 2.6335394e-04 4.8847456e-04 6.5929618e-04 1.4002684e-02 2.8861992e-03 4.1507096e-03 -1.2111968e-03 2.0791205e-03 1.7950425e-03 3.1098730e-03 1.1096709e-03 1.0794261e-03 2.0893594e-03 2.5539899e-03 -3.2843943e-04 1.6608445e-03 1.2783319e-03 2.8201471e-03 1.5393655e-04 1.4967037e-03 1.5745541e-03 24 | 1.0973868e-02 1.5798427e-03 1.8654877e-03 4.6229380e-04 4.0116458e-04 9.9375771e-04 2.1780267e-03 1.7547638e-04 5.8607595e-04 9.6138478e-04 1.5894972e-03 4.4897079e-04 4.7604249e-04 8.3446667e-04 2.2411121e-03 9.3523421e-06 8.3663573e-04 7.8306473e-04 2.7773242e-02 3.8602206e-03 4.9999461e-03 4.6827649e-04 1.7950425e-03 2.7644495e-03 5.2785406e-03 1.4740333e-04 2.1371436e-03 2.6192202e-03 3.6272059e-03 4.4247937e-04 1.7806685e-03 2.1503175e-03 4.3870753e-03 -3.6034770e-04 2.4913919e-03 1.8960688e-03 25 | 2.1323420e-02 1.8860438e-03 3.3305438e-03 4.8403286e-04 6.4506265e-04 1.5753594e-03 4.2803118e-03 -2.9273378e-04 1.1157049e-03 1.5267014e-03 2.6737461e-03 8.5158895e-04 5.7789167e-04 1.2949076e-03 4.2780203e-03 -5.8301888e-04 1.5585092e-03 1.0908717e-03 6.1990035e-02 5.7733324e-03 1.0164154e-02 1.4334602e-03 3.1098730e-03 5.2785406e-03 1.2834411e-02 -2.8015370e-04 4.5864098e-03 5.4519574e-03 7.7331883e-03 2.0589194e-03 2.7898055e-03 4.3129507e-03 9.6603145e-03 -7.5167149e-04 4.8225133e-03 3.5151723e-03 26 | -1.5147250e-05 -1.7628276e-04 6.7223131e-04 -5.2092408e-04 2.0018986e-04 1.5030959e-05 -9.7749788e-05 1.0145526e-03 -3.4685717e-04 2.0273294e-04 3.8110277e-04 2.0632137e-04 -1.5515919e-05 7.2377696e-05 2.0701596e-04 3.6700756e-04 -1.4770121e-04 1.2084732e-04 -1.2437662e-03 1.7463451e-04 1.4964302e-03 -1.9819502e-03 1.1096709e-03 1.4740333e-04 -2.8015370e-04 2.3848942e-03 -7.2566660e-04 6.7759047e-04 5.1203156e-04 4.6095772e-06 3.0882342e-04 1.9155434e-04 6.0433898e-04 1.4109197e-04 1.9747662e-04 3.9014784e-04 27 | 8.8600428e-03 1.5321902e-03 1.3084987e-03 5.5910255e-04 3.0448625e-04 8.4793561e-04 1.8519362e-03 -2.0811688e-04 6.5137806e-04 7.6949402e-04 1.2383856e-03 2.4136689e-04 4.7460511e-04 6.9925328e-04 1.7645615e-03 -1.2783977e-04 7.7959221e-04 6.4105252e-04 2.2901589e-02 3.3304434e-03 3.3405869e-03 1.0289716e-03 1.0794261e-03 2.1371436e-03 4.5864098e-03 -7.2566660e-04 2.1089265e-03 2.0155331e-03 2.8776241e-03 1.9686562e-04 1.4916933e-03 1.7089636e-03 3.4228878e-03 -3.5734264e-04 2.0318442e-03 1.4820314e-03 28 | 9.4941000e-03 1.5314791e-03 1.9043418e-03 2.5941643e-04 4.7858151e-04 9.4750142e-04 2.0245653e-03 3.9043219e-04 5.0661899e-04 9.9546869e-04 1.6221602e-03 3.7372450e-04 5.2415268e-04 8.0556975e-04 2.0859740e-03 9.4606375e-05 7.5968057e-04 7.9085192e-04 2.5700264e-02 3.9239530e-03 5.1110583e-03 -1.1478744e-04 2.0893594e-03 2.6192202e-03 5.4519574e-03 6.7759047e-04 2.0155331e-03 2.9253013e-03 3.8109622e-03 2.6832092e-04 1.9748792e-03 2.1113938e-03 4.4803017e-03 -1.8948155e-04 2.4322956e-03 2.0551706e-03 29 | 1.3410027e-02 1.7644192e-03 2.3884512e-03 3.8704458e-04 5.3485591e-04 1.1669588e-03 2.6832250e-03 2.7975212e-04 6.6822211e-04 1.1719049e-03 2.1995700e-03 3.3147667e-04 6.6818033e-04 9.7555509e-04 2.7156752e-03 1.9247880e-04 9.1794149e-04 9.6020006e-04 3.8206236e-02 5.5456614e-03 6.9651307e-03 4.1273018e-04 2.5539899e-03 3.6272059e-03 7.7331883e-03 5.1203156e-04 2.8776241e-03 3.8109622e-03 6.6418223e-03 -5.6585628e-05 3.2092116e-03 3.1262535e-03 6.6294004e-03 1.7835516e-04 3.2711088e-03 2.9681093e-03 30 | 2.2231951e-03 -1.3317860e-03 -1.6521157e-04 -2.6594700e-04 -2.5700791e-04 -3.3731491e-04 1.0564937e-04 -4.3151257e-04 -1.2406761e-04 -3.8496915e-04 -7.8283308e-04 1.4240465e-03 -9.5180639e-04 -4.4213288e-05 7.3851818e-04 -1.6197139e-03 3.6838810e-04 -6.0160416e-04 1.0988976e-02 -1.8273503e-03 1.2941920e-03 6.3015156e-04 -3.2843943e-04 4.4247937e-04 2.0589194e-03 4.6095772e-06 1.9686562e-04 2.6832092e-04 -5.6585628e-05 4.4924707e-03 -2.0626412e-03 1.0676322e-03 2.0662828e-03 -3.1270104e-03 1.4557991e-03 -8.3164315e-04 31 | 5.5435744e-03 2.0009954e-03 1.3752284e-03 4.7406163e-04 4.6236653e-04 8.9475457e-04 1.3501859e-03 4.8089035e-04 4.6565898e-04 9.1762778e-04 1.5630033e-03 -3.5133822e-04 8.8107250e-04 6.7297073e-04 1.1463992e-03 8.3706363e-04 4.2562029e-04 9.0996586e-04 1.2837631e-02 4.4942319e-03 2.9592438e-03 -1.6009942e-04 1.6608445e-03 1.7806685e-03 2.7898055e-03 3.0882342e-04 1.4916933e-03 1.9748792e-03 3.2092116e-03 -2.0626412e-03 2.7689389e-03 1.2247231e-03 2.3906249e-03 1.1314194e-03 1.2851449e-03 2.0143621e-03 32 | 9.4286614e-03 1.2644938e-03 1.3984833e-03 3.8520212e-04 2.7724088e-04 7.5010848e-04 1.6981431e-03 1.6073342e-04 4.4431414e-04 7.2842280e-04 1.1786558e-03 6.6958780e-04 2.4412508e-04 7.3581567e-04 1.9098343e-03 -2.7592250e-04 7.6897618e-04 5.4624605e-04 2.3957420e-02 3.2732644e-03 3.7103458e-03 4.4698009e-04 1.2783319e-03 2.1503175e-03 4.3129507e-03 1.9155434e-04 1.7089636e-03 2.1113938e-03 3.1262535e-03 1.0676322e-03 1.2247231e-03 2.0811202e-03 3.8907725e-03 -1.1515060e-03 2.4614733e-03 1.3427013e-03 33 | 1.8014842e-02 1.6906429e-03 2.8557160e-03 4.0065877e-04 5.3729575e-04 1.3042996e-03 3.3027122e-03 2.3186920e-04 7.5167031e-04 1.2872576e-03 2.2466091e-03 1.2154581e-03 3.3661872e-04 1.2180593e-03 3.9134758e-03 -6.6266046e-04 1.4263003e-03 9.5641085e-04 5.1800015e-02 5.5191878e-03 8.5007481e-03 6.4145867e-04 2.8201471e-03 4.3870753e-03 9.6603145e-03 6.0433898e-04 3.4228878e-03 4.4803017e-03 6.6294004e-03 2.0662828e-03 2.3906249e-03 3.8907725e-03 9.4285875e-03 -1.7595913e-03 4.9858627e-03 3.2046624e-03 34 | -3.3283008e-03 -2.9093502e-04 -2.1470734e-05 -1.8244149e-04 5.1718157e-05 -7.5199569e-05 -2.0483781e-04 7.1337978e-05 -9.3629945e-05 -1.5859726e-05 2.8583690e-04 -1.4032063e-03 4.8275935e-04 -3.9794718e-04 -1.0338915e-03 1.4302452e-03 -7.1402339e-04 1.4204509e-04 -7.1736436e-03 -4.1553933e-04 -2.4230623e-04 -3.2086373e-04 1.5393655e-04 -3.6034770e-04 -7.5167149e-04 1.4109197e-04 -3.5734264e-04 -1.8948155e-04 1.7835516e-04 -3.1270104e-03 1.1314194e-03 -1.1515060e-03 -1.7595913e-03 4.0311491e-03 -2.1448665e-03 6.4325321e-04 35 | 1.1545130e-02 1.7410948e-03 1.6774318e-03 5.1042507e-04 3.5802931e-04 9.4296445e-04 2.0048841e-03 2.4182405e-04 5.5820479e-04 9.1007129e-04 1.3777423e-03 9.9981081e-04 2.7081753e-04 9.7166445e-04 2.4866355e-03 -5.5847114e-04 1.0836710e-03 6.9076344e-04 2.8608108e-02 4.0485807e-03 4.1364190e-03 4.4804035e-04 1.4967037e-03 2.4913919e-03 4.8225133e-03 1.9747662e-04 2.0318442e-03 2.4322956e-03 3.2711088e-03 1.4557991e-03 1.2851449e-03 2.4614733e-03 4.9858627e-03 -2.1448665e-03 3.3910700e-03 1.5512895e-03 36 | 6.2631275e-03 1.3865205e-03 1.3732023e-03 3.1402409e-04 3.7528992e-04 7.5885124e-04 1.4099590e-03 3.5263135e-04 3.9011634e-04 7.7783315e-04 1.3184234e-03 -1.2431301e-05 5.7214264e-04 5.8392331e-04 1.3786314e-03 4.3014968e-04 4.7115398e-04 7.1934422e-04 1.6905817e-02 3.5001690e-03 3.5023537e-03 -1.5574692e-05 1.5745541e-03 1.8960688e-03 3.5151723e-03 3.9014784e-04 1.4820314e-03 2.0551706e-03 2.9681093e-03 -8.3164315e-04 2.0143621e-03 1.3427013e-03 3.2046624e-03 6.4325321e-04 1.5512895e-03 1.8979601e-03 37 | -------------------------------------------------------------------------------- /C++ code/NIQE/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/C++ code/NIQE/main.cpp -------------------------------------------------------------------------------- /C++ code/NIQE/mu.txt: -------------------------------------------------------------------------------- 1 | 1.9416538e+00 7.5953459e-01 6.8559050e-01 8.6956265e-02 7.0897891e-02 1.1319038e-01 6.9641403e-01 8.6775377e-02 7.3369356e-02 1.1696280e-01 7.3562217e-01 -4.5633025e-03 1.0655068e-01 1.0452362e-01 7.2519910e-01 1.6531556e-02 9.7733556e-02 1.0670715e-01 2.1423213e+00 8.3108325e-01 6.6569683e-01 6.4274479e-02 7.9743105e-02 1.0636142e-01 6.9834163e-01 6.1805199e-02 8.8558142e-02 1.1890419e-01 7.4490045e-01 -3.8170486e-02 1.3259869e-01 1.1010126e-01 7.3708145e-01 -3.9373293e-03 1.1977821e-01 1.1487287e-01 2 | -------------------------------------------------------------------------------- /C++ code/NIQE/niqe.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/C++ code/NIQE/niqe.cpp -------------------------------------------------------------------------------- /C++ code/NIQE/niqe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/C++ code/NIQE/niqe.h -------------------------------------------------------------------------------- /MATLAB code/computefeature.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/MATLAB code/computefeature.m -------------------------------------------------------------------------------- /MATLAB code/computemean.m: -------------------------------------------------------------------------------- 1 | function val = computemean(patch) 2 | 3 | val = mean2(patch); -------------------------------------------------------------------------------- /MATLAB code/computequality.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/MATLAB code/computequality.m -------------------------------------------------------------------------------- /MATLAB code/cov.txt: -------------------------------------------------------------------------------- 1 | 8.9973547e-02 8.2646005e-03 1.2119640e-02 4.2838275e-03 1.1746581e-03 5.7534768e-03 1.5351937e-02 2.0909003e-03 2.6822205e-03 5.6967668e-03 1.1947724e-02 3.9998450e-03 2.0394879e-03 5.2619149e-03 1.6135021e-02 8.8329890e-04 4.6000260e-03 4.6090855e-03 1.5309367e-01 1.4190385e-02 1.6701929e-02 4.1453371e-03 4.8998809e-03 1.0973868e-02 2.1323420e-02 -1.5147250e-05 8.8600428e-03 9.4941000e-03 1.3410027e-02 2.2231951e-03 5.5435744e-03 9.4286614e-03 1.8014842e-02 -3.3283008e-03 1.1545130e-02 6.2631275e-03 2 | 8.2646005e-03 3.9265776e-03 1.8475480e-03 5.2602759e-04 9.0583049e-04 1.4728265e-03 2.0552255e-03 1.9424246e-04 1.0893525e-03 1.4619494e-03 1.8759288e-03 -2.9042220e-04 1.3590220e-03 1.2395225e-03 1.8541994e-03 1.9823337e-04 1.2247058e-03 1.3170496e-03 1.1850671e-02 4.5531496e-03 1.8090385e-03 4.0937341e-05 1.2510115e-03 1.5798427e-03 1.8860438e-03 -1.7628276e-04 1.5321902e-03 1.5314791e-03 1.7644192e-03 -1.3317860e-03 2.0009954e-03 1.2644938e-03 1.6906429e-03 -2.9093502e-04 1.7410948e-03 1.3865205e-03 3 | 1.2119640e-02 1.8475480e-03 2.6786142e-03 4.6149901e-04 5.6289509e-04 1.2664425e-03 2.6250588e-03 7.1345530e-04 5.2353555e-04 1.2651679e-03 2.3507746e-03 4.4613992e-04 6.8334834e-04 1.0198119e-03 2.7167030e-03 3.2720758e-04 8.4628937e-04 1.0287916e-03 1.8353136e-02 2.5394144e-03 3.5038325e-03 -2.4723449e-04 1.4910884e-03 1.8654877e-03 3.3305438e-03 6.7223131e-04 1.3084987e-03 1.9043418e-03 2.3884512e-03 -1.6521157e-04 1.3752284e-03 1.3984833e-03 2.8557160e-03 -2.1470734e-05 1.6774318e-03 1.3732023e-03 4 | 4.2838275e-03 5.2602759e-04 4.6149901e-04 8.4597437e-04 -1.4428456e-04 3.5359606e-04 7.9360238e-04 1.7988107e-04 1.0699412e-04 2.8377283e-04 7.3266667e-04 3.7483674e-04 9.1526081e-05 3.2761466e-04 8.0803316e-04 2.8572084e-04 1.5317160e-04 2.9934968e-04 4.1104079e-03 1.4391519e-03 6.8489863e-05 8.0591411e-04 -2.4228582e-05 4.6229380e-04 4.8403286e-04 -5.2092408e-04 5.5910255e-04 2.5941643e-04 3.8704458e-04 -2.6594700e-04 4.7406163e-04 3.8520212e-04 4.0065877e-04 -1.8244149e-04 5.1042507e-04 3.1402409e-04 5 | 1.1746581e-03 9.0583049e-04 5.6289509e-04 -1.4428456e-04 3.4528964e-04 3.6501175e-04 4.4641365e-04 5.0247205e-05 2.8068335e-04 3.7794793e-04 3.9958779e-04 -1.8302624e-04 3.7245036e-04 2.7048735e-04 3.8565581e-04 -2.8314225e-05 3.1951329e-04 3.0915261e-04 2.5171446e-03 7.6728227e-04 8.3004355e-04 -3.3853229e-04 4.9461646e-04 4.0116458e-04 6.4506265e-04 2.0018986e-04 3.0448625e-04 4.7858151e-04 5.3485591e-04 -2.5700791e-04 4.6236653e-04 2.7724088e-04 5.3729575e-04 5.1718157e-05 3.5802931e-04 3.7528992e-04 6 | 5.7534768e-03 1.4728265e-03 1.2664425e-03 3.5359606e-04 3.6501175e-04 7.6650233e-04 1.3423626e-03 2.2421342e-04 4.3999787e-04 7.3898919e-04 1.1676316e-03 9.8180745e-05 5.2235700e-04 6.1768946e-04 1.3027631e-03 1.3573192e-04 5.6220412e-04 6.3190252e-04 8.6017573e-03 1.8776446e-03 1.5156912e-03 8.0761816e-05 7.1343101e-04 9.9375771e-04 1.5753594e-03 1.5030959e-05 8.4793561e-04 9.4750142e-04 1.1669588e-03 -3.3731491e-04 8.9475457e-04 7.5010848e-04 1.3042996e-03 -7.5199569e-05 9.4296445e-04 7.5885124e-04 7 | 1.5351937e-02 2.0552255e-03 2.6250588e-03 7.9360238e-04 4.4641365e-04 1.3423626e-03 3.3317262e-03 3.0207313e-04 7.7841412e-04 1.3884256e-03 2.5696035e-03 5.3638368e-04 7.0130358e-04 1.1407337e-03 3.1412598e-03 1.7682946e-04 1.0240624e-03 1.0777566e-03 2.4627039e-02 2.7959416e-03 3.4878809e-03 7.7657580e-04 1.1745348e-03 2.1780267e-03 4.2803118e-03 -9.7749788e-05 1.8519362e-03 2.0245653e-03 2.6832250e-03 1.0564937e-04 1.3501859e-03 1.6981431e-03 3.3027122e-03 -2.0483781e-04 2.0048841e-03 1.4099590e-03 8 | 2.0909003e-03 1.9424246e-04 7.1345530e-04 1.7988107e-04 5.0247205e-05 2.2421342e-04 3.0207313e-04 1.0040316e-03 -2.5458512e-04 3.1515775e-04 6.9203631e-04 3.4250540e-04 5.6887989e-05 2.3257089e-04 5.6328639e-04 4.9889353e-04 -4.3783840e-05 2.7631762e-04 -4.4180805e-04 8.9144193e-04 6.6399268e-04 -1.0442379e-03 6.8647244e-04 1.7547638e-04 -2.9273378e-04 1.0145526e-03 -2.0811688e-04 3.9043219e-04 2.7975212e-04 -4.3151257e-04 4.8089035e-04 1.6073342e-04 2.3186920e-04 7.1337978e-05 2.4182405e-04 3.5263135e-04 9 | 2.6822205e-03 1.0893525e-03 5.2353555e-04 1.0699412e-04 2.8068335e-04 4.3999787e-04 7.7841412e-04 -2.5458512e-04 4.5389718e-04 4.2312768e-04 4.8929097e-04 -1.4035239e-04 3.9873279e-04 3.4786523e-04 5.9263564e-04 -1.3436350e-04 4.3928302e-04 3.4261620e-04 5.5323021e-03 1.0140043e-03 7.4242592e-04 3.5465842e-04 2.6419972e-04 5.8607595e-04 1.1157049e-03 -3.4685717e-04 6.5137806e-04 5.0661899e-04 6.6822211e-04 -1.2406761e-04 4.6565898e-04 4.4431414e-04 7.5167031e-04 -9.3629945e-05 5.5820479e-04 3.9011634e-04 10 | 5.6967668e-03 1.4619494e-03 1.2651679e-03 2.8377283e-04 3.7794793e-04 7.3898919e-04 1.3884256e-03 3.1515775e-04 4.2312768e-04 7.8571031e-04 1.2078164e-03 8.3347546e-05 5.3564518e-04 6.1783613e-04 1.2981877e-03 1.7381378e-04 5.4294178e-04 6.4232008e-04 8.2582308e-03 1.8182630e-03 1.5865272e-03 -1.2608064e-04 8.1051351e-04 9.6138478e-04 1.5267014e-03 2.0273294e-04 7.6949402e-04 9.9546869e-04 1.1719049e-03 -3.8496915e-04 9.1762778e-04 7.2842280e-04 1.2872576e-03 -1.5859726e-05 9.1007129e-04 7.7783315e-04 11 | 1.1947724e-02 1.8759288e-03 2.3507746e-03 7.3266667e-04 3.9958779e-04 1.1676316e-03 2.5696035e-03 6.9203631e-04 4.8929097e-04 1.2078164e-03 2.5760678e-03 3.3019953e-04 7.6253823e-04 1.0165116e-03 2.5295425e-03 6.0739143e-04 6.9391449e-04 1.0350527e-03 1.5034312e-02 2.8082233e-03 2.5682412e-03 1.3558167e-04 1.1683896e-03 1.5894972e-03 2.6737461e-03 3.8110277e-04 1.2383856e-03 1.6221602e-03 2.1995700e-03 -7.8283308e-04 1.5630033e-03 1.1786558e-03 2.2466091e-03 2.8583690e-04 1.3777423e-03 1.3184234e-03 12 | 3.9998450e-03 -2.9042220e-04 4.4613992e-04 3.7483674e-04 -1.8302624e-04 9.8180745e-05 5.3638368e-04 3.4250540e-04 -1.4035239e-04 8.3347546e-05 3.3019953e-04 1.0572881e-03 -3.9282725e-04 2.5168566e-04 1.0194492e-03 -3.9032439e-04 2.2337001e-04 2.6103598e-06 5.8953135e-03 3.0010750e-04 7.4546793e-04 2.4501149e-04 1.2136791e-04 4.4897079e-04 8.5158895e-04 2.0632137e-04 2.4136689e-04 3.7372450e-04 3.3147667e-04 1.4240465e-03 -3.5133822e-04 6.6958780e-04 1.2154581e-03 -1.4032063e-03 9.9981081e-04 -1.2431301e-05 13 | 2.0394879e-03 1.3590220e-03 6.8334834e-04 9.1526081e-05 3.7245036e-04 5.2235700e-04 7.0130358e-04 5.6887989e-05 3.9873279e-04 5.3564518e-04 7.6253823e-04 -3.9282725e-04 6.1346718e-04 3.8505736e-04 4.7160394e-04 2.6994762e-04 3.3644514e-04 4.9352018e-04 2.3194599e-03 1.4275039e-03 6.5173499e-04 -1.3133517e-04 5.0326119e-04 4.7604249e-04 5.7789167e-04 -1.5515919e-05 4.7460511e-04 5.2415268e-04 6.6818033e-04 -9.5180639e-04 8.8107250e-04 2.4412508e-04 3.3661872e-04 4.8275935e-04 2.7081753e-04 5.7214264e-04 14 | 5.2619149e-03 1.2395225e-03 1.0198119e-03 3.2761466e-04 2.7048735e-04 6.1768946e-04 1.1407337e-03 2.3257089e-04 3.4786523e-04 6.1783613e-04 1.0165116e-03 2.5168566e-04 3.8505736e-04 5.7001648e-04 1.1966227e-03 1.6810991e-05 5.1450125e-04 5.1594461e-04 7.5656126e-03 1.6575405e-03 1.2105857e-03 8.0978467e-05 5.7473911e-04 8.3446667e-04 1.2949076e-03 7.2377696e-05 6.9925328e-04 8.0556975e-04 9.7555509e-04 -4.4213288e-05 6.7297073e-04 7.3581567e-04 1.2180593e-03 -3.9794718e-04 9.7166445e-04 5.8392331e-04 15 | 1.6135021e-02 1.8541994e-03 2.7167030e-03 8.0803316e-04 3.8565581e-04 1.3027631e-03 3.1412598e-03 5.6328639e-04 5.9263564e-04 1.2981877e-03 2.5295425e-03 1.0194492e-03 4.7160394e-04 1.1966227e-03 3.6291757e-03 -7.7427242e-05 1.1494026e-03 1.0738203e-03 2.6054668e-02 2.8678137e-03 3.7530492e-03 5.0936098e-04 1.2940668e-03 2.2411121e-03 4.2780203e-03 2.0701596e-04 1.7645615e-03 2.0859740e-03 2.7156752e-03 7.3851818e-04 1.1463992e-03 1.9098343e-03 3.9134758e-03 -1.0338915e-03 2.4866355e-03 1.3786314e-03 16 | 8.8329890e-04 1.9823337e-04 3.2720758e-04 2.8572084e-04 -2.8314225e-05 1.3573192e-04 1.7682946e-04 4.9889353e-04 -1.3436350e-04 1.7381378e-04 6.0739143e-04 -3.9032439e-04 2.6994762e-04 1.6810991e-05 -7.7427242e-05 1.0496752e-03 -3.4384126e-04 2.6764173e-04 -2.2828497e-03 9.2512180e-04 -1.0058995e-04 -2.5642028e-04 2.6335394e-04 9.3523421e-06 -5.8301888e-04 3.6700756e-04 -1.2783977e-04 9.4606375e-05 1.9247880e-04 -1.6197139e-03 8.3706363e-04 -2.7592250e-04 -6.6266046e-04 1.4302452e-03 -5.5847114e-04 4.3014968e-04 17 | 4.6000260e-03 1.2247058e-03 8.4628937e-04 1.5317160e-04 3.1951329e-04 5.6220412e-04 1.0240624e-03 -4.3783840e-05 4.3928302e-04 5.4294178e-04 6.9391449e-04 2.2337001e-04 3.3644514e-04 5.1450125e-04 1.1494026e-03 -3.4384126e-04 6.4594655e-04 4.3114560e-04 8.8292198e-03 1.2954992e-03 1.2838625e-03 1.7207885e-04 4.8847456e-04 8.3663573e-04 1.5585092e-03 -1.4770121e-04 7.7959221e-04 7.5968057e-04 9.1794149e-04 3.6838810e-04 4.2562029e-04 7.6897618e-04 1.4263003e-03 -7.1402339e-04 1.0836710e-03 4.7115398e-04 18 | 4.6090855e-03 1.3170496e-03 1.0287916e-03 2.9934968e-04 3.0915261e-04 6.3190252e-04 1.0777566e-03 2.7631762e-04 3.4261620e-04 6.4232008e-04 1.0350527e-03 2.6103598e-06 4.9352018e-04 5.1594461e-04 1.0738203e-03 2.6764173e-04 4.3114560e-04 5.9212047e-04 6.1299704e-03 1.7584199e-03 1.1746330e-03 -4.6329596e-05 6.5929618e-04 7.8306473e-04 1.0908717e-03 1.2084732e-04 6.4105252e-04 7.9085192e-04 9.6020006e-04 -6.0160416e-04 9.0996586e-04 5.4624605e-04 9.5641085e-04 1.4204509e-04 6.9076344e-04 7.1934422e-04 19 | 1.5309367e-01 1.1850671e-02 1.8353136e-02 4.1104079e-03 2.5171446e-03 8.6017573e-03 2.4627039e-02 -4.4180805e-04 5.5323021e-03 8.2582308e-03 1.5034312e-02 5.8953135e-03 2.3194599e-03 7.5656126e-03 2.6054668e-02 -2.2828497e-03 8.8292198e-03 6.1299704e-03 4.2346892e-01 3.3686579e-02 4.9359451e-02 8.0734138e-03 1.4002684e-02 2.7773242e-02 6.1990035e-02 -1.2437662e-03 2.2901589e-02 2.5700264e-02 3.8206236e-02 1.0988976e-02 1.2837631e-02 2.3957420e-02 5.1800015e-02 -7.1736436e-03 2.8608108e-02 1.6905817e-02 20 | 1.4190385e-02 4.5531496e-03 2.5394144e-03 1.4391519e-03 7.6728227e-04 1.8776446e-03 2.7959416e-03 8.9144193e-04 1.0140043e-03 1.8182630e-03 2.8082233e-03 3.0010750e-04 1.4275039e-03 1.6575405e-03 2.8678137e-03 9.2512180e-04 1.2954992e-03 1.7584199e-03 3.3686579e-02 1.0539186e-02 5.4768149e-03 4.9927271e-04 2.8861992e-03 3.8602206e-03 5.7733324e-03 1.7463451e-04 3.3304434e-03 3.9239530e-03 5.5456614e-03 -1.8273503e-03 4.4942319e-03 3.2732644e-03 5.5191878e-03 -4.1553933e-04 4.0485807e-03 3.5001690e-03 21 | 1.6701929e-02 1.8090385e-03 3.5038325e-03 6.8489863e-05 8.3004355e-04 1.5156912e-03 3.4878809e-03 6.6399268e-04 7.4242592e-04 1.5865272e-03 2.5682412e-03 7.4546793e-04 6.5173499e-04 1.2105857e-03 3.7530492e-03 -1.0058995e-04 1.2838625e-03 1.1746330e-03 4.9359451e-02 5.4768149e-03 1.1068815e-02 -8.6729362e-04 4.1507096e-03 4.9999461e-03 1.0164154e-02 1.4964302e-03 3.3405869e-03 5.1110583e-03 6.9651307e-03 1.2941920e-03 2.9592438e-03 3.7103458e-03 8.5007481e-03 -2.4230623e-04 4.1364190e-03 3.5023537e-03 22 | 4.1453371e-03 4.0937341e-05 -2.4723449e-04 8.0591411e-04 -3.3853229e-04 8.0761816e-05 7.7657580e-04 -1.0442379e-03 3.5465842e-04 -1.2608064e-04 1.3558167e-04 2.4501149e-04 -1.3133517e-04 8.0978467e-05 5.0936098e-04 -2.5642028e-04 1.7207885e-04 -4.6329596e-05 8.0734138e-03 4.9927271e-04 -8.6729362e-04 3.1334111e-03 -1.2111968e-03 4.6827649e-04 1.4334602e-03 -1.9819502e-03 1.0289716e-03 -1.1478744e-04 4.1273018e-04 6.3015156e-04 -1.6009942e-04 4.4698009e-04 6.4145867e-04 -3.2086373e-04 4.4804035e-04 -1.5574692e-05 23 | 4.8998809e-03 1.2510115e-03 1.4910884e-03 -2.4228582e-05 4.9461646e-04 7.1343101e-04 1.1745348e-03 6.8647244e-04 2.6419972e-04 8.1051351e-04 1.1683896e-03 1.2136791e-04 5.0326119e-04 5.7473911e-04 1.2940668e-03 2.6335394e-04 4.8847456e-04 6.5929618e-04 1.4002684e-02 2.8861992e-03 4.1507096e-03 -1.2111968e-03 2.0791205e-03 1.7950425e-03 3.1098730e-03 1.1096709e-03 1.0794261e-03 2.0893594e-03 2.5539899e-03 -3.2843943e-04 1.6608445e-03 1.2783319e-03 2.8201471e-03 1.5393655e-04 1.4967037e-03 1.5745541e-03 24 | 1.0973868e-02 1.5798427e-03 1.8654877e-03 4.6229380e-04 4.0116458e-04 9.9375771e-04 2.1780267e-03 1.7547638e-04 5.8607595e-04 9.6138478e-04 1.5894972e-03 4.4897079e-04 4.7604249e-04 8.3446667e-04 2.2411121e-03 9.3523421e-06 8.3663573e-04 7.8306473e-04 2.7773242e-02 3.8602206e-03 4.9999461e-03 4.6827649e-04 1.7950425e-03 2.7644495e-03 5.2785406e-03 1.4740333e-04 2.1371436e-03 2.6192202e-03 3.6272059e-03 4.4247937e-04 1.7806685e-03 2.1503175e-03 4.3870753e-03 -3.6034770e-04 2.4913919e-03 1.8960688e-03 25 | 2.1323420e-02 1.8860438e-03 3.3305438e-03 4.8403286e-04 6.4506265e-04 1.5753594e-03 4.2803118e-03 -2.9273378e-04 1.1157049e-03 1.5267014e-03 2.6737461e-03 8.5158895e-04 5.7789167e-04 1.2949076e-03 4.2780203e-03 -5.8301888e-04 1.5585092e-03 1.0908717e-03 6.1990035e-02 5.7733324e-03 1.0164154e-02 1.4334602e-03 3.1098730e-03 5.2785406e-03 1.2834411e-02 -2.8015370e-04 4.5864098e-03 5.4519574e-03 7.7331883e-03 2.0589194e-03 2.7898055e-03 4.3129507e-03 9.6603145e-03 -7.5167149e-04 4.8225133e-03 3.5151723e-03 26 | -1.5147250e-05 -1.7628276e-04 6.7223131e-04 -5.2092408e-04 2.0018986e-04 1.5030959e-05 -9.7749788e-05 1.0145526e-03 -3.4685717e-04 2.0273294e-04 3.8110277e-04 2.0632137e-04 -1.5515919e-05 7.2377696e-05 2.0701596e-04 3.6700756e-04 -1.4770121e-04 1.2084732e-04 -1.2437662e-03 1.7463451e-04 1.4964302e-03 -1.9819502e-03 1.1096709e-03 1.4740333e-04 -2.8015370e-04 2.3848942e-03 -7.2566660e-04 6.7759047e-04 5.1203156e-04 4.6095772e-06 3.0882342e-04 1.9155434e-04 6.0433898e-04 1.4109197e-04 1.9747662e-04 3.9014784e-04 27 | 8.8600428e-03 1.5321902e-03 1.3084987e-03 5.5910255e-04 3.0448625e-04 8.4793561e-04 1.8519362e-03 -2.0811688e-04 6.5137806e-04 7.6949402e-04 1.2383856e-03 2.4136689e-04 4.7460511e-04 6.9925328e-04 1.7645615e-03 -1.2783977e-04 7.7959221e-04 6.4105252e-04 2.2901589e-02 3.3304434e-03 3.3405869e-03 1.0289716e-03 1.0794261e-03 2.1371436e-03 4.5864098e-03 -7.2566660e-04 2.1089265e-03 2.0155331e-03 2.8776241e-03 1.9686562e-04 1.4916933e-03 1.7089636e-03 3.4228878e-03 -3.5734264e-04 2.0318442e-03 1.4820314e-03 28 | 9.4941000e-03 1.5314791e-03 1.9043418e-03 2.5941643e-04 4.7858151e-04 9.4750142e-04 2.0245653e-03 3.9043219e-04 5.0661899e-04 9.9546869e-04 1.6221602e-03 3.7372450e-04 5.2415268e-04 8.0556975e-04 2.0859740e-03 9.4606375e-05 7.5968057e-04 7.9085192e-04 2.5700264e-02 3.9239530e-03 5.1110583e-03 -1.1478744e-04 2.0893594e-03 2.6192202e-03 5.4519574e-03 6.7759047e-04 2.0155331e-03 2.9253013e-03 3.8109622e-03 2.6832092e-04 1.9748792e-03 2.1113938e-03 4.4803017e-03 -1.8948155e-04 2.4322956e-03 2.0551706e-03 29 | 1.3410027e-02 1.7644192e-03 2.3884512e-03 3.8704458e-04 5.3485591e-04 1.1669588e-03 2.6832250e-03 2.7975212e-04 6.6822211e-04 1.1719049e-03 2.1995700e-03 3.3147667e-04 6.6818033e-04 9.7555509e-04 2.7156752e-03 1.9247880e-04 9.1794149e-04 9.6020006e-04 3.8206236e-02 5.5456614e-03 6.9651307e-03 4.1273018e-04 2.5539899e-03 3.6272059e-03 7.7331883e-03 5.1203156e-04 2.8776241e-03 3.8109622e-03 6.6418223e-03 -5.6585628e-05 3.2092116e-03 3.1262535e-03 6.6294004e-03 1.7835516e-04 3.2711088e-03 2.9681093e-03 30 | 2.2231951e-03 -1.3317860e-03 -1.6521157e-04 -2.6594700e-04 -2.5700791e-04 -3.3731491e-04 1.0564937e-04 -4.3151257e-04 -1.2406761e-04 -3.8496915e-04 -7.8283308e-04 1.4240465e-03 -9.5180639e-04 -4.4213288e-05 7.3851818e-04 -1.6197139e-03 3.6838810e-04 -6.0160416e-04 1.0988976e-02 -1.8273503e-03 1.2941920e-03 6.3015156e-04 -3.2843943e-04 4.4247937e-04 2.0589194e-03 4.6095772e-06 1.9686562e-04 2.6832092e-04 -5.6585628e-05 4.4924707e-03 -2.0626412e-03 1.0676322e-03 2.0662828e-03 -3.1270104e-03 1.4557991e-03 -8.3164315e-04 31 | 5.5435744e-03 2.0009954e-03 1.3752284e-03 4.7406163e-04 4.6236653e-04 8.9475457e-04 1.3501859e-03 4.8089035e-04 4.6565898e-04 9.1762778e-04 1.5630033e-03 -3.5133822e-04 8.8107250e-04 6.7297073e-04 1.1463992e-03 8.3706363e-04 4.2562029e-04 9.0996586e-04 1.2837631e-02 4.4942319e-03 2.9592438e-03 -1.6009942e-04 1.6608445e-03 1.7806685e-03 2.7898055e-03 3.0882342e-04 1.4916933e-03 1.9748792e-03 3.2092116e-03 -2.0626412e-03 2.7689389e-03 1.2247231e-03 2.3906249e-03 1.1314194e-03 1.2851449e-03 2.0143621e-03 32 | 9.4286614e-03 1.2644938e-03 1.3984833e-03 3.8520212e-04 2.7724088e-04 7.5010848e-04 1.6981431e-03 1.6073342e-04 4.4431414e-04 7.2842280e-04 1.1786558e-03 6.6958780e-04 2.4412508e-04 7.3581567e-04 1.9098343e-03 -2.7592250e-04 7.6897618e-04 5.4624605e-04 2.3957420e-02 3.2732644e-03 3.7103458e-03 4.4698009e-04 1.2783319e-03 2.1503175e-03 4.3129507e-03 1.9155434e-04 1.7089636e-03 2.1113938e-03 3.1262535e-03 1.0676322e-03 1.2247231e-03 2.0811202e-03 3.8907725e-03 -1.1515060e-03 2.4614733e-03 1.3427013e-03 33 | 1.8014842e-02 1.6906429e-03 2.8557160e-03 4.0065877e-04 5.3729575e-04 1.3042996e-03 3.3027122e-03 2.3186920e-04 7.5167031e-04 1.2872576e-03 2.2466091e-03 1.2154581e-03 3.3661872e-04 1.2180593e-03 3.9134758e-03 -6.6266046e-04 1.4263003e-03 9.5641085e-04 5.1800015e-02 5.5191878e-03 8.5007481e-03 6.4145867e-04 2.8201471e-03 4.3870753e-03 9.6603145e-03 6.0433898e-04 3.4228878e-03 4.4803017e-03 6.6294004e-03 2.0662828e-03 2.3906249e-03 3.8907725e-03 9.4285875e-03 -1.7595913e-03 4.9858627e-03 3.2046624e-03 34 | -3.3283008e-03 -2.9093502e-04 -2.1470734e-05 -1.8244149e-04 5.1718157e-05 -7.5199569e-05 -2.0483781e-04 7.1337978e-05 -9.3629945e-05 -1.5859726e-05 2.8583690e-04 -1.4032063e-03 4.8275935e-04 -3.9794718e-04 -1.0338915e-03 1.4302452e-03 -7.1402339e-04 1.4204509e-04 -7.1736436e-03 -4.1553933e-04 -2.4230623e-04 -3.2086373e-04 1.5393655e-04 -3.6034770e-04 -7.5167149e-04 1.4109197e-04 -3.5734264e-04 -1.8948155e-04 1.7835516e-04 -3.1270104e-03 1.1314194e-03 -1.1515060e-03 -1.7595913e-03 4.0311491e-03 -2.1448665e-03 6.4325321e-04 35 | 1.1545130e-02 1.7410948e-03 1.6774318e-03 5.1042507e-04 3.5802931e-04 9.4296445e-04 2.0048841e-03 2.4182405e-04 5.5820479e-04 9.1007129e-04 1.3777423e-03 9.9981081e-04 2.7081753e-04 9.7166445e-04 2.4866355e-03 -5.5847114e-04 1.0836710e-03 6.9076344e-04 2.8608108e-02 4.0485807e-03 4.1364190e-03 4.4804035e-04 1.4967037e-03 2.4913919e-03 4.8225133e-03 1.9747662e-04 2.0318442e-03 2.4322956e-03 3.2711088e-03 1.4557991e-03 1.2851449e-03 2.4614733e-03 4.9858627e-03 -2.1448665e-03 3.3910700e-03 1.5512895e-03 36 | 6.2631275e-03 1.3865205e-03 1.3732023e-03 3.1402409e-04 3.7528992e-04 7.5885124e-04 1.4099590e-03 3.5263135e-04 3.9011634e-04 7.7783315e-04 1.3184234e-03 -1.2431301e-05 5.7214264e-04 5.8392331e-04 1.3786314e-03 4.3014968e-04 4.7115398e-04 7.1934422e-04 1.6905817e-02 3.5001690e-03 3.5023537e-03 -1.5574692e-05 1.5745541e-03 1.8960688e-03 3.5151723e-03 3.9014784e-04 1.4820314e-03 2.0551706e-03 2.9681093e-03 -8.3164315e-04 2.0143621e-03 1.3427013e-03 3.2046624e-03 6.4325321e-04 1.5512895e-03 1.8979601e-03 37 | -------------------------------------------------------------------------------- /MATLAB code/estimate.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/MATLAB code/estimate.m -------------------------------------------------------------------------------- /MATLAB code/estimateaggdparam.m: -------------------------------------------------------------------------------- 1 | function [alpha betal betar] = estimateaggdparam(vec) 2 | 3 | 4 | gam = 0.2:0.001:10; 5 | r_gam = ((gamma(2./gam)).^2)./(gamma(1./gam).*gamma(3./gam)); 6 | 7 | 8 | leftstd = sqrt(mean((vec(vec<0)).^2)); 9 | rightstd = sqrt(mean((vec(vec>0)).^2)); 10 | 11 | gammahat = leftstd/rightstd; 12 | rhat = (mean(abs(vec)))^2/mean((vec).^2); 13 | rhatnorm = (rhat*(gammahat^3 +1)*(gammahat+1))/((gammahat^2 +1)^2); 14 | [min_difference, array_position] = min((r_gam - rhatnorm).^2); 15 | alpha = gam(array_position); 16 | 17 | betal = leftstd *sqrt(gamma(1/alpha)/gamma(3/alpha)); 18 | betar = rightstd*sqrt(gamma(1/alpha)/gamma(3/alpha)); 19 | 20 | 21 | -------------------------------------------------------------------------------- /MATLAB code/estimatemodelparam.m: -------------------------------------------------------------------------------- 1 | function [mu_prisparam cov_prisparam] = estimatemodelparam(folderpath,... 2 | blocksizerow,blocksizecol,blockrowoverlap,blockcoloverlap,sh_th) 3 | 4 | % Input 5 | % folderpath - Folder containing the pristine images 6 | % blocksizerow - Height of the blocks in to which image is divided 7 | % blocksizecol - Width of the blocks in to which image is divided 8 | % blockrowoverlap - Amount of vertical overlap between blocks 9 | % blockcoloverlap - Amount of horizontal overlap between blocks 10 | % sh_th - The sharpness threshold level 11 | %Output 12 | %mu_prisparam - mean of multivariate Gaussian model 13 | %cov_prisparam - covariance of multivariate Gaussian model 14 | 15 | % Example call 16 | 17 | %[mu_prisparam cov_prisparam] = estimatemodelparam('pristine',96,96,0,0,0.75); 18 | 19 | 20 | %---------------------------------------------------------------- 21 | % Find the names of images in the folder 22 | current = pwd; 23 | cd(sprintf('%s',folderpath)) 24 | names = ls; 25 | names = names(3:end,:); 26 | cd(current) 27 | % --------------------------------------------------------------- 28 | %Number of features 29 | % 18 features at each scale 30 | featnum = 18; 31 | % --------------------------------------------------------------- 32 | % Make the directory for storing the features 33 | mkdir(sprintf('local_risquee_prisfeatures')) 34 | % --------------------------------------------------------------- 35 | % Compute pristine image features 36 | for itr = 1:size(names,1) 37 | itr 38 | im = imread(sprintf('%s\\%s',folderpath,names(itr,:))); 39 | if(size(im,3)==3) 40 | im = rgb2gray(im); 41 | end 42 | im = double(im); 43 | [row col] = size(im); 44 | block_rownum = floor(row/blocksizerow); 45 | block_colnum = floor(col/blocksizecol); 46 | im = im(1:block_rownum*blocksizerow, ... 47 | 1:block_colnum*blocksizecol); 48 | window = fspecial('gaussian',7,7/6); 49 | window = window/sum(sum(window)); 50 | scalenum = 2; 51 | warning('off') 52 | 53 | feat = []; 54 | 55 | 56 | for itr_scale = 1:scalenum 57 | 58 | 59 | mu = imfilter(im,window,'replicate'); 60 | mu_sq = mu.*mu; 61 | sigma = sqrt(abs(imfilter(im.*im,window,'replicate') - mu_sq)); 62 | structdis = (im-mu)./(sigma+1); 63 | 64 | 65 | 66 | feat_scale = blkproc(structdis,[blocksizerow/itr_scale blocksizecol/itr_scale], ... 67 | [blockrowoverlap/itr_scale blockcoloverlap/itr_scale], ... 68 | @computefeature); 69 | feat_scale = reshape(feat_scale,[featnum .... 70 | size(feat_scale,1)*size(feat_scale,2)/featnum]); 71 | feat_scale = feat_scale'; 72 | 73 | 74 | if(itr_scale == 1) 75 | sharpness = blkproc(sigma,[blocksizerow blocksizecol], ... 76 | [blockrowoverlap blockcoloverlap],@computemean); 77 | sharpness = sharpness(:); 78 | end 79 | 80 | 81 | feat = [feat feat_scale]; 82 | 83 | im =imresize(im,0.5); 84 | 85 | end 86 | 87 | save(sprintf('local_risquee_prisfeatures\\prisfeatures_local%d.mat',... 88 | itr),'feat','sharpness'); 89 | end 90 | 91 | 92 | 93 | %---------------------------------------------- 94 | % Load pristine image features 95 | prisparam = []; 96 | current = pwd; 97 | cd(sprintf('%s','local_risquee_prisfeatures')) 98 | names = ls; 99 | names = names(3:end,:); 100 | cd(current) 101 | for itr = 1:size(names,1) 102 | % Load the features and select the only features 103 | load(sprintf('local_risquee_prisfeatures\\%s',strtrim(names(itr,:)))); 104 | IX = find(sharpness(:) >sh_th*max(sharpness(:))); 105 | feat = feat(IX,:); 106 | prisparam = [prisparam; feat]; 107 | 108 | end 109 | %---------------------------------------------- 110 | % Compute model parameters 111 | mu_prisparam = nanmean(prisparam); 112 | cov_prisparam = nancov(prisparam); 113 | %---------------------------------------------- 114 | % Save features in the mat file 115 | save('modelparameters_new.mat','mu_prisparam','cov_prisparam'); 116 | %---------------------------------------------- 117 | -------------------------------------------------------------------------------- /MATLAB code/example.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/MATLAB code/example.m -------------------------------------------------------------------------------- /MATLAB code/modelparameters.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/MATLAB code/modelparameters.mat -------------------------------------------------------------------------------- /MATLAB code/modelparameters_new.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/MATLAB code/modelparameters_new.mat -------------------------------------------------------------------------------- /MATLAB code/mu.txt: -------------------------------------------------------------------------------- 1 | 1.9416538e+00 7.5953459e-01 6.8559050e-01 8.6956265e-02 7.0897891e-02 1.1319038e-01 6.9641403e-01 8.6775377e-02 7.3369356e-02 1.1696280e-01 7.3562217e-01 -4.5633025e-03 1.0655068e-01 1.0452362e-01 7.2519910e-01 1.6531556e-02 9.7733556e-02 1.0670715e-01 2.1423213e+00 8.3108325e-01 6.6569683e-01 6.4274479e-02 7.9743105e-02 1.0636142e-01 6.9834163e-01 6.1805199e-02 8.8558142e-02 1.1890419e-01 7.4490045e-01 -3.8170486e-02 1.3259869e-01 1.1010126e-01 7.3708145e-01 -3.9373293e-03 1.1977821e-01 1.1487287e-01 2 | -------------------------------------------------------------------------------- /MATLAB code/readme.txt: -------------------------------------------------------------------------------- 1 | NIQE Software release. 2 | 3 | ======================================================================= 4 | -----------COPYRIGHT NOTICE STARTS WITH THIS LINE------------ 5 | Copyright (c) 2011 The University of Texas at Austin 6 | All rights reserved. 7 | 8 | Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, 9 | modify, and distribute this code (the source files) and its documentation for 10 | any purpose, provided that the copyright notice in its entirety appear in all copies of this code, and the 11 | original source of this code, Laboratory for Image and Video Engineering (LIVE, http://live.ece.utexas.edu) 12 | and Center for Perceptual Systems (CPS, http://www.cps.utexas.edu) at the University of Texas at Austin (UT Austin, 13 | http://www.utexas.edu), is acknowledged in any publication that reports research using this code. The research 14 | is to be cited in the bibliography as: 15 | 16 | 1) A. Mittal, R. Soundararajan and A. C. Bovik, "NIQE Software Release", 17 | URL: http://live.ece.utexas.edu/research/quality/niqe.zip, 2012. 18 | 19 | 2) A. Mittal, R. Soundararajan and A. C. Bovik, "Making a Completely Blind Image Quality Analyzer", submitted to IEEE Signal Processing Letters, 2012. 20 | 21 | IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT AUSTIN BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, 22 | OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS DATABASE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF TEXAS 23 | AT AUSTIN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | THE UNIVERSITY OF TEXAS AT AUSTIN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE DATABASE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, 27 | AND THE UNIVERSITY OF TEXAS AT AUSTIN HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 28 | 29 | -----------COPYRIGHT NOTICE ENDS WITH THIS LINE------------% 30 | 31 | Author : Anish Mittal 32 | Version : 1.0 33 | 34 | The authors are with the Laboratory for Image and Video Engineering 35 | (LIVE), Department of Electrical and Computer Engineering, The 36 | University of Texas at Austin, Austin, TX. 37 | 38 | Kindly report any suggestions or corrections to mittal.anish@gmail.com 39 | 40 | ======================================================================= 41 | 42 | This is a demonstration of the Naturalness Image Quality Evaluator(NIQE) index. The algorithm is described in: 43 | 44 | A. Mittal, R. Soundararajan and A. C. Bovik, "Making a Completely Blind Image Quality Analyzer", submitted to IEEE Signal Processing Letters, 2012. 45 | 46 | You can change this program as you like and use it anywhere, but please 47 | refer to its original source (cite our paper and our web page at 48 | http://live.ece.utexas.edu/research/quality/niqe_release.zip). 49 | 50 | ======================================================================= 51 | Running on Matlab 52 | 53 | Input : A test image loaded in an array 54 | 55 | Output: A quality score of the image. Higher value represents a lower quality. 56 | 57 | Usage: 58 | 59 | 1. Load the image, for example 60 | 61 | image = imread('testimage1.bmp'); 62 | 63 | 2. Load the parameters of pristine multivariate Gaussian model. 64 | 65 | 66 | load modelparameters.mat; 67 | 68 | 69 | The images used for making the current model may be viewed at http://live.ece.utexas.edu/research/quality/pristinedata.zip 70 | 71 | 72 | 3. Initialize different parameters 73 | 74 | Height of the block 75 | blocksizerow = 96; 76 | Width of the block 77 | blocksizecol = 96; 78 | Verical overlap between blocks 79 | blocksizerow = 0; 80 | Horizontal overlap between blocks 81 | blocksizecol = 0; 82 | 83 | For good performance, it is advisable to divide the distorted image in to same size patched as used for the construction of multivariate Gaussian model. 84 | 85 | 3. Call this function to calculate the quality score: 86 | 87 | 88 | qualityscore = computequality(im,blocksizerow,blocksizecol,blockrowoverlap,blockcoloverlap,mu_prisparam,cov_prisparam) 89 | 90 | Sample execution is also shown through example.m 91 | 92 | 93 | ======================================================================= 94 | 95 | MATLAB files: (provided with release): example.m, computefeature.m, computemean.m, computequality.m, estimateaggdparam.m and estimatemodelparam.m 96 | 97 | Image Files: image1.bmp, image2.bmp, image3.bmp and image4.bmp 98 | 99 | Dependencies: Mat file: modelparameters.mat provided with release 100 | 101 | ======================================================================= 102 | 103 | Note on training: 104 | This release version of NIQE was trained on 125 pristine images with patch size set to 96X96 and sharpness threshold of 0.75. 105 | 106 | Training the model 107 | 108 | If the user wants to retrain the model using different set of pristine image or set the patch sizes to different values, he/she can do so 109 | use the following function. The images used for making the current model may be viewed at http://live.ece.utexas.edu/research/quality/pristinedata.zip 110 | 111 | Folder containing the pristine images 112 | folderpath = 'pristine' 113 | Height of the block 114 | blocksizerow = 96; 115 | Width of the block 116 | blocksizecol = 96; 117 | Verical overlap between blocks 118 | blocksizerow = 0; 119 | Horizontal overlap between blocks 120 | blocksizecol = 0; 121 | The sharpness threshold level 122 | sh_th = 0.75; 123 | 124 | 125 | [mu_prisparam cov_prisparam] = estimatemodelparam(folderpath,blocksizerow,blocksizecol,blockrowoverlap,blockcoloverlap,sh_th) 126 | ======================================================================= 127 | -------------------------------------------------------------------------------- /NIQE.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huping96/niqe-C-MATLAB-code/ff86b2741b714f1c31cbd628a5196a101173779d/NIQE.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # niqe-C-MATLAB-code 2 | 3 | Paper name: Making a "Completely Blind" Image Quality Analyzer 4 | 5 | Author: Anish Mittal, Rajiv Soundararajan, and Alan C. Bovik 6 | 7 | Year: 2013 8 | 9 | It contains the C++ code and MATLAB code of the niqe algorithm. The MATLAB code contains the training code and the test code, and the C++ code only contains the test code. Therefore, when running the C++ test code, you need to import the mu.txt and cov.txt obtained by MATLAB. 10 | 11 | The included mu.txt and cov.txt files are obtained by MATLAB training my private data set. Because the algorithm needs to be in the same environment and the same lighting conditions for the training set and test image, it could get higher accuracy, so the two txt files are of little use to you. So, please train your own data set on MATLAB code in order to get correct results. 12 | 13 | My highest accuracy rate is 97.15%. 14 | 15 | Environment: C++: OpenCV4.1,Visual Studio 2015 MATLAB: MATLAB 2018b 16 | 17 | C++ code: Open NIQE.sln to run 18 | 19 | If you have any questions, or have any suggestions for improvement of my code, you can contact me at any time. 20 | 21 | My email: huping199609@163.com 22 | 23 | If you want to learn more about this paper, you can read my CSDN blog, which explains the niqe algorithm in detail. 24 | 25 | https://blog.csdn.net/weixin_45682889/article/details/108739906 26 | --------------------------------------------------------------------------------