Detecting the corners
Since we know that the corners are interesting, let's see how we can detect them. In computer vision, there is a popular corner detection technique called the Harris Corner Detector. We basically construct a 2x2 matrix based on partial derivatives of the grayscale image, and then analyze the eigenvalues obtained. Eigenvalues are a special set of scalars associated with a linear system of equations that provide segmented information about the image by a cluster of pixels that belong together. In this case, we use them to detect the corners. This is actually an oversimplification of the actual algorithm, but it covers the gist. So, if you want to understand the underlying mathematical details, you can look into the original paper by Harris and Stephens at http://www.bmva.org/bmvc/1988/avc-88-023.pdf. A corner point is a point where both the eigenvalues would have large values.
Let's consider the following image:
If you run the Harris Corner Detector on this image, you will...