described in the subsection below, Note: Every
block represents an image region
• For every block b
– The centroid (x
c
, y
c
) of the block is computed
– A genetic algorithm as described below is used
to accurately match the block in the successive
frame f
t+1
– If the genetic algorithm accurately matched the
block in frame f
t
to frame f
t+1
(with error
= 0), then the motion vector is evaluated as
(x
∗
−x, y
∗
−y) where (x
∗
, y
∗
) is the estimated
transformed centroid of the block in frame f
t+1
– If the genetic algorithm returned non-zero
matching error then the process is repeated by
further sub dividing block.
• The process is terminated either when no further
splitting is needed or a predefined block size is
reached.
• If the processed frame pair is (f
t
, f
t+1
) where t =
1, then proceed to next frame pair, otherwise if
t > 1, then run motion correction using any of the
proposed filter mechanisms specified to generate
smoothed motion vectors MV
ℵ
• Compute the difference between the original mo-
tion vectors MV and the smoothed motion vec-
tors M V
ℵ
adjust the original motion vectors by
the factor of difference MV
comp
= MV ±(M V −
MV
ℵ
)
• Generate Stabilized frames using the original mo-
tion vector MV and compensated motion vectors
MV
comp
and represent them as f
∗
t+1
and f
∗comp
t+1
• Deduce the PSNR of the two versions of stabi-
lized frames using, PSNR for a gray scale image
is defined as:
10 log
10
"
255
2
1
HW
P
H
P
W
kf
t+1
− f
comp
k
2
#
(1)
where, (H, W ) is the dimensionality of the frames
and f
t+1
and f
c
omp are the intensity components
of the original target and the motion compensated
images which will equal f
∗
t+1
and f
∗comp
t+1
re-
spectively. PSNR values generally range between
20dB and 40dB; higher values of PSNR indicate
better quality of motion estimation.
• If P SNR
comp
≥ P SNR then use f
∗comp
t+1
as sta-
bilized frame for subsequent analysis otherwise
use f
∗
t+1
.
2.1 Motion Estimation
A brief description of the algorithms is specified.
2.1.1 Block Partitioning Based on Vector
Quantization
For the block partitioning phase, we start by using
vector quantization to provide the block matching
scheme with the position of partitioning.
• Set the number of codewords, or size of the code-
book to 4. This assumes that we need 4 regions to
emerge out of the image frame during the quanti-
zation process.
• Initialize the positions of the codewords to
(
w
4
,
h
4
), (
w
4
,
3h
4
), (
3w
4
,
3h
4
), (
3w
4
,
3h
4
) where (w, h)
is the width and height of the block respectively.
By this we assume that the worst case partition
could be the quad-tree partition.
• Determine the distance of every pixel from the
codewords using a specific criterion. The distance
measure is the sum of differences in the gray in-
tensity and the locations of the pixels.
• Group pixels that have the least distance to their
respective codewords.
• Iterate the process again by recomputing the code-
word as the average of each codeword group
(class). If m is the number of vectors in each class
then,
CW =
1
m
m
X
j=1
x
j
(2)
• Repeat until either the codewords don’t change or
the change in the codewords is small
• Associated with these 4 codewords, there are 4
configurations possible for partitioning the image
frame into blocks. The configurations arise if we
assume one square block per configuration. It is
logical thereafter to find the best configuration as
the center of mass of these 4 possible configura-
tions. The center of mass will now be the partition
that splits the image frame into blocks.
2.1.2 Genetic Algorithm Search
The inputs to the genetic algorithm are the block b
t
and the centroid (x
c
, y
c
) of the block.
• Population Initialization: A population P of these
n chromosomes representing (T
x
, T
y
, θ) is gener-
ated from uniformly distributed random numbers
where,
– 1 ≤ n ≤ limit and limit (100) is the maxi-
mum size of the population that is user defined.
• To evaluate the fitness E(n) for every chromo-
some n:
ICINCO 2007 - International Conference on Informatics in Control, Automation and Robotics
304