]>
We've already grouped the picks into segments by looking their pairwise distances. Now we must identify the linear order of the picks within each group by some kind of line-following algorithm. We can then travel along the resulting curve, exporting 120x120 pixel image samples at regular intervals, to use in the extant reconstruction process.
For starters, we'll just do regular, old-fashioned linear regression, fitting a simple line to the points of each segment. This has the fatal defect that a vertical line cannot be represented, but it's easy to implement, so we'll try it anyway as a first version.
We want to fit a line of the form
to our set of data points
.
We're looking for the values of the scalars (slope) and
We would like to solve the equation M=A-1y; however, in all likelihood no solution exists (the points don't actually lie on a line), so instead we solve in the "least squares sense." Matlab does this conveniently with the backslash operator (\). In Matlab we can write M = A\Y
to do this.
![]() |
|
![]() |
|
This page is valid xhtml.
Tobin Fricke, Weizmann Institute of Science
$Id: tracer.html,v 1.1 2002/07/03 13:28:03 tobin Exp tobin $