3 ms·
The negation step seems superfluous. The edge detection filter can't detect edges in a regular photo but can in a negative?
by nobodysfool 13y ago
The negation step seems superfluous. The edge detection filter can't detect edges in a regular photo but can in a negative?
- sp332 13y agoThe reason given is that the algorithm (Sobel) looks for light-to-dark transitions. There are two such transitions in the positive image: one from the background to the edge, and another from the edge into the object. Negating the object leaves only one light-to-dark gradient on the edge of the object.
- mistercow 13y agoYeah, but that reason is nonsense. The Sobel operator uses convolution to approximate the magnitude of the gradient. It doesn't "look for" anything. And since it's the magnitude of the gradient that Sobel finds, Sobel(Invert(img)) is mathematically equivalent to Sobel(img). The invert step is essentially an expensive noop.