Do different edge-detection algorithms matter for creating masks?
Asked 10/30/2014
86 views
2 answers
0
I compared several edge-detection methods—Roberts, Robinson, Sobel, Prewitt, Kirsch, and Photoshop’s Find Edges—and after equalizing their outputs, the results looked very similar. That made me wonder whether the choice of algorithm really matters for photographic edge masks.
If curves or equalization can make one detector’s output resemble another, is there any practical reason to choose one edge-finding algorithm over another besides convenience?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
12y ago
2 Answers
5
There are a quite a few image processing algorithms apart from those commonly used in photo software. Each are designed to enhance certain properties. For example, some common properties are:
- speed
- localisation (good localisation means the detector response is only high near the edge)
- edge size (e.g. only detect large edges)
- edge straightness
- noise (does it pick up say salt and pepper noise as edges)
- corner response (does it recognise corners as edges)
- rotational invariance (edges give the same response regardless of angle)
- illumination invariance (edges give the same response regardless of brightness)
No one edge detector can do it all: For example, illumination invariant detectors will often pick up jpeg artefacts as edges, and true rotationally invariant detectors are often slow.
A visual example from http://www.sci.utah.edu/~cscheid/spr05/imageprocessing/project4/ , shows image and its "Canny" edge detection using a low threshold. We can see the jpeg artifacts clearly.

Edge detectors in photo software are often chosen for speed. This generally means small kernels (neighbourhood size).
Here is an example of a test image with the response of the edge detector, and the response with thresholding and skeletonisation:

Sobel and Prewitt are similar, but only use two kernels (one x and one y - see TFuto's pdf link in the comments to the question for more info). They have worse localisation than the Roberts method. The Roberts method uses eight kernels (N,NE,E,SE,S,SW,W,NW) and so is also more rotationally invariant and seems to handle corners better. The Laplacian of Gaussian (LoG) looks completely different as it uses zero crossings to find the line edges but struggles with corners.
For a normal photograph, many methods that return a simple edge intensity response (e.g. Nobel, Prewitt, Roberts, not LoG) may well look similar. If the image has sharp contrast the differences may become more apparent.
It seems as though you could use a combination of curves and equalization to make one algoritm's results mimic the results of another's results.
If the kernels are quite similar then this is possible. The Sobel and Prewitt methods are mostly indistinguishable even though the Sobel method weights the centre more.
Does it matter what edge finder you use?
For computational imaging, yes, it can make a big difference for applications such as feature detection and stereo imaging.
For photography, it depends on which method gives you the best looking results and what you are trying to achieve. For example, one method that gives very sharp contrast may also introduce a lot of noise.
Originally by user32445. Source · Licensed CC BY-SA 4.0
user32445
11y ago
0
Generated from our catalog & community — verify before relying on it.
Yes. Even if the outputs look similar after equalization, edge detectors are not interchangeable.
Different algorithms are designed to optimize different qualities, such as:
- speed
- localization (how tightly the response matches the real edge)
- sensitivity to edge size
- straight-edge behavior
- noise resistance
- corner response
- rotational invariance
- illumination invariance
So while several detectors may highlight many of the same major edges, they can differ in how strongly they respond to fine detail, noise, corners, diagonal lines, or brightness changes. Those differences matter when you use the result as a mask or for further processing.
There is no single “best” detector for every use. A detector that is more illumination-invariant may also emphasize JPEG artifacts or noise, while a more rotationally invariant method may be slower. Some texture-based masking methods also produce distinctly different results because they measure local pixel differences in other ways.
In short: if your final equalized masks look the same for your images and workflow, convenience may be enough. But the algorithm choice still matters because each method handles image structure and artifacts differently.
Recommended products
UniqueBot
AI12y ago
Your Answer
Related Questions
No related questions yet.