A detailed analysis of Gauss function _ paper one data

Source: Internet
Author: User
Tags truncated


Summary

One of the most important elements in the paper is the Gauss kernel function, but it is necessary to analyze the potential properties of Gaussian function, this paper first reference to the relevant materials to give the basis of Gauss kernel function, and then use MATLAB to automatically save the different parameters of the Gaussian kernel function of the changes GIF map, while sharing the source code, This is also convenient for subsequent paper writing.


The basis of Gauss function 2.1 a Gaussian function

Gaussian functions, Gaussian function, also referred to as Gaussian, one-dimensional form is as follows:


For any real a,b,c, the name is named after the famous mathematician Carl Friedrich Gauss. One Vitou of Gauss is the characteristic symmetry "bell curve" shape, A is the height of the curve spike, B is the coordinate of the Spike center, and c is called the standard variance, which characterizes the bell-shaped width.


Gaussian functions are widely used in the field of statistics, for the expression of normal distribution, in the field of signal processing, for the definition of Gaussian filter, in the field of image processing, Ivigos kernel function is often used in Gaussian fuzzy Gaussian Blur, in the field of mathematics, mainly for solving the thermodynamic equation and diffusion equation, and define Weiertrass Transform.

As can be seen from the above figure, Gaussian function is an exponential function, and its log function is logarithmic concave two function whose logarithm a concave quadratic functions.

The integral of a Gaussian function is an error function, however, its anomalous integral on the entire real line can be calculated accurately, using the following Gauss integral


In the same vein.


When and only if

The upper integral is 1, in which case Gauss is the probability density function of the normal distribution random variable, the expected value μ=b, the variance delta^2 = c^2, i.e.



2.2 Ivigos function

The Ivigos function, shaped like


A is a amplitude, X. Y. is the central point coordinate, σxσy is the variance, as shown below, A = 1, xo = 0, yo = 0,σx =σy = 1



2.3 Gauss Function Analysis

This section uses MATLAB to visually view the Gauss function, in the actual programming application, the Gaussian function parameter has

The size of ksize Gaussian function

Variance of Sigma Gaussian function

Center point coordinates of centre Gaussian function

Bias the offset of the center point of the Gaussian function to control the truncated Gaussian function

In order to conveniently observe the Gaussian function parameter change and the result is different, the following code realizes the automatic increment of the parameter, and saves all the result graph as GIF image, first pastes the complete code:

 function MainFunc ()% to test the Gaussian function, the increment method realizes the influence of the Gaussian function parameter change to the whole Gaussian function,% and automatically saves to the GIF format output.      % created by ZHAO.BUAA 2016.09.28 percent save gif animated item = 10;             % iteration Number dt = 1;      % Step size ksize = 20;      % Gauss size Sigma = 2; % Variance size% filename = [' ksize-' Num2str (ksize) '--' num2str (ksize+dt*item) '-sigma-' Num2str ' (sigma) '. gif ']; % must be established in advance gif file filename = [' ksize-' Num2str (ksize) '-sigma-' Num2str (Sigma) '--' num2str (Sigma+dt*item) '. gif '];          % must be built in advance GIF file% main loop for i = 1:item Center = round (KSIZE/2);              % Center point bias = KSIZE*10/10;    % Offset Center Point amount Ksigma = Ksigma (ksize, Sigma, center, bias);
    % constructs the kernel function tname = [' ksize-' Num2str (ksize) '-sigma-' Num2str (sigma) '-center-' Num2str (center)];
    Figure (i), mesh (Ksigma), title (Tname);  % set fixed x-y-z coordinate range for easy observation, axis ([xmin xmax ymin ymax zmin Zmax]) axis ([0 ksize 0 ksize 0 0.008]);
    View ([0, 90]);% change the visual angle% ksize Increment% ksize = ksize + 10;     
    
    % sigma increments sigma = sigma + dt;
    % automatically save as GIF imageframe = GetFrame (i);
    im = Frame2im (frame);
    [I,map] = Rgb2ind (im,256);
    If I==1 imwrite (i,map,filename, ' gif ', ' Loopcount ', INF, ' Delaytime ', 0.4);
    else Imwrite (i,map,filename, ' gif ', ' writemode ', ' append ', ' delaytime ', 0.4);

End END;


Close all;    Percent truncated Gaussian kernel function, the degree of truncation depends on the parameter bias function Ksigma = Ksigma (Ksize, Sigma, Center,bias)%ksize = 80;
Sigma = 15;   Ksigma=fspecial (' Gaussian ', Ksize, Sigma);
% constructs Gauss function [M, n] =size (KSIGMA); For i = 1:m for j = 1:n if (i<center-bias) | | (I>center+bias) | | (J<center-bias) | |
            (J>center+bias))
        Ksigma (I,J) = 0;
    End
End End

Result diagram:

Fixed ksize for 20,sigma from 1-9, fixed Center in the middle of Gauss, and bias offset for the entire radius, that is, the original Gaussian function.

With the increase of the Sigma, the peak of the Gaussian function is gradually reduced and the whole is more flat, then the smoothing effect on the image becomes more and more obvious.

To keep the parameter unchanged, the Gaussian function truncated, that is, the size of the truncated Gaussian Function,bias is KSIZE*3/10, the result is the following figure:


The role of truncated Gaussian function is to not consider the original image information of more than a certain area, which ensures the more reasonable use of the surrounding pixels near the center point of the Gaussian function, while also changing the central coordinates of the Gaussian function, as shown below:


To facilitate the observation of the truncation effect, the visual angle is changed.


Convolution of Gaussian kernel function

The paper uses Gaussian and feature map to do convolution, the current results, to achieve with the distance to the boundary of the Gaussian function to change the truncation parameters, because the edge of the image if the use of the original Gaussian function, it will appear in the boundary of a particularly low circle, the reason is very simple, Gaussian function in the original image with the Gaussian convolution, the image edge of the 0 calculation, then how to solve the edge problem.

First look at a piece of code:

% truncated gauss kernel function
ksize = n ksigma=fspecial (' Gaussian ',  ksize, 6);
[M, N] =size (ksigma);
For i = 1:m for
    j = 1:n
        if (i<25)
           ksigma (i,j) = 0;
        End;
    End;
End;
Figure, Mesh (KSIGMA);

The Gaussian kernel function is truncated on the I, the row, and the bias is the radius, as shown in Figure 6

And a convolution of the following figure 7,

First, the convolution kernel is the original truncated Gaussian kernel function, then the result is as Figure 8

It can be seen that the convolution results at the edge of the image appear not to anticipate the results, at the edge of the value of a significant reduction in the case, this is the Gaussian kernel function at the edge of the image of the part as a result of the 0 calculation, therefore, the Gaussian kernel function needs to be targeted truncation, but the prerequisite is to master the law of bias, The following is a detailed analysis.

If you use the Gaussian kernel function of Figure 6 to do convolution operations with Figure 7, Figure 9:

It can be seen that, compared to fig. 8, the part corresponding to the Gaussian kernel function has changed, that is to say:

        if (i<25)
           ksigma (i,j) = 0;
        End

When near the edge, change the value of I or j to ensure smooth processing at the edge. But this change of Gauss kernel function, using MATLAB is not very good to solve this problem, or use the edge of the image to be processed to extend the bias size, and the standard Gaussian kernel function to do convolution, and then the size of the original image of the part of the cut off, At present, in the use of MATLAB imfilter function to do convolution operations the most appropriate and simplest way to write here, this part is not a core part of the paper, but the technical programming method of numerical operations.









Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.