This boundary detection project combines a traditional boundary detection algorithm (Canny edge detection) with two additional measures that are sensitive to changes in brightness and texture in an image.
Computing a brightness gradient map is fairly straightforward. First, we generate a bank of half-disc masks at different sizes and orientations:
At each pixel in the image, we apply a pair of 180-degree rotated masks and compute a chi-square distance between the brightness of each of the unmasked regions. A significant chi-square distance between two of these masks indicates a change in brightness between the two half-discs, and therefore a high probability of an edge.
We perform a similar chi-square distance measure for textures, except instead of performing this computation the image's brightness map, we first generate a "texton map." This map is generated using kmeans on filtered copies of the input image. We use a bank of gaussian filters to this purpose:
The kmeans procedure is intended to clump together areas of the image with comparable textures. Here is an example of a texton map, using different colors to indicate different texton regions:
If we compute a high mean brightness or texture gradient at a pixel, we understand this to indicate an edge at that pixel. Combining these two measures with Canny edge detection produces visually improved results (Canny on the left, augmented Canny on the right):
As you can see, our benchmarks show improvement over Canny:
ODS F-score: .59