码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2016-05-04 21:04:13      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:

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

 SkySeraph Aug 11st 2011  HQU

Email:zgzhaobo@gmail.com    QQ:452728574

Latest Modified Date:Aug 11st 2011  HQU

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

 

》第一种方法:

原理:Frequency-tuned Salient Region Detection.CVPR.2009

定义:

技术分享

简述

三步,滤波+颜色空间转换+计算SaliencyMap(见源码)

效果

待测试图(后同)

技术分享

结果1:(原作者代码测试结果)

 

技术分享

 

结果2:(我用OpenCV改写的代码测试结果)

 

技术分享

 

结果3:(我的改进测试(空间选择不同))

技术分享

源码(matlab):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
%---------------------------------------------------------
% 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.

定义:

技术分享

效果:

技术分享

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

》第三种方法:

原理:http://www.klab.caltech.edu/~xhou/projects/spectralResidual/spectralresidual.html

源码(matlab):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
clear
clc
 
%% Read image from file
inImg = im2double(rgb2gray(imread(‘yourImage.jpg‘)));
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);

 

效果: 

技术分享

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

 

Author:         SKySeraph

 

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

 

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

 

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.

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

标签:

原文地址:http://www.cnblogs.com/GarfieldEr007/p/5459634.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!