Q:

How to do De-Houghing of a Hough transform'ed Image?

I'm working with code found at Rosetta Code for creating a Hough transform. I now want to find all the lines in an image. To do so I need the ρ and θ values of each of the peaks in the Hough space. A sample output for a pentagon looks like this:

How can I find a single [θ,ρ] coordinate for each of the 'hot spots' visible in the Hough space?

A:

You are  finding the coordinates of the peaks and then uses the axis to scale those into  [θ,ρ] coordinates.
Depending on how noisy the data, how many false peaks you expect and how much time you have, there are a few ways of doing it. Easiest is to pick some level that is a a real peak, cut of all data below that and then do a center of gravity on each peak to get it's center.      
You could also erode/dialte the image until each peak is a single pixel.

