[ieee iecon 2013 - 39th annual conference of the ieee industrial electronics society - vienna,...

5

Click here to load reader

Upload: karima

Post on 17-Apr-2017

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: [IEEE IECON 2013 - 39th Annual Conference of the IEEE Industrial Electronics Society - Vienna, Austria (2013.11.10-2013.11.13)] IECON 2013 - 39th Annual Conference of the IEEE Industrial

Bees for Block Matching

Daoud Boumazouza, Yasmine Sefouane, Mohamed

Djeddi, Boualem Khelouat, Karima Benatchba

Laboratoire de Méthodes de Conception de Système

Ecole Nationale Supérieure d’Informatique (ESI)

Algiers, Algeria

Abstract— Detection of moving objects in a video sequence is

a growing field, used in various domains. There are, in the

literature, several approaches to detect such movements. In this

paper, we will focus on one of these approaches namely block

matching. We propose to speed the performances of the block

matching algorithm using the Bees’ Algorithm which is known

for its efficient exploration of search space as it uses two

interesting strategies intensification and diversification. The

proposed algorithm, BAforBM, is evaluated and compared to two

existing ones: genetic bloc matching algorithm and a block

matching algorithm based on PSO (Particule Swarm

Optimisation).

Keywords—Motion detection; Block matching; Bees algorithm;

metaheuristic

I. INTRODUCTION

Object tracking in a video sequence consists on extracting the movement of objects in this sequence. It is based on the variation of pixels’ brightness and color in the images’ sequence. It is a key task in many fields such as video surveillance, video games, and automatic theft detection and trespassing. In the literature, there are several approaches to detect movements in a video’s sequence: detection by background subtraction [1], frame difference [2], detection by optical flow [3] and block matching. These approaches suffer of different drawbacks such as the inaccuracy of the results. Indeed, they have difficulties in finding optimal solutions as the search space in large. Moreover, they require a long running time, and hence cannot be used in real time applications.

The aim of this paper is to show how meta-heuristics can enhance the search process in the block matching algorithm and improve its performance in terms of fast and accurate objects tracking. We propose to integrate in the search process of the block matching algorithm, the Bees’ algorithm (BA) [4] The latter has been used efficiently to solve many problems [5, 6].

This paper is organized as follows: section II introduces the block matching and its techniques. In section III, we propose an optimized block matching algorithm based on BA (BAforBM). Section IV is dedicated to the tests and results.

II. BLOCK MATCHING

The block matching is widely used in motion detection, but also in encoding and video compression. The block matching is a technique for detecting motions in a video sequence. The original image is divided into blocks of defined size called references. For each reference, one tries to find, in the following image, the best similar candidate block in a specific

region of the image called search window [7]. The similarity between a reference block and a candidate one consists on comparing the two blocks, pixel by pixel, using evaluation criteria (distance) that will be introduced in what follows. The distance between a source block and candidate blocks are called motion vectors (Fig. 1).

Fig. 1. Block

Matching principle [8].

A. Evaluation criteria

To compare the reference block A and a candidate block B of size N × N, several measures exist in the literature. Among these, one can find the mean absolute error (MAE), the mean squared error (MSE), the sum of squares of differences (SSD) and the sum of absolute differences (SAD) which formulas are given below:

Where N is the length of the block in pixels, B (i, j) is the value of the pixel at position (i, j) in the candidate block and A (i, j) is the value of the pixel at position (i, j) in the block reference.

The difference among these evaluation criteria is the computational complexity. The most used criteria are MSE and SAD.

978-1-4799-0224-8/13/$31.00 ©2013 IEEE 2390

Page 2: [IEEE IECON 2013 - 39th Annual Conference of the IEEE Industrial Electronics Society - Vienna, Austria (2013.11.10-2013.11.13)] IECON 2013 - 39th Annual Conference of the IEEE Industrial

B. Classical algorithms for block matching

To find a target block in an image, several algorithms exist in the literature. Their differences lie in the number of blocks they visit and the processing order of pixels in a block. In what follows, we will present some of these algorithms. Exhaustive block matching is the simplest algorithm, yet the most time-consuming one [9]. Indeed, all comparisons between the reference block and candidate ones are performed. The block returned by the algorithm is the one that minimizes the distance (evaluation criterion). The performance of this algorithm depends on the size of the search window. Indeed, the cost of its computation time is O(p²), where p is the size of the search window. It is obvious that this algorithm is very precise because it tests all the blocks. However, its execution time is its main drawback. It is not adapted for real time applications. For this reason, more efficient search methods emerged. They are based on the fact that there is no need to search the entire search space for the optimal block. Getting close to an optimum is sufficient.

The three step search method (TSS) was proposed by Koga et al in 1981[10]. It does not test all blocks but processes as follows:

1. choose eight blocks around the block source at a distance W

2. select the block that minimizes the distance between the reference and those blocks

3. select eight other blocks around it at a distance w/2 4. Repeat steps 2 and 3 until w <1.

The most similar block to the reference, among those tested, is returned.

TSS is not very efficient for slow movements. For this reason, the Four step search (FSS) was developed. It was proposed by Li Man Po and Wing Chun MA in 1996 [11]. The algorithm begins by testing the eight blocks around the central one. The block that minimizes the distance is selected. The main steps of the algorithm are given in the following:

Step 1: - Select the eight blocks around the central one at a distance of 2 pixels,

Select the block (Bi) that minimizes the distance,

If (Bi) is located at the center then go to step 4,

Step2: - Let (Bi) be the new central block

Select the new candidate blocks around the position of (Bi):

o If (Bi) is at the forefront block, candidates that form a triangle around it are chosen (fig 2a),

o Otherwise the blocks forming a straight line in front of (Bi) are chosen (fig 2b),

Find the block with the minimum distance. If this block is found in the center then go to step 4,

Step 3: - Repeat step 2,

Step 4: - The distance is reduced to1 pixel,

Select the eight blocks around the central block and choose the one which minimizes the criteria function.

Fig. 2. Patterns to choose block candidates in FSS.

The diamond search is another algorithm for block matching [12]. Its principle is similar to the FSS except that the search pattern is not a square but a diamond (See fig. 3). In fact, there are two diamond search patterns. Moreover, there is no limit on the number of steps.

Fig. 3. Patterns to choose block candidates in Diamond search.

III. OPTIMIZED BLOCK MATCHING USING BEES’ ALGORITHM

These recent years, the behavior of social insects has raised the interest of researchers. Indeed, these individuals are able to solve problems that an individual cannot solve alone. This is possible thanks to the communication and information sharing. Among these approaches, we are interested, in this paper, in the Bees’ algorithm (BA) [4]. Bees are such social insects that live in highly organized colonies rushes. Their organized behavior allows them to explore their environment when searching for flowers to collect pollen. Moreover, they are able to attract more bees to interesting food sources. This type of organization is characterized by self-organization, adaptation to changing environments and robustness [13].

The algorithm we propose is an adaptation of BA to block matching named BAforBM. Before presenting our algorithm, we have to define the components of our algorithm:

A bee is represented as a structure with three components: 1. Distance : represents the coordinates of the visited block, 2. Direction: the search window is divided into four parts; each part is numbered from 1 to 4. The bee will search in one of these directions. 3. Quality: represents the similarity of the visited block and the reference one. It is computed as the evaluation of SAD (sum of absolute differences).

The environment is the search window.

Sites (flowers) visited by bees represent blocks of the image

A region is the neighborhood of a block.

2391

Page 3: [IEEE IECON 2013 - 39th Annual Conference of the IEEE Industrial Electronics Society - Vienna, Austria (2013.11.10-2013.11.13)] IECON 2013 - 39th Annual Conference of the IEEE Industrial

The BA_BM algorithm has as input blocks of the reference image and the current one. The first step of the algorithm is to eliminate static blocks. Then, for each reference block, the BAforBM algorithm is applied. The main steps of BAforBM are given below:

N bees are scattered randomly in the candidate

blocks of the search window

For each block, among the N candidate blocks, the

evaluation criteria SAD is computed to evaluate the

quality of the block candidate

The M best bees are selected. They represent the

best candidate blocks.

Nba bees are sent in the neighborhood of the E best

blocks among the M (the neighborhood is defined as

a window around the visited block)

Nbe bees are sent in the neighborhood of the

remaining blocks M-nba blocks such as nbe<nba

The bees on the best blocks are saved and the

process reiterates, from step 3, until it reaches a

certain number of generations.

The following figure illustrates how this algorithm proceeds. The different parameters are set as follows: The number of generation=2, N = 10, M = 5, E = 3, Nba =2, and Nbe = 1.

Fig. 4. BA applied to the block matching.

IV. TESTS AND RESULTS

In the following, we will conduct two types of tests. The first type is to set our algorithm’s parameters and the second one is to compare BAforBM to block matching algorithms optimized respectively with genetic algorithm [14] and particle swarm optimization (PSO) [15]. For this purpose, we have used three different types of videos: slow motion, normal motion and fast motion videos. In slow motion videos

dissimilarity between two consecutive images is low. This type of video allows testing the ability of an algorithm to detect motions between two consecutive images. The video chosen for this type of movement is a fly wings beating video filmed in slow motion. In, fast motion video, dissimilarity between two consecutive images grows. This type of video allows testing the processing time of the algorithm. The video chosen for this type of movement is a surveillance video in a tunnel. In normal motion videos, dissimilarity between two consecutive images is average. The video chosen for this type of movement is a road surveillance video in an urban area.

The performances of an algorithm is evaluated through its execution time (seconds), the average error (SAD), the number of visited blocks and visually.

A. Parameters setting for BAforBM

There are two types of parameters to set: 1. the block matching ones such as dissimilarity threshold, size of the search window and the block size. 2. The bees’ algorithm ones such as number of bees and number of generations. For the first set of parameters and after varying their values, we noticed that the best compromise between a good detection and a good execution time was obtained for dissimilarity threshold = 500, size of the search window = 7, and block’s size set to 8. The rest of this section is dedicated to tuning up the Bees Algorithm parameters.

Number of bees

In this section, we will show the impact of the number of bees on BAforBM for the slow motion video. The number of generations is set to 10, and the number of bees varies from 5 to 30. One notices, from graphs of fig.5, that increasing the number of bees in the search process decreases the value of the mean SAD considerably. For 25 bees, the mean error drops to 3,75. However such improvement, affects negatively the execution time. This is due to the fact that more bees will be sent to search for best blocks. As a result, the search will be more successful as more blocks will be visited (very accurate detection). However the execution time will increase considerably.

Fig. 5. Evolution of Mean SAD, execution time and number of visited blocks

for the slow motion video.

The following figure shows the detection of beating wings for different number of bees.

Fig. 6. Motion detection with different number of bees = 5, 15 and 25.

2392

Page 4: [IEEE IECON 2013 - 39th Annual Conference of the IEEE Industrial Electronics Society - Vienna, Austria (2013.11.10-2013.11.13)] IECON 2013 - 39th Annual Conference of the IEEE Industrial

The best compromise between the mean SAD and the execution time is obtained for number of bees=5, and this for the three types of videos. As a result, we retained this value for the number of bees and varied the number of generations (NG) (NG= 1, 10, 50) for the three video’s types. Fig. 7 gives the evolution of Mean SAD and execution time for the fast video. and Fig. 8 shows a visual detection of cars driving at high speed in a tunnel for different number of bees.

Fig. 7. Evolution of Mean SAD, execution time for the fast motion video.

Fig. 8. Motion detection with different number of bees = 5, 15 and 25

From all the tests we have done, we can conclude that for a good motion detection, the number of generation depends on the speed of the video. For a slow motion, one generation is sufficient, while for a fast motion, 10 generations are needed.

B. Comparison of BAforBM with genetic and PSO algorithms

for block matching

In order to show the efficiency of the searching approach of bees’ algorithm in block matching, we implemented two block matching algorithms using genetic algorithm, GAforBM, and Particle Swarm Optimization, PSOforBM, and compared their performances. For the three algorithms we set their parameters to their best value (These values were obtained after performing several tests). Fig. 9 shows the mean SAD of respectively AGforBM, PSOforBM and BAforBM for slow, average and fast motion videos. One can note that the best SAD is obtained by BAforBM.

Figures 11, 12, and 13 show, through an image of the sequence, the object detection for respectively, slow, average and fast motions.

BAforBM performs better than PSOforBM and GAforBM. Even though BA visits less blocks than GA, it finds better solutions (more similar blocks). This is due to effective exploration of bees in the search space.

Fig. 9. Mean SAD obtained by AGforBM, PSOforBM and BAforBM.

The next figure gives the execution time of the three approaches. For slow motion video, BAforBM gives the best mean SAD at the lowest execution time. However the search for best blocks takes more time when motion video is fast.

Fig. 10. Execution time AGforBM, PSOforBM and BAforBM

Fig. 11. Objects’ detection for AGforBM, PSOforBM and BAforBM on slow motion video.

Fig. 12. Objects’ detection for AGforBM, PSOforBM and BAforBM on

average motion video.

Fig. 13. Objects’ detection for AGforBM, PSOforBM and BAforBM on fast

motion video.

Indeed, after the bees are scattered in a region (step 1 of the algorithm), bees converge to the best sites and more bees are sent to search in these sites’ neighborhoods, unlike GA which conducts a random search. In terms of execution time, PSO takes less time to go through the search space, except for the slow motion video.

Through the different results obtained, one notes that the detection is more or less accurate depending on the algorithm used. We note that GA detects motion, but do not detect all the moving objects. As for PSO, its main drawback is that it detects the edges of objects in motion and the emptiness left by the motion detection. BA, on the contrary, gives the best performance. All objects are detected. The main advantage of BA is that it finds solutions close to the optimum. This is due to the use of intensification (more bees are sent to the best blocks) and diversification (some bees are sent to less interesting blocks) used by BA. This principle allows BA to visit more efficiently the search space compared to other bio-inspired algorithms. The main drawback of BAforBM is the

2393

Page 5: [IEEE IECON 2013 - 39th Annual Conference of the IEEE Industrial Electronics Society - Vienna, Austria (2013.11.10-2013.11.13)] IECON 2013 - 39th Annual Conference of the IEEE Industrial

execution time. To have optimal results, the number of bees and the number of generations should be increased, but this, negatively, affects the execution time. However, with the same execution time, BAforBM has a better detection and a smaller error than GAforBM and PSOforBM.

V. CONCLUSION

The detection of moving objects in a video sequence is a central issue in many domains. As we have seen there are several approaches to do so. We are interested in this paper in block matching. It consists in searching for blocks in images. Its main drawback is the difficulty to find optimal blocks in a large search space. To overcome this problem, we propose to adapt the Bees’ algorithm to the block matching. Our algorithm gives promising results when compared to two genetic algorithms and PSO.

REFERENCES

[1] A. Elgammal, D. Harwood, and L. Davis, ―Non-parametric model for background subtraction,‖ in Proceedings 6th European Conference on Computer Vision, Dublin, Ireland, vol. II, pp. 751–767, June 2000.

[2] D.Migliore, M. Matteucci, M. Naccari, and A. Bonarini, ―CA revaluation of frame difference in fast and robust motion detection,‖ Proceedings of the 4th ACM international, workshop on Video surveillance and sensor networks, pp. 215–218, 2006.

[3] C. Bernard, ―Ondelettes et problèmes mal posés : la mesure du flot optique et l’interpolation irrégulière,‖ Thèse de doctorat. Ecole polytechnique palaiseau, France, 1999.

[4] D.T. Pham, A. Ghanbarzadeh, E. Koc, S. Otri, S. Rahim, and M. Zaidi, ‖The bees algorithm —a novel toolfor complex optimisation problems, ‖ Proceedings of IPROMS conference, Cardiff, UK, pp 454– 461, 2006.

[5] D.T. Pham, E. Koc, J. Lee, and J. Phrueksanant, ‖Using the bees algorithm to schedule jobs for a machine, ‖ Proceedings of eighth international conference on laser metrology, CMM and machine tool performance, pp 430–439, 2007.

[6] D.T. Pham, A.J. Soroka, E. Koc, A. Ghanbarzadeh, and S. OtriSome, ‖Applications of the bees algorithm in engineering design and manufacture,‖ Proceedings of international conference on manufacturing automation, Singapore, 2007.

[7] A. Gyaourova, C. Kamath, and S.-C. Cheung, "Block matching for object tracking," LLNL Technical report, October 2003.

[8] F. Chiung-Yao, "Video coding," Course: National Taiwan Normal University Taiwan, 1995.

[9] M. Brunig and W. Niehsen, ―Fast Full-search Block Matching,‖ IEEE Trans. Circuits Syst. Video Technol., vol. 11, no. 2, pp. 241–247, 2001.

[10] R. Li, B. Zeng, and M. L. Liou, ―A new three-step search algorithm for block motion estimation,‖ IEEE Trans. Circuits Syst. Video Technol., vol. 4, pp. 438442, Aug. 1994.

[11] L.M. Po, and W.C. Ma, ―A Novel Four-Step Search Algorithm for Fast Block Motion Estimation,‖ IEEE Trans. Circuits And Systems For Video Technology, vol 6, no. 3, pp. 313-317, June 1996.

[12] S. Zhu, and K.K. Ma, ―A New Diamond Search Algorithm for Fast Block-Matching Motion Estimation,‖ IEEE Trans. Image Processing, vol 9, no. 2, pp. 287-290, February 2000.

[13] X. Lu, y .Zhou, ―A novel global convergence algorithm: bee collecting pollen algorithm,― in proceedings of the 4th international conference on intelligent computing, Springer-Verlag, Berlin, Heidelberg, pp 518–525, 2008.

[14] C.-H. Lin and J.-L. Wu, ―A lightweight genetic block-matching algorithm for video coding,‖ IEEE Trans. Circuit Syst. Video Technol., vol.8, pp. 386–392, Aug. 1998.

[15] X. Yuan, X. Shen, ―Block Matching Algorithm Based on Particle Swarm Optimization for Motion Estimation,‖ International Conference on Embedded Software and Systems, pp. 191-197, 20.

2394

Powered by TCPDF (www.tcpdf.org)