A Hardware Model to Measure Motion Estimation with Bit Plane Matching Algorithm

The multistep approach involving combination of techniques is referred as motion estimation. The proposed approach is an adaptive control system to measure the motion from starting point to limit of search. The motion patterns are used to analyze and avoid stationary regions of image. The algorithm proposed is robust efficient and the calculations justify its advantages. The motivation of the work is to maximize the encoding speed and visual quality with the help of motion vector algorithm. In this work a hardware model is developed in which a frame of pictures are captured and sent via serial port to the system. MATLAB simulation tool is used to detect the motion among the picture frame. Once any motion is detected that signal is sent to the hardware which will give the appropriate sign accordingly. This system is developed on two platforms (hardware as well software) to estimate and measure the motion vectors.


Introduction
Motion detection and Analysis is much significant in visual tracking of the video object. As video datasets help in perceiving motion and identify the important occurrences in object tracking. The applications like video production, remote survelliance, Gaming and animation require trimming of the desired task [3].

Background
For effective storing and transmititing digital video data the technique used is video compression. One of the best method to reduce the video data effectively is block based motion estimation and compensation. This method helps in easy analysis of motion for better understanding of segmentation and tracking of an object. It is used to find the depth of the video data, motion sensing and also as survelliance system [1]. This real time procedures of motion realizations use H.264 schemes for estimating the distance from the camera. It also holds a best promise for panning the still image.
The first step in computerized image analysis is to divide the image into regions that correspond to various objects in scene or possibly to the parts of these objects. Then various features such as size, shape, color, edge, and texture can be measured for these objects or regions [2]. Features such as the sizes, shapes and orientations of the objects might be measured and their locations relative to other objects might be described quantitatively or qualitatively. Image processing techniques are appreciable, basically for processing of image or scene data for machine analysis, compressing the image data which would be easy to transfer and Image analysis for extracting information from the images. This work is on digital video processing and it is concerned specifically with true motion estimation [3]. Digital video brings broadcasting, cinema, computers, and communications industries together in a truly revolutionary manner, where telephone, cable TV, and Internet service providers have become a final competitors. A single device can serve as a personal computer, a high-definition TV, and a videophone. We can now capture live video on a mobile device, apply digital processing on a laptop or tablet, and/or print still frames at a local printer. Other applications of digital video include medical imaging, surveillance for military and law enforcement, and intelligent highway systems. It also allows many multimedia applications and services to be introduced. While there are various topics in the field of digital video processing, this work focuses primarily on motion estimation techniques [10].The image processing of video describes how the objects move in the video. The efficient way to manipulate the video is to understand the objects while transmitting and storing [4]. The Algorithm development and architectural implementation of motion estimation techniques have been major research topics in multimedia for years.

Problem Domain
One of the essential element for achieving high volume video data compression is possible with motion estimation [5]. The various real life problems can be easily solved by estimating the motion of any object. The major problems associated in the work are relatively towards the performance of the bitplane matching algorithms [13]. The problem domain for the associated work is classified in to three different operations such as; a. Computational complexity reduction b. To provide good quality by true motion representation c. Bit rate reduction through high compression ratio The work summarizes the popular technique used to analyze the performance and relationships of video coders. The essential features of video coding standards are variable block size motion estimation (VSBME) state of art coding as H.264/AVC [3]. In order to achieve high accuracy in coding the blocks are made smaller with better motion compensation.
The computational complexity in real time is very high by using Motion estimation scheme of H.264/AVC. The hardware design architecture for new electronic products are manufactured with low power and high data throughput mainly for mobile devices which is possible only with efficient methods of motion estimation [12].
The H.264/AVC encoder is having 75% computation load by using Integer motion estimation [2]. Usually this process divides the video frame in to overlapping macro block (MB) of size 16x16 pixels. The macro block is further divided in to 7 small blocks of size 8x8, 8×4, 4×4, 8x16, 16x16, 16x8 and 4x8 pixels. In order to support the architecture of Motion estimation scheme motion vectors are generated from the sub blocks [6]. To match the computing methodology all 4x4 sub blocks are merged in to macro block. All the larger blocks of different size are used to match the results obtained.

Proposed Solution
The Motion estimation algorithms used are classified in to two types. The First kind is of the true motion between video frames either for a pixel or block. The second type is to remove temporal redundancies between video frames and track the motion of features in video sequences. 3D real world is projected from 2D motion as true motion. The ultimate goal of the techniques is to help an observer interpret the content of an image. The technique for extracting information from an image is known as image analysis. The smoothing, sharpening and other operations are useful for modifying images so that they will be better for viewing by humans or for use as input to image analysis programs. Figure 1 shows how to extract the true motion from the video images for better picture quality and a better manipulation of video objects. Figure 2 describes projection of 3D real world from projection. For performing this projection pinhole camera is used, true motion of 3D world is with the movement of 2D projection. The estimation of motion redundancy is removed with the help of video compression. The motion scenes are estimated between previous frame and a frame based on similarity.The amount of information is transmitted and stored based on the standards such as MPEG and H.263. The difference between one block is displaced from original. The Figure 3 shows the estimation of motion redundancy with the motion vectors.

Implementation of Algorithm
In video processing, Motion Analysis is very important and difficult step in determining the movement of object. The motion vectors are used to determine transformation of each coding sequences in video processing [11]. Two methods categorize motion estimation in terms of window and macroblocks size which are gradient and region matching. In this work block matching algorithm is used for its performance and simplicity. The algorithm helps in choosing the motion vector for each pixel is by block matching the current and previous frame. The region matching and displacement is carried out by motion vector. This algorithm is chosen because of its computation time and efficiency measurement. The distortion measures are calculated for entire motion estimation process using sum of Absolute differences (SAD) and Mean squared error (MSE) [9]. There are various existing algorithms for motion estimation. Most popular classification of them is mentioned below. a. Block Matching algorithm Motion estimation algorithms vary with respect to the a priori information they utilize, as well as the method of computation they utilize to obtain the estimate. There is no single way of classification common classification often used in literature is the following. Motion is estimated by correlating/matching features or regional intensities from one frame to another.

Design
Steps a. To develop a hardware system to capture picture frames and send via serial port to the system. b. Detect motion among the picture frames using MATLAB. c. Upon detection and estimation of motion among frames the hardware designed to give appropriate sign accordingly. d. This system is developed on two platforms (hardware as well software).
The work proposed finds the criterion for matching of the blocks with sum of absolute differences. Consider a pixel block N x N size shown in the equation (1) where candidate displacement and candidate block pixel are represented by c() and r().The (m,n) denote current block pixel, and search range respectively [1,7].
To reduce the computation complexity of motion Estimation a different approach for matching criterion is proposed and it is similar to bit plane matching technique [4]. This method uses absolute differences as sum with Ex or operations for block matching. The motion estimation accuracy is reduced at the cost of computational complexity.
The bit plane matching used has Number of non-matching points which is shown in equation 2 the motion vector of the blocks present consecutively are given with logical EX OR operation for motion vector block Bt (i, j) and Bt −1 (i, j).The above blocks are used to represent the bit plane pixels for different time intervals of t and t-1 respectively. The bit plane of a video frame is given in equation (3) is obtained by B (i, j) in; In the above equation the original and filtered versions are represented by I and IF for a given video frame. The filtering operation obtained from the equation 2 is simple as found above. The hardware architecture is obtained by Bit plane which is unique problem from the viewing point

Proposed Block Diagram
The block diagram describes the total working principle of the project. This work comprises of AT89C52 micro controller, IR sensor, Opto coupler-pc817, Drivers, camera, buzzer, MAX232, PC as shown in Figure 4. In this work IR sensors are placed where the motion of the object has to be detected. When any obstacle is detected between the sensors the camera is switched on automatically. Camera will take the pictures of the object with some time delay. In PC after image acquisition and with the help of mat lab programming relevant pre processing steps will be carried out for the images like resizing, converting RGB image in to gray. These pre processing steps are required to reduce the computational time. Bit plane matching algorithm is used to estimate the motion of the object. The motion of a person is output to the hardware resulting in sounding the buzzer.

2095
A reconfigurarble hardware architecture is designed to estimate the motion accuracy. The hardware architecure allows a relation between power and motion estimation.The bit plane matching algorithm works for low power electronic devices and also provides lower block sizes in motion estimation to satisfy the criterion of sum of absolute differences (SAD). One of the essential feature of this work is it reduces the computational complexity which results in low power video encoding.

Hardware Components 2.4.1. AT89C52 Microcontroller
AT89C52 has salient features such as high performance, low power with 8K bytes of flash ROM. The industry standards of 80c51 and 80c52 are compatible in terms of instruction set and pin configuration and the memory technology is nonvolatile which is similar to high density Atmel. The program memory is reprogrammed with 8-bit CPU of monolithic chip and it is similar to microcomputer which makes it more suitable for the proposed work. It is much flexible and cost effective with embedded control.
The microcontroller used has 32 I/O lines, two level interrupt architecture and a serial port of full duplex and Ram of 256 bytes with flash of 8K bytes. There is 64 K bytes program memory and data memory space externally. The logic used is with static operations at zero frequency for power saving modes with a software control. The power mode down disables the other chip functions and saves the RAM contents with the functioning of interrupt system. The idle mode used for stopping the CPU and allowing the RAM but power down mode freezes the oscillator as it saves the RAM contents.The At89c52 microcontroller is described in detail in the At89c52 Datasheet that can be found on official Atmel website.

IR Sensor
An electronic device used for emitting and detecting the infrared radiations in its surroundings with some range. This sensor is used to measure the heat of the object during motion also. There are different sensors which only detect the infrared radiations rather than emitting it one of the example is passive infrared sensors [8].

Optocoupler-pc817
In order to transfer the signals and data from one system to another subsystem a electronic equipment is used without ohmic connection of electrical.The source and destination used for transferring the signals has voltage levels different than operating from 5V DC and can also be used to control a triac switch 240V AC. The microcontroller is protected from high voltage damage by isolating the link between one another.
The phototransistor is optically coupled IRED with PC817X Series. This is in the form of 4 pin DIP packaged using wide lead spacing option. The r.m.s isolation voltage of input-output is 5.0Kv and current is of 5mA with 4pin DIP package. It is having following applications as; a. Microcontroller unit of I/O isolation. b. Switching circuits with noise suppression The circuits of signal transmission have different potentials and impedances between them.

Results and Analysis
The snapshots describe the Hardware used for Motion estimation with an experimental set up consists of IR Sensor, opto coupler, AT89C52 Microcontroller, Relay, camera, Buzzer, Power supply unit as shown in Figure 5. The IR Sensor is at transmitter side which senses if the obstacle presents and it gives signal to the controller. So that it will makes the camera ON to capture the pictures. First time Input image sequence as shown in Figure 6. If any obstacle preset between sensors then images are captured by the camera are send to folder as shown in Figure  7. Square difference values of images taken for the first time as shown in Figure 8. While running the mat lab program we will get the square difference values for the images as shown in Figure 8 here we can observe the values are greater than 10. The Mean square difference value of the images taken for the first time here which is found with the mean square difference value for the images as 188.4165. Using Bit plane matching algorithm we are estimating the motion between the frames by calculating square difference value for current frame and next frame and finally the mean square difference. From the MSD value as shown in Figure  9 we can say that the motion is estimated. Second time Input image sequence the above figure shows the images captured by the camera for the second time as shown in Figure 10.  Here we can observe the square difference values are single digit values. The Mean square difference value of the images taken for the second time is observed with mean square value is 10.8440. The images captured by the camera for the second time are processed using matlab programming for motion estimation. Bit plane matching algorithm is used and it could be observed that for the images shown in Figure 11. The square difference values and mean square difference values are calculated. Based on the set threshold value for msd if the calculated value is less than the set threshold it is inferred that the motion is not estimated. For the images show in Figures 6, 9 the output obtained is indicated in Figure 12 i.e., here motion is not detected in the observation. If motion is estimated for the images then that is given as output to the hardware through serial port resulting in sounding of the buzzer. If motion is not present buzzer is not activated.

Conclusion
The results of the work carried are inline with implementation of algorithm and the important observations are summarized as follows. The hardware developed for motion estimation has some difficulties in estimating motion of object because of IR Sensors used in the design. These IR sensors have to be arranged in line of sight manner and they can detect obstacle only for short distance.
The Hardware performance is satisfactory in estimating motion. If two IR Sensors placed in line of sight manner and if obstacle present between the sensors, opto coupler sends the signal to controller and the camera which is static turns ON. It takes good quality pictures.The bit plane matching algorithm for motion estimation is used which is having less computational time compared to Block matching motion estimation algorithm. Finally if any motion presents that appropriate sign is given to hardware by sounding the buzzer.

Future work
Progressing technology has yielded in-to multimedia communication with the help of Internet. As imaging data has become a part of life for social networking then there is a need of compressing the transmission bandwidth in order to have much quality information. The methods of compression for image and data are much useful for motion estimation and compensation techniques. The temporal redundancy can be eliminated between adjacent frames effectively with popular compression coding standards such as MPEG-2, MPEG-4. This algorithm of motion estimation with full search is not much used for applications of real time because of its high cost. The computation of processing applications in video processing is mainly used for prediction and interpolation of missing data. The image sequences of interlacing and detection of noise is easily done in video processing applications.