In this section, R-histogram, which represents the relative attitude relationship between two shapes, is first defined, and then its symmetry and affine invariance are explored.
Definition of R-histogram
As shown in Figure1, two shapes A and B, which are located in an original positively oriented orthonormal frame, are denoted as and respectively. To measure the attitude of A relative to B, we first define a relative positively oriented orthonormal frame (Figure1a), in which, the has the same direction with. c
A
and c
B
are the centroids of A and B, respectively. is the line parallel to the with v the intercept on. For any real number v, the intersection, denoted by, is a longitudinal segment of
A
. In this article, as the term “shape” denotes a 2D plane which may have holes in it or may consist of many connected components, e.g., in Figure1a is the union of a finite number of disjoint segments. Similarly, stands for a longitudinal segment of shape B.
The R-histogram of A with respect to B, whose elements are the length ratios of the collinear longitudinal segments, is represented by R
AB
as
(1)
In Equation (1), L(ξ) denotes the length of the longitudinal segment ξ, N is the number of v that are sampled equidistantly in the range of, and are the minimum and maximum intercepts of the valid lines l(v) which have nonempty intersections with both A and B, i.e.,
(2)
and are the minimum and maximum intercepts of the lines l(v) which have nonempty intersections with A. Similarly, and are the minimum and maximum intercepts of l(v) which have nonempty intersections with B.
Similarly, the R-histogram of B relative to A is
(3)
Note that, the R
BA
is calculated based on the relative positively oriented orthonormal frame (Figure1b), where the has the same direction with.
Symmetry and affine invariance
Here, desirable properties (i.e., symmetry and affine invariance) of R-histogram for shape matching are proved.
Symmetry
As shown in Figure1, the direction of of the frame (Figure1a) is opposite to the direction of of the frame (Figure1b). Consequently, the lines l(v
min
) and l(v
max
) in for R
AB
are interchanged into the lines l(v
max
) and l(v
min
) in while R
BA
is being computed. Therefore, the symmetry of R-histogram, which describes the mathematical link between R
AB
and R
BA
, is deduced as
(4)
Affine invariance
The general 2D affine transformation transforms point p in the original image into its corresponding point q in the transformed image by q, where is the translation vector and is the affine transformation matrix between the two images. Rotation, scaling and shearing, considered as the special cases of affine transform, are represented as the following matrices:
(5)
If two shapes A and B are transformed into A′ and B′ by an affine transformation, we have
(6)
Equation 6 reveals that a shape pair preserves its R-histogram while the affine mapping.
Obviously, the R-histogram is invariant to translation transformation, thus, we only explain the invariance of the R-histogram to affine transformation matrix. As shown in Figure2, in an original positively oriented orthonormal frame, two shapes A and B (Figure2a) are transformed into A′ and B′ (Figure2b) by an affine transformation matrix A
T
. and are the relative frames for R
AB
and R
A′B′
. c
A
, c
B
, c
A′
and c
B′
are centroids of A, B, A′ and B′, respectively. It can be deduced that, if the projection of a point on y
AB
-axis is known, the projection of the mapped point on y
A’B’
-axis can be obtained by
(7)
In Equation (7), det(A
T
), which is the determinate of the transformation matrix, is positive. is the distance between two points, v is the projection of a point on y
AB
-axis, and v′ is the projection of the mapped point on y
A’B’
-axis.
Eq. 7 reveals that the projection of the transformed points on y
A’B’
-axis is directly proportional to the projection of the original points on y
AB
-axis. Moreover,, representing the intersection, can be treated as the union of points of shape A with the projection value of v on y
AB
-axis. Therefore, we have
(8)
where, “⇔” denotes the correspondence relationship. As introduced in “Definition of R-histogram” section,,, and are the minimum and maximum values of intercepts of valid lines for original and transformed shape pairs. So far, as and are collinear, the affine invariance of R-histogram is proved due to the collinear distance invariance[18] of the affine transformation.