Code covered by the BSD License
-
GaussDx(GDsize, mu, sigma, ta...
Function GaussKernel = GaussDx(GDsize, mu, sigma, sigma_width) computes
-
GaussDx2(GDsize, mu, sigma, s...
Function GaussKernel_2D = GaussDx2(GDsize, mu, sigma, sigma_width) computes
-
plus_filt1D(data_in, x, mu, s...
function to calculate PLUS edge detector with with 1D kernel is
-
plus_filt2D(data_in, x, mu, s...
Function [data_out, kernel] = plus_filt2D(data_in, x, mu, sigma, sigma_width)
-
View all files
from
PLUS Edge Detection Filter
by Sergei Koptenko
PLUS = (Second-Derivative-in-the-Gradient-Direction + Laplacian) edge detection filter
|
| GaussDx2(GDsize, mu, sigma, sigma_width)
|
function GaussKernel_2D = GaussDx2(GDsize, mu, sigma, sigma_width)
% Function GaussKernel_2D = GaussDx2(GDsize, mu, sigma, sigma_width) computes
% 2D 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_2D - derivative kernel used by plus_filt2D.m, sdged_filt2D.m
sigma_width = ceil(sigma_width * sigma);
x = linspace(-sigma_width, sigma_width, 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_1D = (mu - x) .* Gaussian / sigma^2;
GaussKernel_1D = GaussKernel_1D /sum(GaussKernel_1D .* (mu-x)); % normalize kernel
GaussKernel_2D = conv2(GaussKernel_1D, Gaussian', 'full');
|
|
Contact us at files@mathworks.com