Take the results of the two convolutions, square them and add them. If the result is greater than a user-determined threshold, set the pixel black, otherwise white.Vertical Kernel: -1 -2 -1 0 0 0 +1 +2 +1 Horizontal kernel: -1 0 +1 -2 0 +2 -1 0 +1
This works for 1-D, e.g., grayscale images. For color images, decide what you want to be the boundary: Brightness? Hue? Saturation? Then segnemt according to that property, Just taking the 3-D RGB vector distance isn't the greatest idea, because humans don't differentiate colors according to that metric. All other things being the same, I'd probably try the grayscale (brightness) metric first.
Update: I concur with blokhead that there are many edge detection algorithms, none unviersally applicable. The Sobel algorithm is fairly good on a wide range of images, so is worth a try.
-Mark
In reply to Re: the difference between two colors, and how to describe a color
by kvale
in thread the difference between two colors, and how to describe a color
by pg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |