| |
Methods defined here:
- __del__(self)
- __init__(self, *args, **kwargs)
- construct_AATI_matrix(self)
- So we want to estimate R from R.A = B. If we had to construct a
one-shot estimate for R (note ICP is iterative and not one-shot),
we would write R.A=B as
R.A.A^t = B.A^t
and then
R = B . A^t . (A . A^t)^-1
We will group together what comes after B on the right hand side
and write
AATI = A^t . (A . A^t)^-1
In the ICP implementation, this matrix will remain the same for all
the iterations.
- construct_A_matrix(self)
- In the plane whose origin at the model center, the relationship
between the model points x_m and the data points x_d is given by
R . x_d + T = x_m
Let the list of the n chosen data points be given by
A = [x_d1, x_d2, ....., x_dn]
We can now express the relationship between the data and the
model points by
R . A = B
where B is the list of the CORRESPONDING model points after
we subtract the translation form each:
B = [x_m1 - T, x_m2 - T, ......, x_mn - T]
Eventually our goal will be to estimate R from the R.A = B
relationship.
- display_results(self)
- extract_data_pixels(self)
- Since extract_model_pixels() and extract_data_pixels() have the same
logic, why can't we have just one method called with two different
arguments? These exist as separate methods to allow for the future
possibility that one may want to process the model and the data images
very differently. Presumably, the model images will be noiseless and
will be output by some GIS system. On the other hand, the data images
can be expected to be noisy and may suffer from optical and other
distortions.
- extract_model_pixels(self)
- extract_pixels_from_color_image(self, image)
- This very simple routine would need to be either replaced in this
class or overridden in a subclass of ICP for a more practical
approach to the selection of pixels for ICP calculation. At this
time, all we do is to choose a pixel if it has at least
connectivity_threshold number of pixels in its 5x5 neighborhood.
This is done with the hope that pixels on edges are likely
to be selected with this criterion.
- icp(self)
- initialize(self)
- move_to_model_origin(self)
- Since two patterns in a plane, even when one appears to be a
rotated version of the other, may be not be related by a
Euclidean transform for an arbitrary placement of the origin,
we will assume that the origin for ICP calculations will be
at the "center" of the model image. Now our goal becomes to
find an R and a T that will make the data pattern congruent
with the model pattern.
- setSizeForDisplay(self)
Static methods defined here:
- gendata()
- The code here is just the simplest example of synthetic data
generation for experimenting with ICP. You can obviously
construct more complex model and data images by calling on the
other shape drawing primitives of the ImageDraw class. When
specifying coordinates, note the following
.----------> positive x
|
|
|
V
positive y
A line is drawn from the first pair (x,y) coordinates to the
second pair.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|