I won’t go into Hough Transform, since you can find better explanations elsewhere, and it seems like most people at least get the basic idea behind it. But here’s something I whipped out for fun (well, I was reading Fast Symmetry Detection using Hough Transform, and I’d never written Hough from scratch before), visualizing the Hough lines, along with the accumulation matrix, which represents the (r, theta) space.
It shows the accumulation matrix, the resulting lines, and by hovering your cursor around the accumulation matrix, you can see the corresponding lines for the given r and theta.
Get the code here: https://github.com/subokita/Sandbox/tree/master/TestHough/TestHough
It requires OpenCV, Intel TBB, and the QT bindings for OpenCV though.