Code covered by the BSD License  

Highlights from
SDGD Edge Detection Filter

from SDGD Edge Detection Filter by Sergei Koptenko
Second-Derivative-in-the-Gradient-Direction edge detection filter

GaussDx(GDsize, mu, sigma, tail)
function GaussKernel = GaussDx(GDsize, mu, sigma, tail)
% Function GaussKernel = GaussDx(GDsize, mu, sigma, sigma_width) computes
% 1D Gaussian Derivative 
%INPUTS:
%   GDSIZE      - size of Gaussian kernel.
%   MU          - mean of the Gaussian
%   SIGMA       - standard deviation of a Gaussian function
%   SIGMA_WIDTH - defines where to cut the Gaussian kernel tail (or width of the kernel in sigma).
%   Bigger number- more of Gaussian included in the kernel. Defaul value= 3 or 98% of Gaussian 
%
%OUTPUT:
%   GaussKernel - derivative kernel used by  plus_filt1D.m, sdged_filt1D.m


tail = ceil(tail * sigma);
x = linspace(-tail, tail, GDsize); 

Gaussian = exp(- 0.5*(((x - mu)/ sigma) .^2)) /(sigma * realsqrt(2 * pi)); 
%Gaussian = Gaussian / sum(Gaussian); % normalize the sum of samples to 1

GaussKernel = (mu - x) .* Gaussian / sigma^2;
GaussKernel = GaussKernel /sum(GaussKernel .* (mu-x)); % normalize kernel


Contact us at files@mathworks.com