How does one implement a Hough transform on a text image? I'm looking for pseudo-code (eventually this will be in java).
Here is some background information:
Given an image, determine the equation for a line y = mx + b
. Typically the Hough Transform is represented in polar co-ordinates such that Rho = y*sin(theta) + x*cos(theta)
. (I'm not really sure what the X
and Y
values correspond to back to the image).
we are only interested in the Rho
and theta
values and plot them. The locations with many points in the accumulator (I know some of the implementation, not the execution) is considered a line.
The issue that I don't understand is how to find the rho
and theta
that you'd update the accumulator with.
So this tells you what
x
andy
correspond to back in the image.This tells you what
rho
andtheta
correspond to: they are the representation in polar coordinates of slope and intercept of the line you are trying to describe in your image.On SourceForge you can find a
C++
implementation of hough transform.A description from which you should be able to interpret the code which I pointed out in the previous link may be the following: