視覺顯著性

1、視覺顯著性的綜述

  視覺顯著性和相關的認知神經學在過去幾十年裏已經得到普遍的研究,人類的視覺注意機制可以將有限的認知資源彙集於場景中重要的刺激而抑制那些不重要的信息。在計算機視覺領域,有關顯著性的研究在於提出模擬人類視覺注意機制的模型。現有的顯著性檢測的方法有基於層次的、基於頻譜的、基於熵的和基於圖像對比度的方法。基於層次的方法採用的是多尺度的圖像處理,而後不一樣層次的結果彙集起來成爲最後的顯著性映射。基於頻譜的方法是把圖像分解成Fourier或者Gabor頻譜,顯著性映射經過選擇那些重要的頻譜系數來構成的。基於圖像對比度的方法是利用指定的子窗口的均值像素亮度值來計算圖像中每一個像素的對比度,而後由對比度模擬出圖像的顯著性。app

2、基於隨機抽樣的視覺顯著性計算方法

  本文的顯著性計算方法是先將圖像抽樣成一些隨機的感興趣區域 (Region of Interest,ROI),而後在這些區域上計算的,其流程如圖3. 7所示,對於一幅圖像如RGB,第一步用高斯濾波器進行濾波並將RGB空間轉換成Lab空間;第二步隨機生成n個窗口,對於每一個窗口,計算出面積與灰度和的比,即:dom

                  Eqn062(3.9)ide

而後依據下式計算窗口中每一個像素Eqn063 的顯著性映射:函數

                 Eqn064(3.10)ui

第二步是在三個通道上分別進行的,因此最後的顯著性映射要採用歐式距離把顏色空間的顯著值融合在一塊兒。this

                  Eqn065(3.11)spa

採用這種方法的理由主要是它僅須要調節一個參數,運算時間中等,而且可以在原圖上進行操做。3d

                image

3、matlab源碼

 

  主程序rest

close all; clear all; clc; [fn,pn,fi]=uigetfile('*.*','choose a picture'); img=(imread([pn fn])); %% 顯著性計算 Iseg_gray = Random_Center_Surround_Saliency(img); %% 畫圖 figure(1);imshow(img); figure; imshow(Iseg_gray); caxis([0 max(max(Iseg_gray))]); axis image, colormap('jet'), colorbar; axis normal;

  顯著性計算函數:Random_Center_Surround_Saliencycode

%---------------------------------------------------------- % Vikram T N, Tscherepanow M and Wrede B. A saliency map based on sampling an image into random rectangular regions of interest % Pattern Recognition (Inpress). % http://www.sciencedirect.com/science/article/pii/S0031320312000714?v=s5 %----------------------------------------------------------


function [SM] = Random_Center_Surround_Saliency(img) %--------------------------------------------------------- % Clean the input image for any noise using a Gaussian filter %--------------------------------------------------------- gfrgb = imfilter(img, fspecial('gaussian', 3, 3), 'symmetric', 'conv'); %--------------------------------------------------------- % Perform sRGB to CIE Lab color space conversion (using D65) %--------------------------------------------------------- %cform = makecform('srgb2lab', 'AdaptedWhitePoint', whitepoint('d65')); cform = makecform('srgb2lab'); 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)); a = double(lab(:,:,2)); b = double(lab(:,:,3)); [r,c] = size(l); %--------------------------------------------------------- %Initialize the saliency map vectors for L,a and b channels %--------------------------------------------------------- Map_L(1:r,1:c) = 0.0; Map_a(1:r,1:c) = 0.0; Map_b(1:r,1:c) = 0.0; Map_Points(1:r,1:c) = 0.0; %--------------------------------------------------------- % n = the number of random rectangles that are in consideration % n = 1000 should be enough in most cases % Details of the algorithm are given in the Pattern Recognition article %--------------------------------------------------------- n = 1000; for i=1:n x1 = floor(rand()*(r-1))+1; y1 = floor(rand()*(c-1))+1; x2 = floor(rand()*(r-1))+1; y2 = floor(rand()*(c-1))+1; if(x2 <r && y2 < c && x1 > 0 && y1 > 0) l1 = x1; u1 = y1; l2 = x2; u2 = y2; if(x1>x2) l1 = x2; l2 = x1; end if(y1>y2) u1 = y2; u2 = y1; end ml = mean2(l(l1:l2,u1:u2)); Map_L(l1:l2,u1:u2) = Map_L(l1:l2,u1:u2) + abs((l(l1:l2,u1:u2) - ml)); ma = mean2(a(l1:l2,u1:u2)); Map_a(l1:l2,u1:u2) = Map_a(l1:l2,u1:u2) + abs((a(l1:l2,u1:u2) - ma)); mb = mean2(b(l1:l2,u1:u2)); Map_b(l1:l2,u1:u2) = Map_b(l1:l2,u1:u2) + abs((b(l1:l2,u1:u2) - mb)); end end %--------------------------------------------------------- % Fusion of the saliency values from the different channels %--------------------------------------------------------- sm1 = ((Map_L).^(2) + (Map_a).^(2) + (Map_b).^(2)).^(1/2); %--------------------------------------------------------- % Median filtering to distribute saliency values %--------------------------------------------------------- sm1 = medfilt2(sm1,[11 11]); %--------------------------------------------------------- % Normalize the final saliency map (SM) in [0,255] %--------------------------------------------------------- SM = uint8(((sm1 - min(sm1(:)))/(max(sm1(:))))*255); %--------------------------------------------------------- % Perform histogram equalization only if necessary(depending on input image) SM = histeq(SM); %--------------------------------------------------------- end

imageimage

參考文獻:

Vikram T N, Tscherepanow M, Wrede B. A saliency map based on sampling an image into random rectangular regions of interest[J]. Pattern Recognition, 2012, 45(9): 3114-3124.

相關文章
相關標籤/搜索