Seem to have solved some of the problems with detecting
quadrilaterals. The small/thin ones don't detect well. This is because
of the smoothing applied to their distribution graphs. The vertices are
too close and the peaks in the graph merge together. There is also a
false positive with a long, thin ellipse. Finally, a few of the obvious
rectangles don't seem to be detected. No idea why yet. Calculating the
cross-correlation between graphs with the FFT doesn't give satisfactory
results, but taking the difference squared does. It takes O(n^2) time
though, which isn't so good.