You can download the source code from the
SourceForge.net page of this project (https://sourceforge.net/projects/khtsandbox).
- 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'
- A MATLAB wrapper function to the reference
implementation (in the 'matlab' directory).
All code is released under the GNU
General Public License, version 3, or (at
your option) any later version.
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, Visual Studio 2008 Express Edition and
Visual Studio 2010 (projects files
are in the 'sample_app' directory). We compiled
the MEX-file using Visual
Studio 2005, 2008 Express Edition with MATLAB 7,
and using Visual Studio 2010 with MATLAB R2011b
(M-files and the source code
of 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,
Running the Sample
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
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 current directory.
Building Your Own
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 file.