Hot answers tagged

24

What's the relationship between sigma and radius? I've read that sigma is equivalent to radius, I don't see how sigma is expressed in pixels. Or is "radius" just a name for sigma, not related to pixels? There are three things at play here. The variance, ($\sigma^2$), the radius, and the number of pixels. Since this is a 2-dimensional gaussian function, it ...


10

The parameter sigma is enough to define the Gaussian blur from a continuous point of view. In practice however, images and convolution kernels are discrete. How to choose an optimal discrete approximation of the continuous Gaussian kernel? The discrete approximation will be closer to the continuous Gaussian kernel when using a larger radius. But this may ...


8

The continuous Gaussian, whatever its dimension (1D, 2D), is a very important function in signal and image processing. As most data is discrete, and filtering can be costly, it has been and still is, subject of quantities of optimization and quantification/quantization schemes. In one 1D, the three most direct for a finite-length filter are illustrated below:...


7

The recent works I am aware of make use of tools that go beyond mere gradients. Here are a few references that could be starting points: S3: A Spectral and Spatial Measure of Local Perceived Sharpness in Natural Images, 2012, with examples of sharpness maps and Matlab code (that could be converted to Python) This paper presents an algorithm designed to ...


7

In general, this is an image segmentation problem (http://en.wikipedia.org/wiki/Image_segmentation) into which you would be trying to isolate the focused to the non-focused regions of the image. Optical lenses are equivalent to low pass filters anyway and the effect of a low pass filter on a signal is to smooth it out by limiting the higher frequency ...


7

It turns out that the rows of Pascal's Triangle approximate a Gaussian quite nicely and have the practical advantage of having integer values whose sum is a power of 2 (we can store these values exactly as integers, fixed point values, or floats). For example, say we wish to construct a 7x7 Gaussian Kernel we can do so using the 7th row of Pascal's triangle ...


5

Here is an easier approach, that does not involve sliding-window analysis. Convert your image to grayscale (this is not required, but I will assume that you only have one channel for the sake of clarity) Calculate the gradient in both directions Calculate the magnitude (or just square the gradient) Sum both gradient images in both directions As was ...


4

Digital zooming is commonly done by using some form of interpolation, which commonly represents making up some form of smooth change between actual data samples. Assuming the data was low pass filtered (or roughly near bandlimited) before sampling, the information about where any sharp (non-smooth) changes were located between samples has been lost. Adding ...


4

Gaussian Kernel is made by using the Normal Distribution for weighing the surrounding pixel in the process of Convolution. Since we're dealing with discrete signals and we are limited to finite length of the Gaussian Kernel usually it is created by discretization of the Normal Distribution and truncation. I created a project in GitHub - Fast Gaussian Blur. ...


4

If you have the blurred and unblurred images, what I think you are asking is how you can recover the point spread function (PSF). In the absence of noise, this is theoretically possible by considering the operation in the frequency domain. The blurred was introduced by a convolution of the unblurred image with a Gaussian kernel. In Fourier space, ...


4

The fastest blur would be Box Blur. You can implement it using Running Sum. I think Intel FilterBoxBorder works in that manner. If you'd like you can do a few passes of it to approximate the Gaussian Blur. You can also use IIR Filter Coefficients to blur the image quite easily. You may have a look at my project Fast Gaussian Blur.


3

Some possible explanations for the coefficients: Binomial coefficients The 1-d kernels are probability mass functions of binomial distributions with probability parameter $p=1/2$ to make them symmetrical. Binomial distributions can be approximated by Gaussian distributions, so it should be true that Gaussian distributions can also be approximated by ...


3

If it wouldn't get blurry, then where would the information in the image come from? Since you can only store images of finite size, it's impossible to contain infinite detail in a picture (totally ignoring the physical impossibility of that). The fact that images typically are displayed "blurry" when you enlarge them (and not mosaic-y) is really just due ...


3

When applying Gaussian Blur on an image you should care for the STD only. The rest should be set as following: STD_TO_RADIUS_FACTOR = 5; kernelRadius = ceil(STD_TO_RADIUS_FACTOR * kernelStd); kernelLength = (2 * kernelRadius ) + 1; mGaussianKernel = fspecial('gaussian', [kernelLength, kernelLength], kernelRadius); Now, regarding the resolution of the image,...


3

In Gaussian blur the value of each output pixel is calculated as a weighted sum of all input pixels: $$\text{out}(x, y) = \sum^\infty_{j = -\infty} \sum^\infty_{i = -\infty} \frac{1}{{2\pi \sigma_G^2}} e^{-\frac{i^2 + j^2}{2 \sigma_G^2}}\text{in}(x+i,y+j).$$ We want to calculate the variance $\text{Var}[\text{out}(x, y)] = \sigma^2_f$ based on the variances $...


3

In the context of image processing (and machine vision as well), blurring is an operation that reduces the sharpness of an image by some lowpass filtering applied on it. There are different causes of blurring such as lens blur, motion blur, or just LSI (linear shift invariant) lowpass filtering. Deblurring refers to any restoration performed on the image ...


3

Let me present the following Diagram: So, both Deblurring and Deconvolution are operations within the family of Image Restoration (Which is a subset of Inverse Problem set). Basically we build the Image Restoration set by different Degradation Models. The one related to the question are: Linear Degradation Model Namely, the degradation is made by a Linear ...


2

A median filter is most certainly not a "blur" filter, purely on the basis that it tends to preserve edges. Edges are abrupt transitions of brightness and therefore that information is encoded in the high frequencies of the spectrum. Incidentally those high frequencies are the ones that low-pass filters suppress the most, leading to that "blurry" appearance ...


2

As said by Royi, a Gaussian kernel is usually built using a normal distribution. Each value in the kernel is calculated using the following formula : $$ f(x,y) = \frac{1}{\sigma^22\pi}e^{-\frac{x^2+y^2}{2\sigma^2}} $$ where x and y are the coordinates of the pixel of the kernel according to the center of the kernel. This approach is mathematically incorrect,...


2

I have implemented a fast Gaussian-blur in C++ and compared the performance to OpenCV on Raspberry Pi 3B+ running 32bit Raspbian OS. The function uses all the 4 cores of the Raspberry Pi and works 2-3 times faster than OpenCV. The boost is even more on 64bit OS. Here is the link to code with documentation: https://github.com/zanazakaryaie/fastGaussianBlur


2

If you see the full Lenna image she will be standing so close to the mirror(black frame is a part of the mirror,so the black frame is also in focus), that's why you get that edge when calculating gradient. This is the reason why you are calculating gradient for black frame in this particular image. If you need a general method, this is something I could ...


2

You can use the following variance of Laplacian responses: cv2.Laplacian(gray_image, cv2.CV_64F).var() More details at https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/


2

Looking at Intel - An Investigation of Fast Real Time GPU Based Image Blur Algorithms By Filip Strugar it looks like the Kawase kernel is just a way of implementing a linear kernel quickly, but in a way that constrains the kernel somewhat. This means that you could make such an algorithm. Either choose a set of spreads and adjust their weights (if that is ...


1

Instead of filtering with a symmetric gaussian, which is a blurry kernel in every direction, just filter with two 1D-kernels: One in x direction (a row vector kernel, if you will), and one in y direction (column vector). If the "blurriness" in both directions is the same, generally blurry. If it's much higher in one direction than in the other: motion blur....


1

The important message is: "it can indeed be reconstructed", meaning under certain conditions, and not "always". An image pyramid is hierarchical representation of an image with a collection of derived images at different resolutions (thus, sizes). In a Gaussian pyramid, derived images are smoothed at level $l$ by an operator $S_l$ (eg by a Gaussian filter) ...


1

This depends on the order of upsampling and downsampling. If the order is correct, then you won't throw away anything and thus you should in principle be able to reconstruct the image. In general: $$ \left(\uparrow_n\downarrow_n f\right) \neq \left(\downarrow_n\uparrow_n f\right) $$ Similar things are used when using the Wavelet decomposition on a signal, ...


1

What I understood from your post is that you don't like the excess blur that happens at the downsampled image. The theory of signal processing states that, when you downsample a digital signal by a factor of $M$ there's the potential of aliasing to happen if the signal is not bandlimited to $|w| < \pi/M$; The spectral effect of the downsampling is such ...


1

There is no extra information in the 720p and 480p images that is not already in the 1080p image. You can do the interpolation on the 1080p image. A recent work that may be of interest to you is Ledig et al. Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network, arXiv:1609.04802v5, 15 Sep 2016 (v1), last revised 25 May 2017. ...


1

One single level of a standard separable 2-channel wavelet transform, denoted by $i$, uses a low-pass $l$ and a high-pass $h$ filters (followed by downsampling). Traditionally, one applies $l$ and $g$ on the rows of the image, putting the downsampled low-passed coefficients on a left-half, and the downsampled high-passed coefficients on a left-half. Then ...


1

There are linear and nonlinear filters. Linear ones are naturally linked to standard convolution and frequency interpretation (linearity and Fourier are close concepts, since Fourier diagonalizes convolution). So a convolution filter is a term pretty related to linear filters. However, people often uses them, especially for images, to describe limited-...


Only top voted, non community-wiki answers of a minimum length are eligible