I. Source code



clear all

clc

Im = imread (‘ 1. BMP ‘);

quality = CCF(im)

function [quality] = CCF(im)

%————-CCF_colorfulness —————–

imColor = double(im);

R = imColor(:,:,1); G = imColor(:,:,2); B = imColor(:,:,3); RR = log(R+0.00001) -mean2 (log(R+0.00001)); GG = log(G+0.00001) -mean2 (log(G+0.00001)); BB = log(B+0.00001) -mean2 (log(B+0.00001)); alpha = RR-GG; Beta = 0.5 * (RR + GG) - BB; mu_alpha=mean(mean(alpha)); mu_beta=mean(mean(beta)); var_alpha=var(var(alpha)); var_beta=var(var(beta)); CCF_colorfulness = 1000 * ((SQRT (var_alpha + var_beta) + 0.3 * SQRT (mu_alpha + mu_beta mu_alpha * * mu_beta)) / 85.59);Copy the code

%————-CCF_contrast———————-

im1=rgb2gray(im);
CCF_contrast = CCFcontrast(im1);
Copy the code

%————-CCF_FADE————————–

CCF_FADE = FADE(im);
Copy the code

%———— normalization ——————

CCF_colorfulness = mapminmax (CCF_colorfulness, 1, 10); CCF_contrast = mapminmax (CCF_contrast, 1, 10); CCF_FADE = 10 - mapminmax (CCF_FADE, 1, 10);Copy the code

% ————calculate image quality with coefficients———————

C = 0.33988 [0.17593 0.61759]; quality = c(1)*(CCF_colorfulness) + c(2)*(CCF_contrast) + c(3)*(CCF_FADE)Copy the code

end

Ii. Note Version: 2014ACopy the code