29

There are lots of edge detection possibilities, but the 3 examples you mention happen to fall in 3 distinct categories. Sobel This approximates a first order derivative. Gives extrema at the gradient positions, 0 where no gradient is present. In 1D, it is = $\left[ \begin{array}{ccc} -1 & 0 & 1 \end{array} \right]$ smooth edge => local minimum or ...


19

From my experience, the following points are limitations: The result is binary. You sometimes need a measure of 'how much' the edge qualifies as an edge (e.g. intensity image coming from a Sobel amplitude edge detector) The amount of parameters leads to infinitely tweaking for getting just that little better result. You still need to connect the resulting ...


18

While Sobel and Laplacian are simply filters, Canny goes further than that in two ways. First, it does non-maximum suppression which gets rid of noise produced by all sorts of objects and color gradients in an image. Secondly, it actually includes a step that allows you to discern between different edge directions and to fill missing points of a line. In ...


14

The best ideas that exactly tries to solve this problem is Hough Transform . Basically, the signal in hough space will be r, x, y co-ordinates. Here r stands for radius and x,y stands for center. Every points may belong to one or many circles. So in the Hough plane go through all possible circles where this point could belong to and just do a +1. This is ...


11

Detecting different components: If you're trying to detect the different components, there probably are other approaches to do them than detecting the contours. Here's an example in Mathematica. An erosion followed by dilation is used to close the gap in the second component before detection (if you don't do this, it won't detect it). img = Binarize@Import[...


11

What about putting the label at the innermost point of the segment? Let's define innermost by the maximum of the distance transform of the segment's mask. With software systems like Mathematica and the sort, it is straightforward to achieve. The mask for one segment, and its distance transform: After repeating for each segment and positioning labels where ...


11

As suggested above, the Matlab Canny edge detector calculates the gradient using a "derivative of a Gaussian filter" (as stated in the documentation). In other words, Matlab does a Gaussian blur of the image and then finds the gradient of that smoothed image... all using a single fancy filter. [If you want to know the details, just type in edit edge as ...


10

Robert's Cross is a little tricky because it's not an odd size (2x2 rather than 3x3 or 5x5). I've done it using numpy+scipy using a padded 3x3 convolution mask. import sys import numpy as np from scipy import ndimage import Image roberts_cross_v = np.array( [[ 0, 0, 0 ], [ 0, 1, 0 ], [ 0, 0,-1 ]] ) ...


10

You're probably looking for the Hough transform or one of it's extensions. The simplest version of this transform is linear and appropriate for detecting straight lines. In the transformed space (Hough space), angles and distances are found as points where curves intersect. Libraries for calculating the Hough transform exist in C++ - OpenCV (Has ...


9

The two most important decisions when trying to detect edges are, to me usually: Can I segment the objects instead, and then use a morphological operator to find the edge of the binary (segmented) image? With noisy data, this tends to be more robust. What edge-preserving smoothing filter should I use to reduce image noise? Edge filters are based on ...


9

OpenCV's MSER extractor (documented here) might be helpful — the bounding box of local MSER groups would pretty closely match the green rectangles in your mockup.


8

I submit that the ideal place to place the label should meet two objectives: proximity to the center, say $d$. legibility, say $l$. Ergo, we can determine the ideal point by minimizing a holistic metric such as $l \times d^\alpha$ or $l+\alpha d$, where $\alpha$ is the trade-off parameter. Determining $d$ is straightforward. $l$ can be set to the total ...


7

What I'm planning to do is to apply edge detection to obtain the locations/indices of the pixels and then get their corresponding DCT Coefficient As others stated in the comment - any pixel in the given block is related to all co-efficient in the block and vice-versa. However, understand that Edge detection is a process of finding the gradient. Linear ...


7

SUSAN Approach Another approach to edge and corner detection is the SUSAN approach. In this approach, rather than derivative approximations, an integral approximation approach is used. This has the advantage of not only being able to detect edges, but also to be able to detect "two dimensional features" (i.e. corners). Another advantage of a integral ...


6

As we've been discussing in the comments, the Goertzel algorithm is the usual way to detect a tone in noise. After the discussion, I'm not sure it's quite what you are after (you want the onset time), but there seemed to be confusion over how the Goertzel algorithm might be applied to your problem, so I thought I'd write it up here. Goertzel Algorithm The ...


6

Canny yields a binary image and is dependent on externally given thresholds (which are image/application dependent). Convolution based filters yield an "edge intensity" image. This is useful if the edge weight or strength is important (e.g. in weighted Hough Transform).


6

or are there areas of applications where Canny will not be best? I can think of a few: if you need closed curves, a detector that can guarantee those might be better (e.g. zero crossings of the laplacian or watershed segmentation) if you're trying to detect a homogeneous object that has low contrast in some areas, a segmentation method that uses global ...


6

Since convolution in spatial domain is multiplication in the Fourier (frequency) domain, you can perform edge detection in Fourier domain by multiplying the spectra of image and the edge detection kernel and then perform IFFT on the result. I think the high-pass filter alone is not appropriate for edge detection since it keeps all high-frequency features (e....


6

The usual approach to change detection is the CUSUM algorithm. I've done an implementation that just addresses the level (mean) change issue. It's included (in R) below. The black line is the noise-free data, the red line is the noisy data and the blue bars are the detected breaks (for this realization). This just addresses the level change; to address ...


6

Non-linearity A linear filter is mathematically described by the convolution sum (for discrete signals) and the convolution integral for continuous signals. The median cannot be found using a linear function except in the trivial case where you have a discrete filter of size 1, which is why the median filter is non-linear. Edge Preserving Properties. ...


5

Following http://www.kerrywong.com/2009/05/07/canny-edge-detection-auto-thresholding/ is one of the few resources that shows how to choose thresholds Tlow and Thigh According to this, for a picture which is sufficiently spread in historgram, one can choose T_low = 0.66 * mean value of image and T_high = 1.33 * mean value. However, when the image is not ...


5

Have you seen Robust Real-time Object Detection by Viola and Jones? This is probably the most widely used face detection algorithm, and also the most famous example of the use of the Haar wavelet-like features.


5

Usually the edge detection is done by a convolution of a 2-D filter/kernel like Roberts Cross or a Sobel formulation. Since those are convolutions, LTI rules apply, like being able to equivalently apply them in the frequency domain. That is, take both the kernel and the image into the frequency domain via DFT, multiply them together, and then IDFT the result ...


5

That depends on the definition of high-pass filter. If you define a high-pass filter as a filter that has high response in the high frequencies in frequency domain, then the easiest way is to take a look at the magnitude of Fourier transform, (by definition). Applying Fourier transform (in Matlab) A = fftshift(abs(fft2(padarray([-1 -1 -1; 0 0 0; 1 1 1],[...


4

The dilation operator with a structuring element is not the way to go. "Stroking" the contour is not the way to go. The distance transform, on the other hand, is exactly the method used by Photoshop. A thresholded distance transform is the equivalent of dilation of a binary image. But how do we dilate a grayscale image? This is how Photoshop does it: ...


4

The Euclidean Distance Transform can produce dilations and erosions with suitable parameters and filtering. The algorithm that Photoshop uses, and the one that is best suited for stroking, is to calculate the Euclidean Distance Transform in integers and without taking the square root (i.e. calculate distance squared). This can be made extremely fast using ...


4

One can get the presence of an edge in a given DCT block. It is easier to compute the First order and second order moments from the given DCT coefficients. Variance in a small region is an approximation of the gradient at the center (x0,y0) of the block. The Variance in a block can be estimated from the DCT coefficients as summation of squares of the AC ...


4

This might not be complete solution, but will give you good direction. Basically, what is the key criteria of to say that edges match? That "locally" the gradient of the edge matches and to some extent the distances are reasonable against how long the edge is continuous. If you have geometric edges, like long straight lines, Hough will do very seamless ...


4

That's not going to be straightforward indeed... You could try working entirely with a Graph structure. First extract all the connected pixels from the image and insert them in a Graph where neighboring nodes are connected with an edge. You could discard Graphs that are smaller than some M number of nodes (to exclude little spots that are not relevant to ...


4

Remove things you don't want Since the camera is static, you might want to use a background remover first. I found that the standard one provided with OpenCV works pretty well. I create it like this in the Android OpenCV SDK (you can play with the parameters) : backgroundSubtractor = new BackgroundSubtractorMOG(3, 4, 0.8); Then, apply it to each image in ...


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