You can download the source code from the SourceForge.net page of this
- The C++ reference implementation of the proposed Hough
transform (in the 'kht_souce' directory);
- A sample application using the reference implementation (in the
'sample_app' directory); and
- A MATLAB wrapper function to the reference implementation (in the
All code is released under the GNU
License, version 3, or (at your option) any later
We have compiled and tested the sample application
and the MATLAB wrapper function on Windows. The source code is
compatible with GCC, so we believe that it works on Linux, too. We
compiled the sample application using Visual Studio 2005 and Visual
Studio 2008 Express Edition (projects files are in the 'sample_app'
directory). We compiled the MEX-file using Visual Studio 2005 and
MATLAB 7 (M-files and MEX -functions are in the 'matlab' directory).
The reference implementation (in the 'kht_source' directory) does not
require any external library. However, the sample application uses DevIL, GLUT or freeglut and GLEW.
Running the Sample Application
On Visual Studio, simply open the project file and run it (CTRL+F5).
Tip: compile the application using Release configuration in
order to achieve better frame rates.
Running the MATLAB Wrapper Function
First, you need to compile the MEX-file used by the wrapper function:
1. Open MATLAB and set the 'matlab' directory of the
downloaded source code as current directory;
2. Choose a compiler for building external interface (MEX)
files by calling 'mex -setup' in MATLAB command window. If you do not
know how to use the 'mex' command, call 'help mex' or 'doc mex';
3. Call the 'kht_compiler' function and wait the MEX-file
After the MEX-file compilation, the wrapper function can be
used. The 'main.m' file in 'matlab' directory provides a simple example
of how to use the 'kht' function. Call 'help kht' to see the function
Tip: by adding the 'matlab' directory to the MATLAB search
path (see 'help addpath') you can call the 'kht' function from any
Building Your Own C++ Application
To use the reference implementation of the proposed Hough transform,
you should include the files from the 'kht_source' directory into your
project and then call the 'kht' function declared in the 'kht.h' header