function [score, SimMatrix] = GFM(Im1,Im2)
% ========================================================================
% GFM Index for SCI, Version 1.0
% Copyright(c) 2017 Zhangkai Ni, Huanqiang Zeng, Lin Ma, Junhui Hou,
% Jing Chen, and Kai-Kuang Ma
% All Rights Reserved.
%
% ----------------------------------------------------------------------
% Permission to use, copy, or modify this software and its documentation
% for educational and research purposes only and without fee is here
% granted, provided that this copyright notice and the original authors'
% names appear on 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 is provided "as is" without express
% or implied warranty.
%----------------------------------------------------------------------
%
% This is an implementation of the algorithm for calculating the
% Gabor features-basedmodel (GFM) index between two images.
%
% Please refer to the following paper
%
% Z. Ni, H. Zeng, L. Ma, J. Hou, J. Chen, and K.-K. Ma, ��A Gabor
% Feature-based Quality Assessment Model for the Screen Content Images,��
% IEEE Transactions on Image Processing, 2018.
%
%----------------------------------------------------------------------
%
%Input : (1) Im1: the first image being compared, which is a RGB image
% (2) Im2: the second image being compared, which is a RGB image
%
%Output: (1) score: is the similarty score calculated using GFM algorithm.
% GFM considers the luminance component and chrominance component of images.
%
% (2) SimMatrix: is the local quality map of the distorted image
%
%-----------------------------------------------------------------------
%
%Usage:
%Given 2 test images img1 and img2. For gray-scale images, their dynamic range should be 0-255.
%For colorful images, the dynamic range of each color channel should be 0-255.
%
%[score, SimMatrix] = GFM(img1, img2);
%-----------------------------------------------------------------------
%%%%% Transform into an opponent color space
L1 = 0.06 * double(Im1(:,:,1)) + 0.63 * double(Im1(:,:,2)) + 0.27 * double(Im1(:,:,3));
L2 = 0.06 * double(Im2(:,:,1)) + 0.63 * double(Im2(:,:,2)) + 0.27 * double(Im2(:,:,3));
M1 = 0.30 * double(Im1(:,:,1)) + 0.04 * double(Im1(:,:,2)) - 0.35 * double(Im1(:,:,3));
M2 = 0.30 * double(Im2(:,:,1)) + 0.04 * double(Im2(:,:,2)) - 0.35 * double(Im2(:,:,3));
N1 = 0.34 * double(Im1(:,:,1)) - 0.60 * double(Im1(:,:,2)) + 0.17 * double(Im1(:,:,3));
N2 = 0.34 * double(Im2(:,:,1)) - 0.60 * double(Im2(:,:,2)) + 0.17 * double(Im2(:,:,3));
%%%%%%%%%%%%%%%%
To = 330;
Tc = 100;
lambda = 0.04;
a2 = oddspatialgabor(L1,5,0,0.43,0.03);
a5 = oddspatialgabor(L1,5,90,0.43,0.03);
GO1 = a2 + a5;
b2 = oddspatialgabor(L2,5,0,0.43,0.03);
b5 = oddspatialgabor(L2,5,90,0.43,0.03);
GO2 = b2 + b5;
Pm = max(abs(GO1), abs(GO2));
GoSimMatrix = (2 * GO1 .* GO2 + To) ./(GO1.^2 + GO2.^2 + To);
ISimMatrix = (2 * M1 .* M2 + Tc) ./ (M1.^2 + M2.^2 + Tc);
QSimMatrix = (2 * N1 .* N2 + Tc) ./ (N1.^2 + N2.^2 + Tc);
SimMatrix = GoSimMatrix .* real((ISimMatrix .* QSimMatrix) .^ lambda);
score = sum(SimMatrix(:).* Pm(:))/sum(Pm(:));
基于Gabor特征的屏幕内容图像质量评估模型Matlab源码.zip
版权申诉
5星 · 超过95%的资源 142 浏览量
2022-10-21
12:32:56
上传
评论 1
收藏 3.62MB ZIP 举报
天天Matlab科研工作室
- 粉丝: 3w+
- 资源: 7249
最新资源
- Java课设相关材料.zip
- JSP搜索引擎的研究与实现(源代码)
- delphi 12 控件之delphipi.0.85.setup.exe
- 数据库管理工具:dbeaver-ce-23.0.2-amd64.deb
- 搜索链接淘特搜索引擎共享版-tot-search-engine
- 数据库管理工具:dbeaver-ce-24.0.3-macos-x86-64.dmg
- 数据库管理工具:dbeaver-ce-24.0.1-x86-64-setup.exe
- GoogleCloud2024年数据和AI趋势报告+生成式AI+数据治理
- delphi 12 控件之EhLib 11.0.21 - D12.7z
- 基于JAVA+VUE的论坛网站
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈