Project 2 Report

By Andersen Chen


Algorithm: Boundary Detection

First, the filter banks and half-disc masks are created. We make the filters by convolving a sobel filter with a gaussian, then rotating the result. We vary the sigmas of the gaussians to make the filters have different scales. The filter bank used had sigmas of 1 and 2, and had 16 different orientations per scale for a total of 32 filters:

The half-discs are images with only two pixel values, black and white. In the algorithm implemented, we had 8 orientations (rotations) and 3 scales, resulting in 24 pairs of images (48 images total):

The half-discs are created by creating a circle of white of a specified radius in a black image, making half of the circle black, then rotating the result 8 times. We filter our input image with everything in our filter bank, ending up with a 32-D vector for each pixel. We then use the kmeans code provided to cluster these 32-D vectors into K = 64 cluster ids. Here is an example of a texture map with the original picture:

Creating the brightness map is trivial process. Now that we have both the brightness map and the texture map, we run those through our half-disc masks. For each pair of half-disc masks, we compute the chi-square distance between their histograms at each pixel of the image. The distance is directly proportional to the gradient in the direction and scale specified by our half-disc pair of masks. We take advantage of the linearity of the chi-squared formula, as discussed in the project specifications. Now, for each pixel, we have its brightness and texture gradient for all the directions and scales in our half-disc masks.

All we need to do now is combine our canny baseline with our brightness and texture gradients to create our new pb filter. We take the mean of the brightness and texture gradients at every pixel, so that we get one value per pixel. Then, we simply element-wise multiply our brightness gradients, texture gradients, and canny output to generate our output image.


As we can see, the results of the algorithm seem to work, beating both baselines with an ODS F-score of 0.59. Here is the PR curve:

Results

More results!

OBAMA!!!!

Final results from the pictures that were given: