#include <gandalf/vision/modified_fht.h>The Fast Hough Transform can be used to fit a line to points on a plane. However the modification to the FHT described here has proved to be slightly faster for the line fitting problem, and it requires less memory. It can readily be generalised and is applicable to the same class of Hough transform problems as standard FHT. However for higher dimensional parameter spaces (e.g. plane fitting) standard FHT takes over as the faster method. To simplify the notation the modified FHT (referred to henceforth as the MFHT) is described for line fitting only.
The FHT line fitter was described in section 5.11.1.3 and the
notation used there will be followed. Points ,
are scattered on the plane. A straight line in the plane is defined as
The line in
space defined by a point is
In practice it saves repeated computational effort if intersections between a parent's four child rectangles and the lines are calculated at the same time. Let us assume that enough lines intersect the rectangle in figure 5.6 for it to be subdivided. It is divided into four child rectangles , , and as shown in figure 5.7.
For each line such as line shown, there are three intercept values, at , and . Obviously . The intercepts are each to be compared with the three values , and . A boolean flag is defined for each of the nine vertices (, etc. in figure 5.7) of the rectangular subdivision. Each flag is set to if the vertex lies below the line (i.e. if the value of the vertex is less than the corresponding intercept value of the line) and to if it lies above it. Label the flags , etc. Then it follows that:-
In the standard version of the FHT, the normalised distances from hyperplane
to centre of child hypercubes are calculated from the normalised distance
of the parent from the hyperplane. The child ``inherits'' the new normalised
distances from the parent, and passes them on to its own offspring.
The MFHT also passes information from parent to child, in this case
the intercept values.