Hough Line Transformer
Quickie implementation in C# (.Net 2.0)
The purpose of this page is not to explain the Hough transform. If you are interested in that, Google is your friend. Here's an ok explanation. Rather, I'm just posting some code because I haven't in a while. This is a quick program (less than an hour dev time) I wrote in C# to do a homework problem for CS223B, Into to Machine Vision at school. The program itself is nothing special - I'm sure if you knew much about MATLAB, you could whip up something better in 5 minutes. It's actually kind of ugly. However, not only did writing/debugging it make me really understand the Hough Transform and do well on my problem set, this program is capable of producing some cool-looking images with a little bit of tweaking. Here's something I did just now.
Input image - a pastural scene I opened in paint shop, converted to greyscale, extracted all edges, sharpened, and reduced to 1 bit black and white (error diffusion, naturally).
Output image - I did some post-processing in paint shop with the histogram function to make the light areas show up.
If you want to get a copy of my code, it's right here (C#). Back to the code library.
|