Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Gaussian function
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Meaning of parameters for the general equation === For the general form of the equation the coefficient ''A'' is the height of the peak and {{math|(''x''<sub>0</sub>, ''y''<sub>0</sub>)}} is the center of the blob. If we set <math display="block"> \begin{align} a &= \frac{\cos^2\theta}{2\sigma_X^2} + \frac{\sin^2\theta}{2\sigma_Y^2}, \\ b &= -\frac{\sin \theta \cos \theta}{2\sigma_X^2} + \frac{\sin \theta \cos \theta}{2\sigma_Y^2}, \\ c &= \frac{\sin^2\theta}{2\sigma_X^2} + \frac{\cos^2\theta}{2\sigma_Y^2}, \end{align} </math>then we rotate the blob by a positive, counter-clockwise angle <math>\theta</math> (for negative, clockwise rotation, invert the signs in the ''b'' coefficient).<ref>{{cite web |last1=Nawri |first1=Nikolai |title=Berechnung von Kovarianzellipsen |url=http://imkbemu.physik.uni-karlsruhe.de/~eisatlas/covariance_ellipses.pdf |access-date=14 August 2019 |url-status=dead |archive-url=https://web.archive.org/web/20190814081830/http://imkbemu.physik.uni-karlsruhe.de/~eisatlas/covariance_ellipses.pdf |archive-date=2019-08-14}}</ref> To get back the coefficients <math>\theta</math>, <math>\sigma_X</math> and <math>\sigma_Y</math> from <math>a</math>, <math>b</math> and <math>c</math> use <math display="block">\begin{align} \theta &= \frac{1}{2}\arctan\left(\frac{2b}{a-c}\right), \quad \theta \in [-45, 45], \\ \sigma_X^2 &= \frac{1}{2 (a \cdot \cos^2\theta + 2 b \cdot \cos\theta\sin\theta + c \cdot \sin^2\theta)}, \\ \sigma_Y^2 &= \frac{1}{2 (a \cdot \sin^2\theta - 2 b \cdot \cos\theta\sin\theta + c \cdot \cos^2\theta)}. \end{align}</math> Example rotations of Gaussian blobs can be seen in the following examples: {| | [[Image:Gaussian 2d 0 degrees.png|thumb|200px|<math>\theta = 0</math>]] | [[Image:Gaussian 2d 30 degrees.png|thumb|200px|<math>\theta = -\pi/6</math>]] | [[Image:Gaussian 2d 60 degrees.png|thumb|200px|<math>\theta = -\pi/3</math>]] |} Using the following [[GNU Octave|Octave]] code, one can easily see the effect of changing the parameters: <syntaxhighlight lang="octave"> A = 1; x0 = 0; y0 = 0; sigma_X = 1; sigma_Y = 2; [X, Y] = meshgrid(-5:.1:5, -5:.1:5); for theta = 0:pi/100:pi a = cos(theta)^2 / (2 * sigma_X^2) + sin(theta)^2 / (2 * sigma_Y^2); b = sin(2 * theta) / (4 * sigma_X^2) - sin(2 * theta) / (4 * sigma_Y^2); c = sin(theta)^2 / (2 * sigma_X^2) + cos(theta)^2 / (2 * sigma_Y^2); Z = A * exp(-(a * (X - x0).^2 + 2 * b * (X - x0) .* (Y - y0) + c * (Y - y0).^2)); surf(X, Y, Z); shading interp; view(-36, 36) waitforbuttonpress end </syntaxhighlight> Such functions are often used in [[image processing]] and in computational models of [[visual system]] function—see the articles on [[scale space]] and [[affine shape adaptation]]. Also see [[multivariate normal distribution]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)