gaussian

Calculate the Gaussian filter's sigma using the kernel's size

对着背影说爱祢 提交于 2019-12-01 16:49:43
I find on the OpenCV documentation for cvSmooth that sigma can be calculated from the kernel size as follows: sigma = 0.3(n/2 - 1) + 0.8 I would like to know the theoretical background of this equation. Thank you. Using such a value for sigma, the ratio between the value at the centre of the kernel and on the edge of the kernel, found for y=0 and x=n/2-1 , is: g_edge / g_center = exp(-(x²+y²)/(2σ²)) = exp(-(n/2-1)²/(2*(0.3(n/2-1)+0.8)²)) The limit of this value as n increases is: exp(-1/(2*0.3²)) = 0.00386592 Note that 1/256 is 0.00390625 . Images are often encoded in 256-value ranges. The

Calculate the Gaussian filter's sigma using the kernel's size

亡梦爱人 提交于 2019-12-01 15:38:36
问题 I find on the OpenCV documentation for cvSmooth that sigma can be calculated from the kernel size as follows: sigma = 0.3(n/2 - 1) + 0.8 I would like to know the theoretical background of this equation. Thank you. 回答1: Using such a value for sigma, the ratio between the value at the centre of the kernel and on the edge of the kernel, found for y=0 and x=n/2-1 , is: g_edge / g_center = exp(-(x²+y²)/(2σ²)) = exp(-(n/2-1)²/(2*(0.3(n/2-1)+0.8)²)) The limit of this value as n increases is: exp(-1/

MATLAB Image Sharpening - Gaussian High Pass Filter using (1- Gaussian Low Pass Filter)

筅森魡賤 提交于 2019-12-01 11:53:54
问题 I am trying to sharpen an image by designing a Gaussian High-Pass Filter. I would like to do this using the fact that the high-pass filter is equivalent to the identity matrix minus the low-pass filter, so I did the following: image= imread('Question3_Data-Cats.jpg'); % read image H = 1 - fspecial('gaussian' ,[5 5],2); % create unsharp mask sharpened = imfilter(image,H); % create a sharpened version of the image using that mask imshow([image sharpened]); %showing input & output images I did

Feature detecting support for svg filters

爱⌒轻易说出口 提交于 2019-12-01 08:25:42
问题 I need to feature detect whether a browser supports svg filters (feGaussianBlur, to be specific). How would I go about testing for this? Safari, which doesn't support the filter, silently ignores the filter. 回答1: You could probably also check the enums available on the interfaces, e.g: var supportsfilter = typeof SVGFEColorMatrixElement !== undefined && SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE==2; That way you won't have to construct new elements, as in https://stackoverflow

scipy.optimize.curve_fit unable to fit shifted skewed gaussian curve

时光怂恿深爱的人放手 提交于 2019-12-01 07:37:52
问题 I am trying to fit a skewed and shifted Gaussian curve using scipy's curve_fit function, but I find that under certain conditions the fitting is quite poor, often giving me close to or exactly a straight line. The code below is derived from the curve_fit documentation. The code provided is an arbitrary set of data for test purposes but displays the issue quite well. import numpy as np from scipy.optimize import curve_fit import matplotlib.pyplot as plt import math as math import scipy.special

Python - Kriging (Gaussian Process) in scikit_learn

回眸只為那壹抹淺笑 提交于 2019-11-30 19:30:18
I am considering using this method to interpolate some 3D points I have. As an input I have atmospheric concentrations of a gas at various elevations over an area. The data I have appears as values every few feet of vertical elevation for several tens of feet, but horizontally separated by many hundreds of feet (so 'columns' of tightly packed values). The assumption is that values vary in the vertical direction significantly more than in the horizontal direction at any given point in time. I want to perform 3D kriging with that assumption accounted for (as a parameter I can adjust or that is

Display images in different sizes in MATLAB

依然范特西╮ 提交于 2019-11-30 19:27:01
I am creating gaussian pyramid in MATLAB 2010b. I want to show images like same patterned mentioned here . I tried to use imresize , truesize but getting all images in same size. Could anybody please help me on this issue? You can use "imshow with True Size for multiple images" FEX file to answer your question... EDIT : The code below will produce the subplot at the bottom right part of the figure: clear imagesCellArray mand = imread('mandelbrot_set.jpg'); % read image dim = 3; [imagesCellArray{1:dim,1:dim}] = deal(mand); % create smaller images by imresize for iRow = 1:dim for iCol = 1:dim

How to generate random numbers from a normal distribution with specific mean and variance?

我与影子孤独终老i 提交于 2019-11-30 16:06:52
I need to generate a Gaussian random sample of n numbers, with mean 0 and variance 1, using the randn function. In general, how would I generate a Gaussian random sample X of n numbers, with mean mu and variance v , using the randn function? nbonneel A standard normal distribution already has mean 0 and variance 1. If you want to change the mean, just "translate" the distribution, i.e., add your mean value to each generated number. Similarly, if you want to change the variance, just "scale" the distribution, i.e., multiply all your numbers by sqrt(v) . For example, v = 1.5; % variance sigma =

Is there any Difference of Gaussians function in Matlab?

狂风中的少年 提交于 2019-11-30 15:23:56
问题 I am new to Image Processing, and in my experiment I am having difficulty with Difference of Gaussians. Various implementation were given to me but I don't understand them and their parameters. Here are my formulas Should I implement this filtering myself, or is there an existing function defined for this? Of course with all parameters which are like in link. I will need to play with parameters and produce different images. 回答1: You could Gaussian filter an image twice with two different std.

gaussian blur with FFT

家住魔仙堡 提交于 2019-11-30 15:08:19
问题 im trying to implement a gaussian blur with the use of FFT and could find here the following recipe. This means that you can take the Fourier transform of the image and the filter, multiply the (complex) results, and then take the inverse Fourier transform. I've got a kernel K, a 7x7 Matrix and a Image I, a 512x512 Matrix. I do not understand how to multiply K by I. Is the only way to do that by making K as big as I (512x512) ? 回答1: Yes, you do need to make K as big as I by padding it with