In: Electrical Engineering
Given a tumorous brain image .take out the t umour using ittikoch saliency detection method
Given a tumorous brain image .take out the tumour using ittikoch saliency detection method
need matlab code
if you know then do or else leave it for other.dont try if you dnt know
Image processing.electrical
%%% demonstration of how to use simpsal,
%%% the simple matlab implemenation of visual saliency.
%% 1. simplest possible usage : compute standard Itti-Koch Algorithm:
%% 2. more complciated usage:
% [I, cmap] = imread('032.gif','frames','all');
% img=ind2rgb(I,cmap);
img = imread('c.jpg');
p = default_fast_param;
map1 = simpsal(img,p);
p.blurRadius = 0.005; % e.g. we can change blur radius
map2 = simpsal(img,p);
subplot(1,3,1);
imshow(img);
title('Original');
subplot(1,3,2);
imshow(map1)
title('Itti Koch');
subplot(1,3,3);
imshow(map2);
title('Itti Koch Simplified');
function result = attenuateBordersGBVS(data,borderSize)
% attentuateBorders - linearly attentuates the border of
data.
%
% result = attenuateBorders(data,borderSize)
% linearly attenuates a border region of borderSize
% on all sides of the 2d data array
% This file is part of the SaliencyToolbox - Copyright (C)
2006
% by Dirk Walther and the California Institute of Technology.
% The Saliency Toolbox is released under the GNU General
Public
% License. See the enclosed COPYRIGHT document for details.
% For more information about this project see:
% http://www.saliencytoolbox.net
result = data;
dsz = size(data);
if (borderSize * 2 > dsz(1)) borderSize = floor(dsz(1) / 2);
end
if (borderSize * 2 > dsz(2)) borderSize = floor(dsz(2) / 2);
end
if (borderSize < 1) return; end
bs = [1:borderSize];
coeffs = bs / (borderSize + 1);
% top and bottom
rec = repmat(coeffs,1,dsz(2));
result(bs,:) = result(bs,:) .* rec;
range = dsz(1) - bs + 1;
result(range,:) = result(range,:) .* rec;
% left and right
rec = repmat(coeffs,dsz(1),1);
result(:,bs) = result(:,bs) .* rec;
range = dsz(2) - bs + 1;
result(:,range) = result(:,range) .* rec;
function param = default_fast_param()
param = {};
% Note "classic Itti" refers to "A model of saliency-based visual attention for rapid scene analysis" in PAMI
%%%%%%%%% scale parameters %%%%%%%%%%%%%%%
param.mapWidth = 64; % this controls the size of the 'Center' scale
param.useMultipleCenterScales = 0; % classic Itti Algorithm uses multiple scales ( "c \in {2,3,4}" ). but here we default to just 1.
param.surroundSig = 5; % this is the standard deviation of the
Gaussian blur applied to obtain the 'surround' scale(s).
% default : one surround scale works fine in my experience. with
sigma = 5.
% this can also be an array of surround sigmas, e.g. [ 4 6 ]
% Note: in classic Itti algorithm, we have ( "delta \in {3,4}\"
).
% .. **I think** this should correspond to roughly surroundSig =
[sqrt(2^3) sqrt(2^4)]
%%%%%%%% normalize maps according to peakiness ? %%%%%
param.useNormWeights = 0; % 0 = do not weight maps differently ,
1 = weight according to peakiness
% in classic Itti algorithm, this is used with local maxima
normalization.
param.subtractMin = 1; % 1 => (subtract min, divide by max) ; 0 => (just divide by max)
%%%%%%%%% channel parameters %%%%%%%%%%%%%
param.channels = 'DI'; % can include following characters: C or
D (color), O (orientation), I (intensity), F or X (flicker), M
(motion)
% (D is in DKL color space, C is RG , BY color space)
% e.g. use 'IO' to include only intensity and orientation
channels.
% note (F or X) and M require temporal input.
param.nGaborAngles = 4; % number of oriented gabors if there is
an 'O' channel
% as an example, 4 implies => 0 , 45 , 90 , 135 degrees
% for video
param.flickmotionT = [1 2 4]; % this is the (number of frames
difference) .. e.g., 1 means subtract previous frame from current
one.
% see getchan.m to understand how this is used.
param.nMotionAngles = 4; % number of motion directions if there is an 'M' channel
%%%%%%%%% final operations on saliency map %%%%
param.centerbias = 0; % apply global center bias (0 =no,
1=yes)
% (using center bias tends to improve predictive performance)
param.blurRadius = 0.04; % blur final saliency map (sigma=0.04
works well in my experience).
% NOTE: ROC and NSS Scores are VERY sensitive to saliency map
blurring. This is
% highly suggested.
function param = default_pami_param()
param = default_fast_param;
param.mapWidth = 64;
% DIO is better, but change to CIO for more faithful
implementation
param.channels = 'CIO';
param.useMultipleCenterScales = 1;
param.surroundSig = [ 2 8 ];
param.useNormWeights = 1;
function b = padImage( a , vpad , hpad )
if ( nargin == 2 )
hpad = vpad;
end
u = repmat( a(1,:) , [ vpad 1 ] );
b = repmat( a(end,:) , [ vpad 1 ] );
l = repmat( a(:,1) , [ 1 hpad ] );
r = repmat( a(:,end) , [ 1 hpad ] );
ul = repmat( a(1,1) , [ vpad hpad ] );
ur = repmat( a(1,end) , [ vpad hpad ] );
bl = repmat( a(end,1) , [ vpad hpad ] );
br = repmat( a(end,end) , [ vpad hpad ] );
b = [ ul u ur
l a r
bl b br ];
If you are having any doubt plz comment below.