www.gusucode.com > matlab编程人眼疲劳源码程序 > matlab编程人眼疲劳源码程序/matlab人眼疲劳/match_DB.m

    function c1 =match_DB(Leye,DBL)


MS1 = [];
for tt = 1:length(DBL)
    It = DBL{1,tt};
    if ~isempty(It)
        % Calculate correlation coefficient
        MS1 = [MS1 corr2(It,Leye)];
    else
        break;
    end
end

MS2 = [];
for tt = 1:length(DBL)
    % Obtain the image
    It = DBL{2,tt};

    if ~isempty(It)
        % 相关系数
        MS2 = [MS2 corr2(It,Leye)];
    else
        break;
    end
end

% 均值
M(1) = mean(MS1);
M(2) = mean(MS2);
c1 = find(M == max(M));