The creation of "edgelets" using operators such as the Sobel edge detector produces a estimate of the magnitude and direction of an edge at each pixel in an image. In order to apply our line models, single or double wing, it is necessary to have some indication that there is an extended portion of an edge in a region. A general and uniform way to do this is to merge edgelets together into larger edge segments. Various people have worked on this "linking" process and we will certainly be studying their papers. The merging can be done in a uniform way by applying clustering algorithms.
Below you'll find links to working Java code for edgelets via Sobel, plus links to two reviews on Clustering cached on our SVP sub-site.
There are four aspects of clustering to be concerned with here. These are listed first and then elaborated on.
A (bordered) image array is used. The operator, e.g., Sobel, is applied at every image pixel, within the border. The results are stored in an array of 2D vectors. Better, we may want to store the results in an array of more general objects which contains the vector as one field, or contains the x and y components as fields, and could store the magnitude in addition, computed by the Manhattan metric. A histogram of the magnitudes could be generated to allow us to choose a magnitude threshold. The edgelets could be sorted by magnitude. Then for the strongest one, its neighborhood could be examined centered on it and the edgelet clustered with the strongest other edgelets in the neighborhood (closest by the distance function). At some point, these strong and well aligned edgelets in the cluster could be used to produce an edge segment, which might be five or so pixels in length. Since the edgelets are oriented and approximately aligned, we know which side of the segment is in the line core and which is in the exterior region. This allows us to position a line model with one edge at the edge segment. We can begin with a one winged model and optimize its orientation and position. Once that's done we could add the other wing and expand the core until (and if!) the other edge of the model reached the other edge of the line.
To see how all this works, I've developed a few simple experiments. The one completed first generate edgelets for a simulated edge using Sobel. No clustering code is there yet. The EdgeletTest source contains the numerical output pasted in. The Javadoc is here, and the sources are here:
Here are links to two recent reviews on clustering to augment the clustering book(s) in the lab.