Hot answers tagged

12

Laplace of Gaussian The Laplace of Gaussian (LoG) of image $f$ can be written as $$ \nabla^2 (f * g) = f * \nabla^2 g $$ with $g$ the Gaussian kernel and $*$ the convolution. That is, the Laplace of the image smoothed by a Gaussian kernel is identical to the image convolved with the Laplace of the Gaussian kernel. This convolution can be further expanded, ...


9

I decided to post this answer here because a while back, this came up as the top result in Google and its suggestions helped me. So I decided to share my experience too. Having spent countless hours trying to get the best stereo calibration on a Kinect, I shared my tips and findings in a blog post here. Although it is geared towards stereo calibration and ...


7

Here is a list of 'best practices' for camera calibration which I originally posted here: https://calib.io/blogs/knowledge-base/calibration-best-practices Choose the right size calibration target. Large enough to properly constrain parameters. Preferably it should cover approx. half of the total area when seen fronto-parallel in the camera images. Perform ...


7

Harris Corner detector tries to quantify the local intensity changes at all the directions for each pixel. The figure below illustrates the basic idea clearly: So $I(x+u,y+v)$ indicates the pixel intensities of all the neighborhood pixels around $(x,y)$. The window function is applied for feature localization. For most often used Gaussian function, the ...


7

Use bilateral filter or anisotropic diffusion first. The effect of anisotropic diffusion is as the following: . The MATLAB code can be found here. Here is its effect on your image: Finally, non-local means is a also a good way to get rid of the noise. You might also want to take a look into that. I warn you though, it is slow.


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

Intuition for parameters of HoughCircles: image: 8-bit, single channel image. If working with a color image, convert to grayscale first. method: Defines the method to detect circles in images. Currently, the only implemented method is cv2.HOUGH_GRADIENT, which corresponds to the Yuen et al. paper. dp: Resolution of the accumulator array. Votes cast are ...


6

Here are a few ideas: First convert from color to grayscale. It looks like you have fairly good contrast already. There are various methods to perform this conversion; choose the simplest at first: gray = (red + green + blue)/3. Quite often you don't need anything better than that. For some applications, using just the green color plane is sufficient. If ...


6

If I understand correctly, you don't need the intrinsics or extrinsics to achieve that, if a top-down view is all you want. You could basically define 4 points on your parallel lines and then warp the entire image into a canonical view (say $\{\{0,0\}, \{480,960\}\}$). To do that in OpenCV, all you need to do is compute the homography using findHomography ...


6

I guess you can compute for each pixel the correlation coefficient between patches centered on this pixel in the two images of interest. Here is an example where I downloaded the figure attached here and tried to compute the correlation in such a way. The output looks different from the one of the article, but it was to be expected since the resolution is ...


6

I think it happens due to 2 things: Quantization You are working using UINT8 Image, try convert it into floating Point Image. You may do this by mO = im2double(mI) where mI is the UINT8 and mO is a floating point image in the range [0, 1]. You may also do it using mO = double(mI) / 255. Gaussian Kernel Radius vs STD Ratio Your Gaussian Filter Radius is 12 ...


6

Parallel lines in the image do intersect at a vanishing point. Therefore simply hypothesizing lines (a gradient direction at a point suffices to describe it) and voting (see Hough voting) would suffice to identify this point. One could then record all the lines that casted votes to this very point and identify them. Care must be taken as it is difficult to ...


5

Do not struggle forming a database of images to match via descriptors. This would be too computationally cumbersome and would require immerse amount of training. Such a scalable solution doesn't exist out of the box yet. I would rather rely on Neural Networks or SVMs to train the possible appearances of characters. Of course using a classifier relies on ...


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


5

If you have an idea what size circles you are looking for, then it would be best to set min_radius and max_radius accordingly. Otherwise, it will return anything circular of any size. Parameters 1 and 2 don't affect accuracy as such, more reliability. Param 1 will set the sensitivity; how strong the edges of the circles need to be. Too high and it won't ...


5

It can be done very easily with the scikit-learn. Examples are easy to find on their website, i.e. here. In my opinion it is the best way to go. Modified code example from the above link: import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.datasets.samples_generator import make_blobs ########################...


5

The Ricker wavelet, the (isotropic) Marr wavelet, the Mexican hat or the Laplacian of Gaussians belong to be the same concept: continuous admissible wavelets (satisfying certain conditions). Traditionally, the Ricker wavelet is the 1D version. The Marr wavelet or the Mexican hat are names given in the context of 2D image decompositions, you can consider ...


5

What you should do is work with the Variance. The Variance of Discrete Random Variables with support of $ \left[ -l, l \right] $ is given by (Notice that since the Expected Value is $ 0 $, the Variance is given by the 2nd moment)): $$ \sum_{k = -l}^{l} \mathbb{P} \left( k \right) {k}^{2} = \sum_{k = -l}^{l} \frac{1}{2l + 1} {k}^{2} = \frac{1}{2l + 1} \sum_{k ...


4

I will explain two approaches for this: 1) One approach would require a line matching algorithm. After matching the lines, you could simply use the end points of the lines in order to compute homography. To achieve that EDLine or LSD based descriptors are recently proposed in OpenCV. Also, hashing and fast matching of them are also implemented. Check out ...


4

[EDITED] Here's how it's done. Steps: 1. Isolate the Road Divider Part. Then, using Houghlines, find out the longest lines in Image. Find out the extrema points that cross image boundary. You got the Quadilateral points. I skipped this part by Manually Choosing them. In my case, the width of road at top of image is 10, and at bottom is 60. Now, for the ...


4

The word "Filter" in Image Processing word relates to "Neighborhood" based operation on pixels. Filters in the context of Instagram and other Image Processing applications are combination of point operations (Works on single pixel, adjusting it values independent of its adjacent pixels) and filters which alters the pixel value according to its adjacent ...


4

It is a programming question, not a signal processing question - keep that in mind, and next time use the StackOverflow. MATLAB rand function returns uniformly distributed variable on interval $[0,1]$. C++ rand function returns integer between 0 and RAND_MAX, additionally it is not very 'random' function. You would also have to normalize its output. For ...


4

this questions is asked fairly often. If you don't have a grasp of fft in 1d, higher dimensions may be difficult to grasph. But logically it makes a lot of sense once you see it What does frequency domain denote in case of images? basically sharp changes (high contast noise) usually has high frequencies. and smoother gradients have low frequencies. just as ...


4

Some guidelines for using Thresholding: Stretch the image to use the whole Dynamic Range (DR). Apply some Denoising (Very very gentle). Median with small radius would be a good idea. Unless you hand tweak the Threshold, Otsu's Method generally yields good results for this kind of tasks (Text on background). If one use Adaptive Local Methods (Mean / Gaussian ...


4

On closer inspection, I discovered that the erroneous correlation result resembles the correct result, but shifted up and to the left. The former was displayed in scientific format, so it was hard to see the pattern at first. The reason is that taking the conjugate is equivalent to flipping the whole zero-padded kernel, and not just the original kernel (...


4

Intuitively, HSV is the place to easily define Skin Color Hues. Yet there is a broad work on that and even articles about the optimal Color Space for Skin Detection. Yet, you should have a look at OPTIMUM COLOR SPACES FOR SKIN DETECTION (Alternative at IEEE - Optimum color spaces for skin detection). According to them there is no difference in the ...


4

The UINT8 type is limited to integer numbers on the range [0, 1, 2, ..., 255]. Hence negative values are clipped into 0. A solution could be wither use other types (Floating Points) or scale and shift. For instance, given a Floating Point image with values imageMax and imageMean you can scale it into the [0, 1, 2, ..., 255] by doing: Create only ...


4

After you equalize the histogram you can think of your data as a stream of variables $ {X}_{i} $ where $ X \sim U \left[ 0, 1 \right] $. Now all you need is to transform samples of Uniform Random Variable into Gaussian Variable. You should do that by applying the Inverse CDF of Gaussian Distribution. Basically applying the Inverse Transform Sampling ...


4

first of all remember that there is no single solution for all kind of noise and all kind of images. that being said i can think of two solution. first is using Otsu thresholding: ret,thresh_img = cv2.threshold(img, 0, 255, cv2.THRESH_BINARY_INV|cv2.THRESH_OTSU) this will try to guess a good threshold for the image being used. the other solution would be ...


3

The Vibrance in Photoshop is a mask guided saturation. What does it mean? It means we add saturation only to pixels marked by the mask while leaving others untouched. The mask evaluates the original level of the saturation of each pixel. If the pixel is highly saturated, then when Vibrance is applied this pixel will be excluded. Namely vibrance works only on ...


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