convexplpiccis.m~

来自「matlab的一些函数功能」· M~ 代码 · 共 36 行

M~
36
字号
% Function to create images for the convolution explanation

function convexplpiccis

rows = 128; cols = 128;
wavelength = 8;
sigmaOnf = 0.55;

  [x,y] = meshgrid([-cols/2:(cols/2-1)]/cols,...
                   [-rows/2:(rows/2-1)]/rows);
  radius = sqrt(x.^2 + y.^2);       % Matrix values contain *normalised* radius 
                                    % values ranging from 0 at the centre to 
                                    % 0.5 at the boundary.
  radius(rows/2+1, cols/2+1) = 1;   % Get rid of the 0 radius value in the middle 
                                    % so that taking the log of the radius will 
                                    % not cause trouble.



  fo = 1.0/wavelength;                  % Centre frequency of filter.

  % The following implements the log-gabor transfer function.
  logGabor = exp((-(log(radius/fo)).^2) / (2 * log(sigmaOnf)^2));  
  logGabor(rows/2+1, cols/2+1) = 0;     % Set the value at the 0 frequency point 
                                        % of the filter back to zero 
                                        % (undo the radius fudge).


  show(logGabor,1), imwritesc(logGabor, 'loggabor.jpg');

  lp = lowpassfilter([rows,cols],.4,10);   % Radius .4, 'sharpness' 10
  logGabor = logGabor{s}.*lp;              % Apply low-pass filter

  imwritesc(lp, 'lp.jpg');
  show(logGabor,2), imwritesc(logGabor, 'loggaborlp.jpg');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?