# Tag Info

## Hot answers tagged opencv

25

One important thing to understand is that after extracting the keypoints, you only obtain information about their position, and sometimes their coverage area (usually approximated by a circle or ellipse) in the image. While the information about keypoint position might sometimes be useful, it does not say much about the keypoints themselves. Depending on ...

10

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

8

I can see a number of possible problems with this approach. I speak from my own experience here from improving a pedestrian counting system with a very similar approach, so I don't mean to be discouraging. On the contrary, I'd like to warn you of possible hurdles you may have to overcome in order to build an accurate and robust system. Firstly, background ...

8

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

1st Approach: Use the haartraining methods of opencv according to this tutorial http://note.sonots.com/SciSoftware/haartraining.html -- this should give the best results, but I haven't worked with haartraining myself so far... 2nd Approach: I would suggest to use methods of "markerless tracking" of the individual tiles of the board. You can implement this ...

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

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

What has been suggested to you is called template matching. If you don't mind re-using code (and working with C++), you can find an implementation in the OpenCV library. A simpler alternative (that I would start with) would be to work with generalized Hough transform, but that will require some pre-processing first by detecting the edges in the image.

5

Finding shapes / lines is a good idea. Threshold tweaking is almost certainly a bad idea. Hough transform typically expects your lines to be (1) in a binary image and (2) of one pixel width. Try to apply an edge detector (Matlab: edge) on your filtered image in order to get the boundaries of your white regions as one-pixel lines. Then Hough transform should ...

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

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

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

5

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

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

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

In my experience best method for this is converting it to Lab color space. L represents the light, and a and b are light independent. OpenCV supports Lab color scale conversion.

4

I was doing something similar for my Bachelor thesis. In combination with a friends thesis, we accomplished to to detect, follow, and recognize the type of the centerline in the image. I understand that you need lanes, and not centerlines, but I think a big majority of the approach is applicable, especially since you're planning to play with lines as well. ...

4

In brief, what you are trying to do is probably not feasible. Why? Because SURF was not designed to do that. In a first approximation, SURF is designed as a faster (approximated and with less invariance) SIFT, i.e., a computer vision keypoint detector. Roughly speaking, CV keypoints are either corners or blobs as detected by some kind of difference of ...

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

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

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

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

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

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