• No results found

Pattern matching in Rotated Images Using Genetic Algorithm

N/A
N/A
Protected

Academic year: 2022

Share "Pattern matching in Rotated Images Using Genetic Algorithm"

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

47

Pattern matching in Rotated Images Using Genetic Algorithm

Mutasem K. Alsmadi and Usama A. Badawi*

Department of MIS, Collage of Applied Studies and Community Service, University of Dammam, Saudi Arabia.

* Department of Mathematics, Faculty of Science, Cairo University, Egypt

Abstract. Pattern recognition (PR) is a challenging task when images contain distortion, partial shape, overlap, occluded, noise and segmentation error in the digital image. This paper presents a new approach to match a partial image with rotated images by using a genetic algorithm (GA). A genetic algorithm with a chromosome of small length was used to decrease the search space, whereby the results can be obtained in a short time. The new approach translates the partial image into the rotated image and rotates it by angle θ to obtain the best matching quickly. To show the efficiency and accuracy of the proposed new approach, some examples are shown.

Keywords: Genetic algorithm, Pattern matching and Rotated images.

1. Introduction

In many applications image matching plays an important and essential role such as multi-spectral image analysis and multi- modality medical imaging (Aguilera, Barrera, Lumbreras, Sappa, & Toledo, 2012; Bhadoria, Aggarwal, Dethe, & Vig, 2012; Saleem, Bais,

& Sablatnig, 2012; Simunic & Loncaric, 1998). Producing a single image from multi- source of object information is the main role of matching (Simunic & Loncaric, 1998).

The image detecting and matching are the key technology of the computer vision. This technology focuses on determining the unknown transform parameters required to map one image to match an image. The basic matching are mold plate matching, and distance tolerance, correlation matching.

The genetic algorithms (GAs) are faster than the other methods for finding the near optimal solution (M. Alsmadi, Omar, Noah,

& Almarashdeh, 2011; Singhai & Singhai, 2012). It has been intensively investigated and applied to many optimization problems.

Some problems are related to pattern recognition;

image processing, image registration, image segmentation and contour recognition (M.

Alsmadi et al., 2011; Bhanu, Lee, & Ming, 1991; Grefenstette & Fitzpatrick, 1985; Hill &

Taylor, 1992; Roth & Levine, 1994; Singhai &

Singhai, 2012; Toet & Hajema, 1995). A Cascaded genetic algorithm for efficient optimization and pattern matching has been presented in (G. Garai & Chaudhuri, 2002).

A genetic algorithm for global rigid matching of partial view images has been presented in (Simunic & Loncaric, 1998).

GAs have been used in optimization of feature extraction chain, error correcting graph isomorphism and dot pattern matching (Ansari, Chen, & Hou, 1990; Assudani &

Malik, 2013; P. J. Assudani & L. G. Malik, 2012; Purshottam J. Assudani & Latesh G.

Malik, 2012; Yuan-Kai, Kuo-Chin, & Jorng- Tzong, 1997) and optimize search space (Mutasem Alsmadi & Omar, 2012; Badawi

& Alsmadi, 2014; Singhai & Singhai, 2012).

The GA needs a large number of generations to reach the solution. In the pattern-matching problem, the chromosomes

(2)

length is set depending on the accuracy of the required solution. The length remains constant throughout the execution of the algorithm (Gautam Garai & Chaudhurii, 2013). Thus, if more accurate solution is required, the chromosome length should be larger, thereby increasing the execution time of the GA (G. Garai & Chaudhuri, 2002).

The aim of this research work is to design an efficient GA that matches a partial image with an image space that represents a rotated image. Therefore; the partial image and the image space are given as a dot matrix (0, 1).

In the proposed approach the image space is divided into some partial images, every sub image has the same size of the given partial image that must be match. A genetic algorithm is used to match the partial image with the image space. The advantage of the proposed genetic algorithm is that it uses a chromosome of small length in order to overcome the limitations of the existing genetic algorithms (Ansari et al., 1990; G.

Garai & Chaudhuri, 2002; Piszcz & Soule, 2006; Roeva, Fidanova, & Paprzycki, 2013;

Yuan-Kai et al., 1997).

The paper is organized as follows: the pattern-matching problem is described in section 2. In section 3, the proposed approach is presented. The experimental results are shown in the section 4. This research consider the following notation to describe the problem of pattern matching:

Notation

• ND: the pixel number of the pattern P.

• NDM: the pixel number of the partial matching.

• RD: the number of required pixels and equal to 0.7*ND.

• pop_size: the number of chromosomes in each population.

• gen: the generation counter.

• max_gen: the maximum number of generation.

• Pc: the crossover ratio.

• Pm: the mutation ratio.

2. The Problem Description

The problem of pattern matching in 2D was matching an unknown pattern with some known patterns and the best matching pattern is to be found out. The known pattern space in a pattern-matching problem is normally equal to the image space.

Fig. 1. S represents an image and P represents the unknown pattern.

This research assumes that the image space S has a length M in x-direction and N in y direction, and the unknown pattern P has a length K in x-direction and L in y-direction, such that K<M and L<N as shown in Fig 1.

This work aims to match the partial image with the image space as the following steps:

1. P will be translated to a position (X,Y) in S.

2. P will be rotated by angle θ, the position (X,Y) becomes .

3. The best matching pattern will be found out as follows:.

Fig .2. P translted to (X,Y) and rotated by angle θ.

Where the co-ordinate is given by the following relationship :

3. The Proposed Genetic Algorithm

The image space S is divided into some partials; each one has the same size of the pattern P and each partial is referred by a

(3)

position with special co-ordinate (X,Y). Any position (X,Y) for each partial in the image space S is easily formed into a binary string that can be used as a chromosome for genetic algorithm. The elements of a chromosome are written as bits (0,1). The chromosome has a small length and it represents the possible solution with a position in the solution space.

3.1 Chromosome Representation

The chromosome length (LC) is determined by the search space dimensionality and size, and is given by the relation:

where D1 represents the length of the chromosome in x-direction, D2 in y-direction and D3 the rotation angle. The value of D1 and D2 is given as the following relationships:

The chromosome is represented in the following form:

(6)

It is represented as a string of bits as shown in Fig.3.

x

1

. . .

. xD 1

y

1

. . .

. yD 2

θ

1

. . .

. θD 3

1 1 1 0 0 1 0 1 1 0 1 1

Fig. 3. Chromosome Form.

The elements of a chromosome (x1 x2 x3 ……

xD1) represent the co-ordinate X, and (y1 y2 y3

…… yD2) represent the co-ordinate Y of a position (X,Y) and (θ1 θ2θ3………θD3) represent the rotation angle in S.

3.2 The Fitness Function

Each generated chromosome represents a position (X,Y) in the image space S. This position represents the co-ordinate of the translation point of a partial image in S. The partial image will be rotated by angle θ and then, the position is computed by using Eq. (1). The fitness function will check

this position , if it is included in S or not as follows:

And

3.3 The Initial Population

The initial population is considered as a set of chromosomes that are generated randomly. The following steps show how the initial population can be obtained:

1. Generate the initial population randomly according to Eq. 3, 4, and 5.

2. If the chromosome generated in step 1 fails to satisfy the Eq. 7 discard it and repeat step 1

3. If the pop_size chromosomes are generated then stop.

3.4 Genetic Crossover Operation

The crossover operation is performed by one-cut point, according to the crossover ratio (Pc). The cut point is selected randomly from 0 to D1+D2. The offspring is generated by the crossover operation as shown in Fig.

4.

Fig. 4. Corssover operation.

3.5 Genetic Mutation Operation

The mutation operation is performed on bit- by-bit basis, according to the mutation ratio (Pm). The mutation ratio Pm is estimated randomly. The point to be mutated is selected randomly from 0 to D1+D2. An offspring is mutated mutation as shown in Fig. 5.

Fig. 5. Mutation operation.

(4)

3.6 The Entire Algorithm

1. Set the parameters: pop_size, max_gen, Pm, Pc. .

2. Determine the dimensions of the image S (M, N) and the dimensions of the patern P(K, L) . 3. Compute the length of the chromosome LC

according to Eq. 2.

4. Generate the initial population randomly as described in Sec. 3.3

5. Set gen=1

6. While (gen < = max_gen) do { 7. Set P=1

8. While (P <= pop_size) do {

9. Apply Genetic operations to obtain new population

• Apply crossover according to Pc parameter (Pc >=0.90) as described in section 3.4.

• Apply Mutation as shown in section 3.5.

• Perform the fitness function

10. Compare the pixels of the pattern P and the pixels of the new child and compute NDM.

11. P = P+1:

12. }.

13. Compare NDM with RD for all new children, if NDM < RD, then replace RD by NDM and store the chromosome.

14. gen=gen+1

15. if gen > max_gen then stop

16. Hence obtain the best chromosome with the point (X',Y')

4. The Expermental Results

The experiments in this research were conducted based on the rotation of partial pattern and the images with different angles as shown in table 1, Fig. 6 shows an examples of the rotated pattern and image with 60 degrees, and Fig. 7 shows an example of the only rotated image with 60 degrees. The experiments shows that when the image and the pattern are rotated with same angles, the proposed genetic algorithm successfully matches the pattern with the image that has the same pattern with a percentage of 100% as shown table 1.

Fig. 6. Shows an example of the rotated pattern and image with 60 degrees

Fig. 7. Shows an example of only rotated image with 60 degrees.

Oppositely; the experiments shows that when the pattern or image is only rotated, the matching accuracy was decreased when increasing the rotation degrees, because some of the pixels in the rotated pattern or image are not matching each other exactly as shown in table 2 and this was the main limitation of this research. Despite this results; the proposed algorithm is very effective in the case of rotational image as shown in table 2.

S (a)

P

S (b)

Fig. 8. A pertial image P with and without image space S rotation.

Another experiment is conducted to explain how to calculate the chromosome length (LC). In this experiment, two different examples are presented to show the capability of the proposed genetic algorithm for matching a partial image P with rotation and without rotation image space S. In the first example, the image space S is given without rotation as shown in Fig. 8.a but in

(5)

the second example, the rotational image is used as shown in Fig. 8.b. The image space S in the two examples is Lenna photo and the partial image P is the eye of Lenna photo. The size of the image space S is 256*256 and the partial image P is 25*36 pixels.

In the experimental examples, the proper settings of the GA parameters are:

pop_size=20, MG =10000, Pc=0.95, Pm=0.05 and NRUN=10.The chromosome length (LC) is computed as follows:

Then LC=8+8+5=21.

Table 1. Shows the rotation degrees for both of the partial pattern and image.

Rotation degrees 0 5 10 20 30 45 60 75 90 Matching Degree 100% 100% 100% 100% 100% 100% 100% 100% 100%

Table 2. Shows the rotation degrees for image only.

Rotation

degrees 0 5 10 20 30 45 60 75 90 Matching

Degree 100%90%90%85% 80% 75% 75% 75% 75%

Table 3. Shows the results of two different examples to show the capability of the proposed GA.

After running the algorithm, the partial image P was matched perfectly with the image space S of the first example, but is matched with a ratio of 77% with the image space S of the second example. This results show that the proposed algorithm is very effective in the case of rotational image as shown in table 3.

Moreover; the proposed method has the capability to handle different image types such as colored and gray images.

The proposed GA is very useful and enabled us to obtain results faster, leading to save time and effort. In other words, the use of GA has played a major role in reducing the

search space generated by the problem.

Therefore; the merits of this work is obtaining result faster, which lead to save time and effort. On the other hand; the demerits of this work is that the proposed algorithm was not applied on images which are taken with different angles. Future Direction for this work is to use the genetic algorithm in image recognition by a pattern matching.

5. Conclusion

A novel approach is presented in this work;

the proposed approach matches the partial image with the rotated images using a genetic algorithm (GA). Therefore; the approach divides the image space into some partials;

each one has the same size of the partial image that must be match. After that the partial image is translated to a position (X, Y) inside the image space and rotated by angle θ, and the best matching is found effectively and accurately. The proposed genetic algorithm uses a chromosome with small length to decrease the search space. The choice of the chromosome length is determined based on the search space dimensionality and size. The chromosome with a small length represents a possible solution with a position in the solution space. The fitness function checks whether the chromosome is included in the solution space or not. The algorithm selects all chromosomes that have the maximum RT. It uses the crossover and mutation operation to obtain an optimal position. Finally; the future work of this research is to develop intelligent methods that have the ability to extract some patterns from the object inside the image, and to use these patterns to recognize the images that have the same patterns.

References

[1] Aguilera, C., Barrera, F., Lumbreras, F., Sappa, A. D.

and Toledo, R. (2012) Multispectral Image Feature Points. Sensors, 12, (9): 12661-12672.

[2] Saleem, S., Bais, A. and Sablatnig, R. (2012) A Performance Evaluation of SIFT and SURF for Multispectral Image Matching. In A. Campilho & M.

Kamel (Eds.), Image Analysis and Recognition, 7324, pp: 166-173, Springer Berlin Heidelberg.

[3] Simunic, K. and Loncaric, S. (1998) A genetic search- based partial image matching. Paper presented at the

Case Size (S) Size (P) ND NDM Max_gen (X,Y) Θ Matching accuracy 1 256*256 25*36 900 900 353 (110,157) (133,137) 9 100%

2 256*256 25*36 900 690 223 (131,132) (128,134) 5 77%

(6)

In 2nd IEEE Intl. Conf. on Intelligent Processing Systems, Gold Coast, Australia.

[4] Bhadoria, S., Aggarwal, P., Dethe, C. G. and Vig, R.

(2012) Comparison of Segmentation Tools for Multiple Modalities in Medical Imaging, Journal of advances in information technology, 3, (4): 197-205.

[5] Singhai, R. and Singhai, J. (2012) Registration of Satellite Imagery Using Genetic Algorithm. Paper presented at the Proceedings of the World Congress on Engineering London, U.K.

[6] Alsmadi, M., Omar, K. B., Noah, S. A. and Almarashdeh, I. (2011) A Hybrid Memetic Algorithm with Back-propagation Classifier for Fish Classification Based on Robust Features Extraction from PLGF and Shape Measurements. Information Technology Journal, 10, (5): 944-954.

[7] Bhanu, B., Lee, S. and Ming, J. (1991) Self-optimizing image segmentation system using a genetic algorithm.

Paper presented at the Proceedings of the 4th International Conference on Genetic Algorithms, San Diego.

[8] Grefenstette, J. J. and Fitzpatrick, J. M. (1985) Genetic Search with Approximate Function Evaluation. Paper presented at the Proceedings of the 1st International Conference on Genetic Algorithms.

[9] Hill, A. and Taylor, C. J. (1992) Model-Based Image Interpretation Using Genetic Algorithms. Image and Vision Computing, 10, 295-300.

[10] Roth, G. and Levine, M. D. (1994) Geometric primitive extraction using a genetic algorithm. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 16(9), 901-905. doi: 10.1109/34.310686.

[11] Toet, A. and Hajema, W. P. (1995) Genetic contour matching. Pattern Recogn. Lett., 16, (8): 849-856. doi:

10.1016/0167-8655(95)00015-9.

[12] Garai, G. and Chaudhuri, B. B. (2002) A cascaded genetic algorithm for efficient optimization and pattern matching. Image and Vision Computing, 20(4), 265- 277.

[13] Assudani, P. and Malik, L. G. (2013) Dot Based Image Analysis Using Local Binary Pattern and Genetic Algorithm. In V. Das & Y. Chaba (Eds.), Mobile

Communication and Power Engineering (Vol. 296, pp.

430-434): Springer Berlin Heidelberg.

[14] Assudani, P. J. and Malik, L. G. (2012) 22-24 Feb. Dot pattern feature extraction, selection and matching using LBP, Genetic Algorithm and Euclidean distance.

Paper presented at the Computing, Communication and Applications (ICCCA), International Conference on.

[15] Assudani, P. J. and Malik, L. G. (2012) Genetic Algorithm Based Dot Pattern Image Processing International Journal of Computer Applications, 31-35.

[16] Yuan-Kai, W., Kuo-Chin, F. and Jorng-Tzong, H.

(1997). Genetic-based search for error-correcting graph isomorphism. Systems, Man, and Cybernetics, Part B: Cybernetics, IEEE Transactions on, 27, (4):

588-597. doi: 10.1109/3477.604100.

[17] Ansari, N., Chen, M. H. and Hou, E. S. H. (1990) 27-30 Nov. Point pattern matching by a genetic algorithm.

Paper presented at the Industrial Electronics Society, IECON '90., 16th Annual Conference of IEEE, [18] Alsmadi, M. and Omar, K. (2012) Fish Classification:

Fish Classification Using Memetic Algorithms with Back Propagation Classifier: Lap Lambert Academic Publishing.

[19] Badawi, U. A. and Alsmadi, M. K. (2014) A General Fish Classification Methodology Using Meta- Heuristic Algorithm With Back Propagation Classifie.

Journal of Theoretical and Applied Information Technology, 66(3), 803-812.

[20] Garai, G. and Chaudhurii, B. B. (2013) A novel hybrid genetic algorithm with Tabu search for optimizing multi-dimensional functions and point pattern recognition. Information Sciences, 221, 28-48.

[21] Roeva, O., Fidanova, S. and Paprzycki, M. (2013) Influence of the Population Size on the Genetic Algorithm Performance in Case of Cultivation Process Modelling. Paper presented at the Proceedings of the 2013 Federated Conference on Computer Science and Information Systems.

[22] Piszcz, A., and Soule, T. (2006) Genetic Programming:

Optimal Population Sizes for Varying Complexity Problems. Paper presented at the Proceedings of the Genetic and Evolutionary Computation Conference.

(7)

ﻷا ﺔﻘﺑﺎطﻣ ﺔﻳﻧﻳﺟﻟا ﺔﻳﻣزراوﺧﻟا مادﺧﺗﺳﺎﺑ ﺔﻔﺗﻠﻣﻟا روﺻﻟا ﻲﻓ طﺎﻣﻧ

مﺻﺗﻌﻣ ﻝﻳﻠﺧ

ﻣﺻﻟا و يدﺎ ﻪﻣﺎﺳأ

*

فوؤرﻟادﺑﻋ يوادﺑ

ﻹا تﺎﻣوﻠﻌﻣﻟا مظﻧ مﺳﻗ ﺔﻳراد

, ﻊﻣﺗﺟﻣﻟا ﺔﻣدﺧو ﺔﻳﻘﻳﺑطﺗﻟا تﺎﺳاردﻟا ﺔﻳﻠﻛ ,

مﺎﻣدﻟا ﺔﻌﻣﺎﺟ ,

ﺔﻳدوﻌﺳﻟا ﺔﻳﺑرﻌﻟا ﺔﻛﻠﻣﻣﻟا

*

و ، ةرﻫﺎﻘﻟا ﺔﻌﻣﺎﺟ ،موﻠﻌﻟا ﺔﻳﻠﻛ ،تﺎﻳﺿﺎﻳرﻟا مﺳﻗ ﺔﻳﺑرﻌﻟا رﺻﻣ ﺔﻳروﻬﻣﺟ ،

ﻣﻟا ﺗﺳ ﺧﻠ ص . طﺎﻣﻧﻷا ﻰﻠﻋ فرﻌﺗﻟا )

(PR

وﻫ ﺔﺑﻌﺻ ﺔﻣﻬﻣ ﺎﻣدﻧﻋ

يوﺗﺣﺗ روﺻﻟا ﻰﻠﻋ ،ﻪﻳوﺷﺗﻟا و

ﻝﻛﺷ

ﻲﺋزﺟ ، و

،ﻝﺧادﺗﻟا و ﺔﻳطﻐﺗﻟا ، و ءﺎﺿوﺿﻟا ﺄطﺧو

ﻟا ﺔﺋزﺟﺗ ﻲﻓ ﻟا ﺔﻳﻣﻗرﻟا ةروﺻ .

ةدﻳدﺟ ﺔﻘﻳرط ضرﻌﻳ ثﺣﺑﻟا اذﻫ

ﺔﻘﺑﺎطﻣﻟ روﺻﻟا ﻟا ﺔﻳﺋزﺟ روﺻﻟا ﻊﻣ مادﺧﺗﺳﺎﺑ ﺔﻔﺗﻠﻣﻟا

ﺔﻳﻧﻳﺟﻟا ﺔﻳﻣزراوﺧﻟا )

.(GA

ﺔﻳﻧﻳﺟ ﺔﻳﻣزراوﺧ مادﺧﺗﺳا مﺗ

تاذ موﺳوﻣورﻛ ﻟ رﻳﺻﻗ

ﻝﻳﻠﻘﺗ ﺔﺣﺎﺳﻣ

،ثﺣﺑﻟا ثﻳﺣ ﻰﻠﻋ ﻝوﺻﺣﻟا نﻛﻣﻳ ﻲﻓ ﺞﺋﺎﺗﻧﻟا

رﻳﺻﻗ تﻗو .

ﺞﻬﻧﻟا

دﻳدﺟﻟا ﻝﻘﻧﻳ ﻟا ةروﺻ ﻟا ﺔﻳﺋزﺟ إ ﻟ ﻰ ةروﺻﻟا ﺔﻳوازﺑ ﺔﻔﺗﻠﻣﻟا ﻧﻳﻌﻣ

ﺔ ﻝﺿﻓأ ﻰﻠﻋ ﻝوﺻﺣﻠﻟ

وأ عرﺳ ﺔﻘﺑﺎطﻣ . و رﺎﻬظﻹ

ةءﺎﻔﻛ ﺔﻗدو دﻳدﺟﻟا ﺞﻬﻧﻟا

، مﺗ مﻳدﻘﺗ ﺔﻠﺛﻣﻷا ضﻌﺑ .

ﺔﻳﺣﺎﺗﻔﻣﻟا تﺎﻣﻠﻛﻟا :

ﺔﻳﻧﻳﺟﻟا ﺔﻳﻣزراوﺧﻟا ,

ﺔﻔﺗﻠﻣﻟا روﺻﻟا

و ﻷا ﺔﻘﺑﺎطﻣ طﺎﻣﻧ

.

References

Related documents

to test the impact of culture conditions on the growth of mycelia; 3) to evaluate antibacterial activity of mycelial extracts against several Gram-positive or Gram-negative

Because the main reac- tions of the acetic acid pulping are ether cleavage reactions, the result shows that the residual lignin in oxygen-bleached kraft pulp contains

En ambos caso los impuestos gravan a la renta, y si sobre la renta hemos establecido una evolución a largo plazo y una tendencia permanente a existir y distribuir (véase los

This algorithm proceeds as, master keys (Key-M) are generated carefully for each node and stored in the memory of the individual node in pre deployment phase of a network,

Trap volume distribution and resulting loss function realizations for Scenario 1 (prior) and Scenario 2a, in which we introduced the likelihood of a thick seal.. Comparing both, we

Based on the research of the Chinese and Hong Kong MBA programs and their customers in the international social networks1. VasilyKashkin,

It refers to a broad set of policies, technologies, and controls deployed to protect data, applications, and the associated infrastructure of cloud computing.”

Ratio starch-chitosan affects the characteristics of the bioplastic films, such as mechanical properties, physical properties, and biodegradability, so these need tests, and it aimed