# 【图像算法】图像特征：三个图像显著性区域特征提取方法

-------------------------------------------------------------------------------------------------------------------------

【图像算法】图像特征：三个图像显著性区域特征提取方法

SkySeraph Aug 11st 2011  HQU

Email：zgzhaobo@gmail.com    QQ：452728574

Latest Modified Date：Aug 11st 2011  HQU

-------------------------------------------------------------------------------------------------------------------------

》第一种方法：

%---------------------------------------------------------
% Read image and blur it with a 3x3 or 5x5 Gaussian filter
%---------------------------------------------------------
img = imread('input_image.jpg');%Provide input image path
gfrgb = imfilter(img, fspecial('gaussian', 3, 3), 'symmetric', 'conv');
%---------------------------------------------------------
% Perform sRGB to CIE Lab color space conversion (using D65)
%---------------------------------------------------------
cform = makecform('srgb2lab', 'whitepoint', whitepoint('d65'));
lab = applycform(gfrgb,cform);
%---------------------------------------------------------
% Compute Lab average values (note that in the paper this
% average is found from the unblurred original image, but
% the results are quite similar)
%---------------------------------------------------------
l = double(lab(:,:,1)); lm = mean(mean(l));
a = double(lab(:,:,2)); am = mean(mean(a));
b = double(lab(:,:,3)); bm = mean(mean(b));
%---------------------------------------------------------
% Finally compute the saliency map and display it.
%---------------------------------------------------------
sm = (l-lm).^2 + (a-am).^2 + (b-bm).^2;
imshow(sm,[]);
%--------------------------------------------------------


------------------------------------------------------------------------------------------------------------------------------

》第二种方法：

Y. Zhai and M. Shah. Visual attention detection in video sequences using spatiotemporal cues. In ACM Multimedia, pages 815–824. ACM,2006.

------------------------------------------------------------------------------------------------------------------------------

》第三种方法：

clear
clc

inImg = imresize(inImg, 64/size(inImg, 2));

%% Spectral Residual
myFFT = fft2(inImg);
myLogAmplitude = log(abs(myFFT));
myPhase = angle(myFFT);
mySpectralResidual = myLogAmplitude - imfilter(myLogAmplitude, fspecial('average', 3), 'replicate');
saliencyMap = abs(ifft2(exp(mySpectralResidual + i*myPhase))).^2;

%% After Effect
saliencyMap = mat2gray(imfilter(saliencyMap, fspecial('gaussian', [10, 10], 2.5)));
imshow(saliencyMap);



SYNC （www.skyseraph.com）

------------------------------------------------------------------------------------------------------------------------------

Author:         SKySeraph

Email/GTalk: zgzhaobo@gmail.com    QQ：452728574

From：         http://www.cnblogs.com/skyseraph/

-----------------------------------------------------------------------------------------------------------------------------

posted @ 2011-08-11 17:21 SkySeraph 阅读(...) 评论(...) 编辑 收藏