A
trace comb is used to find a number of edge points. They still represent a
too large amount of unstructured information to be of any use. Many of
Scorpion’s image analyses tools are based on the assumption that you can
find an approximately straight line fitted to most of the points. We call it
robust line fit. It is called robust since it tolerates noisy points
not placed along the wanted line.
The
line fit picks a random pair of points and draws a line between them. Then
all other points are checked and the number of points close to the line is
counted. If the number is sufficiently high, we have found the line we
searched for, if not, we continue to pick new random pair of points until we
find a line. If this is not happening within a specific number of tries, we
terminate and signal that the line is not found.
This
method is in principle simple and robust, but its parameters must be set
with care. First you need some margin for the points lying on the line you
search. This is called fit tolerance and is the distance a point must
be within to be counted as a point on the line. The tolerance must mirror
the natural measuring noise. The points will be less than 1 pixel from the
line under good light and contrast conditions. Increase the tolerance and
number of trace lines if the edge is unclear. Despite the noise, you can
then get a very precise measure of the line. There is a risk of not finding
the line even if it’s there since line fit is a stochastic process – we
pick the pair of points randomly. This happens if we don’t find a suitable
pair of points before giving up. Fortunately you can have some control with
this having knowledge of the minimum number of “good” points within the
fit tolerance, called Goodness. Finally you set the Risk
to lose a line that actually exists within all the points. This value is
given in PPM (Parts Per Million). It can be set to 1 if the goodness is
above 50% of the number of search lines. The goodness and risk give the basis to calculate how many
random pair of points to pick before giving up. When the goodness
and/or risk decreases there is a cost in an increased number of
calculations. We recommend however a conservative setting of these values
since the searching anyway is terminated as soon as the line is found. The
time of the analysis will not be higher than what the actual number of good
points indicates. Be aware that if the goodness is
less than 50% of the search lines you may find another line than the one you search for. If for
instance your points lie along a bent line, that is two straight lines,
you have no control over which of the two lines that will be found if both are
large enough to fulfill the goodness setting.
Parameter guide, line fit
Parameter

Description

Fit tolerance

The
largest allowed distance between the searched line and the edge points
belonging to the line, given in reference coordinates or pixels.

Goodness

The
lowest number of edge points closer to the line than the fit tolerance.

Risk

Risk
for not finding a line fulfilling the goodness requirement

