这是调用代码,MATLAB实现计算两个图像之间结构相似度(SSIM)指数的程序:
clc;
img1= imread('C:\dataset\image_0001.jpg');
img2= imread('C:\dataset\image_0002.jpg');
[mssim ssim_map] = ssim_index(img1, img2);
这是源程序
function [mssim, ssim_map] = ssim(img1, img2, K, window, L)
%========================================================================
%SSIM Index, Version 1.0
%Copyright(c) 2003 Zhou Wang
%All Rights Reserved.
%
%The author is with Howard Hughes Medical Institute, and Laboratory
%for Computational Vision at Center for Neural Science and Courant
%Institute of Mathematical Sciences, New York University.
%
%----------------------------------------------------------------------
%Permission to use, copy, or modify this software and its documentation
%for educational and research purposes only and without fee is hereby
%granted, provided that this copyright notice and the original authors'
%names ap pearon all copies and supporting documentation. This program
%shall not be used, rewritten, or adapted as the basis of a commercial
%software or hardware product without first obtaining permission of the
%authors. The authors make no representations about the suitability of
%this software for any purpose. It