You are on page 1of 4

MOTION ESTIMATION AND VIDEO COMPRESSION

ABSTRACT of change of this arrangement. Some have considered the


problem of recovering the motions of objects relative to the
We propose a method for video compression using 2-D viewer from the optical flow [4, 5]. In some cases
motion estimation by using optical flow equation and information about the shape of an object may also be
quantization techniques. Optical flow cannot be computed recovered. Related work has been done to formulate a model
locally, as only one independent measurement is available for the short range motion detection processes in human
from the image sequence at a point. However flow velocity vision [6, 7]. However this algorithm is computational
has 2 components in either direction. Thus we need a second complex and consumes more time to execute. It is also
constraint to calculate it. We assume that the images are sensitive to changes in lighting conditions and occlusion.
composed of moving blocks. Thus we divide the image frame Block motion estimation and compensation is a widely
into blocks of equal size, perform block motion estimation on used algorithm for video compensation and compression. It is
each block and obtain motion vectors. We start by taking a applied in various video compression standards, such as
video sequence, extract frames and divide each frame into MPEG 1-2 and H.261. In this paper, we assume that images
blocks of equal size. Further we divide each block into 9 are composed of moving blocks. We divide 2 consecutive
equal sub-blocks and calculate the mean square error video frames into blocks of equal size and perform motion
between the center pixel of each block in frame k to all the estimation by three step algorithm technique and extend it to
pixels in the respectively blocks in frame k+1. By repeating video compression.
this procedure for all the blocks, we obtain the motion We start with an overview of the proposed algorithm for
vectors, which are in turn are used to generate an estimate of video compression using block motion estimation in Section
the next frame. We quantize the difference between the 2, followed by an overview on the three step search technique
original successive frame and the predicted frame. Adding in Section 3. In Section 4 we discuss describe how we use the
this quantized error to the predicted frame gives estimated motion vectors obtained in previous section to compress the
reconstructed video. video. In Section 5, we discuss the results obtained using the
algorithm proposed in Section 2. In Section 6 we give the
Index Terms- Block motion, displacement vector, intensity concluding remarks and some important references in Section
gradient, motion compensation, motion estimation, occlusion, 7.
optical flow, quantization and relative motion.
2. VIDEO COMPRESSION USING BLOCK MOTION
1. INTRODUCTION ESTIMATION TECHNIQUE

Video sequence is a projection of 2-D images. However 2-D


images are the perspective views of a scene. Thus it is hard to Two dimensional motions are also known as “projected
determine the 3-D structure of the object. Moreover it is also motion”, which refers to the perspective or the orthographic
difficult to determine the actual distance between the objects velocity projection of 3-D motion onto the image plane. We
in a scene. This becomes more challenging when we need to perceive motion when a changing picture is projected onto a
estimate the motion using the 2-D images. Our aim is to stationary screen. Thus a moving object may give rise to a
formulate a methodology to accurately estimate the 2-D constant brightness pattern. For our convenience, we tackle a
motion field from the time-varying images sampled on a particular simple world where the apparent velocity patterns
lattice and apply it to video compression. can be directly identified with the movement of surfaces in
Optical flow is the distribution of apparent velocities of the scene. To avoid variations in the brightness due to
movement of brightness patterns in an image. Optical flow shading effects we assume the surface plane to be flat. We
can arise from the relative motion of objects and the viewer. further assume that the illumination distribution is uniform
Consequently, optical flow can give important information along the surface. Eventually we may assume that at a point
about the spatial arrangement of objects viewed and the rate in an image plane, the brightness is directly proportional to
Input Extract 3-step Obtain Forward Predicted
Color frames ‘k’ motion motion motion video
Video and ‘k+1’ estimation vectors estimation frame

-
Predicted Original +
video frame
frame ‘k+1’

+
Reconstructed Quantized Prediction
frame ‘k+1’ error error

Fig. 1: Block representation for video compression using block motion estimation technique

The reflectance of the surface at the corresponding point on


the object. 3-D motion can be characterized in terms of Input RGB video sequence
either point.
Fig. 1 gives a diagrammatic representation of the Extract frames and resize each frame
compression technique using block motion estimation
technique. As shown in the figure, we start by extracting Divide each frame into blocks of size 16 by 16
frames from a color video and apply it to a three step block
motion estimator. The block motion estimator considers Divide each block into 9 equal parts
only two successive video frames, ‘k’ and ‘k+1’ at a time,
estimates the motion of frame ‘k+1’ with respect to frame
‘k’ and generates motion vectors. The block motion Calculate the MSE of a pixel in frame k with
estimation technique is described in Section 3. We predict Step respect to al the pixels in frame k+1
the next frame ‘k+1’ using the present frame ‘k’ and motion
vectors. This predicted frame is the prediction for frame
Find block with lowest MSE/MAD
‘k+1’. Thus there is an error in prediction. We calculate this
error by subtracting the predicted frame from the original
Divide this block into 9 equal parts
frame. This error cannot be transmitted directly. Thus we
quantize its values, combine them with the motion vectors
and transmit them to the decoder. Calculate the MSE of a pixel in frame k with
The decoder on the other hand, adds this quantized Step respect to al the pixels in frame k+1
error to the predicted error to generate the next frame ‘k+1’.

3. THREE-STEP BLOCK MOTION ESTIMATION Find block with lowest MSE/MAD

In this method, we divide two successive image frames into Divide this block into 9 equal parts
blocks of size N1 X N2. We consider one block at a time and
divide the block into 9 sub-blocks of equal size and
calculate the MSE of point (n1,n2) in each block in frame k Step Calculate the MSE of a pixel in frame k with
with respect to every pixel (n1,n2) in the respective sub- respect to al the pixels in frame k+1
block in frame k+1. We then consider the block with
minimum MSE and further divide the block into 9 equal Find block with lowest MSE/MAD
sized blocks. Then we decrease the window size and repeat
the procedure till the distance between the center pixel and
the neighboring pixel is 1 pixel. We repeat this procedure Draw a line connecting the center of the frame
for every block in the image. Fig. 4 shows the diagrammatic to the this point
representation of this method.
The matching of the blocks can be quantified according
to various criteria including the maximum cross-correlation, Fig. 2: Flowchart of 3 step motion estimation method

2
the minimum mean square error, minimum mean absolute particular value to each quantization level and transmits it
difference (MAD) and maximum matching pel count along with the motion vector to the input of the decoder.
(MPC). Here we use minimum mean square error criteria to
find the best match between two blocks in the successive Frame ‘k’ Frame ‘k+1’
frames. It is defined as:

∑[s(n , n , k) − s(n +1, n2 +1, k +1)] (1)


1
MSE =
2
1 2 1
N1 N 2 (n1 , n2 )∈B

where, s(n1 , n2 , k ) corresponds to a pixel in frame k,


s(n1 + 1, n2 + 1, k + 1) corresponds to a pixel in frame k+1 and B + Prediction
denotes an N1 X N2 block, for a set of candidate motion error
vectors (d1,d2) . The estimate of the motion vector is taken
to be the value of (d1,d2) which minimizes the MSE.
Mathematically we may express it as,
∧ ∧ 
= arg . min MSE ( d 1 , d 2 )
T

 d 1 , d 2 
(2)
(d1 ,d 2 )

The displaced frame difference can be given by,


dfdk ,k+1 (n1, n2 , k) = s(n1, n2 , k) − s(n1 +1, n2 +1, k +1) (3)
However implementing a squared term in hardware is not a
trivial task. Thus the MSE criterion is not generally Fig. 3: Calculate prediction error
preferred to implement in hardware. Thus we use minimum
mean absolute difference criterion, defined as At the decoder’s end, the predicted frame is

∑| s(n1, n2 , k ) − s(n1 + d1, n2 + d2 , k + 1) |


reconstructed using the previous frame ‘k’ and the motion
1
MAD = vectors and added to the quantized error. This gives an
N1N2 ( n1 , n2 )∈B approximate of the reconstructed frame. Repeating this for
(4) the entire video sequence will achieve compression.
The estimate of the motion vector to minimize the MAD is 5. EXPERIMENTAL RESULTS
given by,
∧ ∧ The proposed algorithm was tested on a database of videos
[ d 1 , d 2 ]T = arg . min MAD( d1 , d 2 ) (5) and was found to work satisfactorily with natural as well as
( d1 , d 2 )
synthetic videos. For illustration, we take a natural video
4. TECHNIQUE TO ACHIEVE VIDEO shown in Fig. 4. This video is composed of 166 video
COMPRESSION USING MOTION VECTORS frames. In the first step we extract all these frames. Then we
consider 2 successive video frames ‘k’ and ‘k+1’ at a time
Motion vectors are achieved by using the technique and apply them to three step block estimation algorithm. In
described in Section 3. These motion vectors denote the Fig. 2 we show extracted frame 60 and 61. The block
direction of displacement along which the mean square motion estimator gives motion vectors, which in turn gives
errors are minimum. Thus we move the center of each N1 X an estimate of where the block has moved in the successive
N2 block to the co-ordinates given by the respective motion frame. By using forward block estimation technique and the
vector. By repeating this for every block in the video frame, motion vectors obtained, we predict the next frame ‘k+1’.
we get an estimate of the next frame. However these However this prediction is not optimal and has errors. Thus,
estimates are not accurate. Thus reconstructing a video we find the difference between the predicted and the
sequence using these blocks gives inaccurate results. The original frame ‘k+1’ and find the prediction error. This
resultant video is not continues and the block are very prediction error cannot be transmitted in the form it is. Thus
evident. Thus, we formulate a technique to smoothen the it needs to be quantized into steps. This error varies in the
video. range of -1 to +1. Here we use an 8 bits uniform quantizer to
This can be achieved by calculating the difference divide this range into 256 equal levels. This quantized error
between the predicted frame and the original frame ‘k+1’ along with the motion vectors and the previous frame ‘k’ to
and sending it to the decoder, as shown in Fig.3. However the decoder.
sending this raw information is not feasible in digital world. At the decoder’s end, it receives the motion vectors,
Thus we pass it through a quantizer which assigns a previous frame ‘k’ and the quantized error as input. It
generates a predicted frame ‘k+1’ using the motion vectors

3
3-step Forward
motion motion
estimation estimation

Extracted frames ‘k’ Predicted frame


Color video Motion Vectors
and ‘k+1’

-
Predicted frame +

Frame ‘k+1’
Reconstructed
video frame
Prediction error
+
+
Quantized
error

Fig. 4: Results of video compression using block motion estimation algorithm

and the previous frame. The resultant is added with the 7. REFERENCES
quantized error to reconstruct the video frame. The
reconstructed video is not exactly the same as the original [1] H. Gharavi and M. Mills, “Block-matching motion
frame due to quantization loss. Thus it is a lossy estimation algorithms: New results,” IEEE Trans. Circ.
compression technique. This algorithm when applied to and Syst., vol. 37, pp. 649-651, 1990.
entire video sequence, achieves compression. [2] V. Seferidis and M. Ghanbari, “General approach to
block-matching motion estimation,” Optical Engineering,
6. CONCLUSION vol. 32, pp. 1464-1474, July 1993.
[3] M. Bierling, “Displacement estimation by hierarchical
In this paper a new approach to video compression using block-matching,” Proc. Visual Comm. and Image Proc.,
block-matching estimation has been introduced that uses SPIE vol. 1001, pp. 942-951, 1988.
general geometric transformations of pixel coordinates. The [4] B. K. P. Horn and B. G. Schunck, “Determining
main advantages of the proposed method are their simplicity Optical Flow,” Artif. Intell., vol. 17, pp. 185-203, 1981.
and ease to implement in hardware. They can be widely [5] S. V. Fogel, “Estimation of velocity vector fields from
used for video compression and in several digital video time varying image sequences,” CVGIP: Image
processing applications like motion-compensated filtering Understanding, vol. 53, pp. 253-287, 1991.
for standard conversions. [6] T. S. Huang, ed., Image Sequence Analysis, Springer
However these algorithms fail for zoom, rotational Verlag, 1981.
motion, and under local deformations, which results in [7] A. V. Oppenheim and R. W. Schafer, “Discrete - Time
serious artifacts, especially for very low bit rate Signal Processing,” Prentice Hall Signal Processing
applications. They also fail to estimate motion when a Series, 1989.
circular object with uniform surface intensity is rotated [8] A. M. Tekalp, “Digital Video Processing,” Prentice
about its axis. In such cases, estimating motion becomes Hall Signal Processing Series, 1995.
difficult. Thus much of the regions in motion estimation [9] D. E. Dudgeon, “Multidimensional Digital Signal
remain untouched. Eventually adds constraint to video Processing,” Prentice Hall Signal Processing Series, 1996.
compression. However there is lot of scope for development [10] K. Sayood, “Introduction to Data Compression,”
of this algorithm to augment video compression process to Morgan Kaufmann Publishers, 2006.
any arbitrary motion of objects in a video frame.

You might also like