# Tag Info

21

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 ...

9

Wiener deconvolution is an approach to solve the deconvolution problem that relies on the filter proposed by Wiener. The equation is the same in denoising and deblurring, except that the filter $G$ (to stick with Wikipedia's notations) that you should use is different. To make things clear: denoising consists in the case where the degradation kernel $H$ is ...

8

Both are the MMSE estimators. The main difference is Wiener is the optimal for Gaussian Noise while Richardson Lucy assumes Poisson Noise. Poisson Noise is a better model for noise in photos captured by a Photo Diode. Computationally, in the case of Gaussian Noise and Linear Convolution the solution has a closed form solution in the Maximum Likelihood / ...

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 ...

6

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 ...

5

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 ...

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

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, ...

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

One simple solution would be to create a binary (0/255) mask of the area you want to blur. Then blur the source image BITWISE AND mask, blur the mask with the same filter and divide them. As pseudocode: (filter(source & mask) / filter(mask)) & mask

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 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. ... 3 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 ... 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 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 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 ... 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 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. 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 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 ... 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 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 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

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 ...

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