how to detect proto objects in a saliency map?
Afficher commentaires plus anciens
In sum, given an image I(x), we have: A(f) = ℜ(fft(I(x))), P(f) = ℑ(fft(I(x))), L(f) = log (A(f)), R(f) = L(f) − h(f) ∗ L(f), S(x) = g(x) ∗ ifft(exp (R(f) + P(f)))^2 where fft and ifft denote the Fourier Transform and Inverse Fourier Transform, respectively. A(f), P(f), L(f), R(f) denotes the amplitude spectrum, phase spectrum, log spectrum and spectral residual of the image.
Given S(x) of an image, the object map O(x) is obtained: O(x) = 1 if S(x) > threshold, 0 otherwise. Empirically, we set threshold = E(S(x)) × 3, where E(S(x)) is the average intensity of the saliency map. The selection of threshold is a trade-off problem between false alarm and neglect of objects. Please help me with the matlab code for the above object map.
The code that i used to find saliency map is given below: %% Read image from file inImg = imread('img.jpg'); inImg = im2double(rgb2gray(inImg)); inImg = imresize(inImg, [64, 64], 'bilinear'); %% Spectral Residual myFFT = fft2(inImg); myLogAmplitude = log(abs(myFFT)); myPhase = angle(myFFT); mySmooth = imfilter(myLogAmplitude, fspecial('average', 3), 'replicate'); mySpectralResidual = myLogAmplitude - mySmooth; saliencyMap = abs(ifft2(exp(mySpectralResidual + i*myPhase))).^2; %% After Effect saliencyMap = imfilter(saliencyMap, fspecial('disk', 3)); saliencyMap = mat2gray(saliencyMap); imshow(saliencyMap, []);
Réponses (0)
Catégories
En savoir plus sur Image Category Classification dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!