IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.23 (2) 2010 The Invariant Moments Based With Wavelet Used To Decide the Authintication and Originality of Images H.L. Hussein Department of Computer Science, College of Education, University of Baghdad Abstract The digital image with the wavelet tools is increasing nowadays with MATLAB library, by using this method based on invariant moments which are a set of seven moments can be derived from the second and third moments , which can be calculated after converting the image from colored map to gray scale , rescale the image to (512 * 512 ) pixel , dividing the image in to four equal pieces (256 * 256 ) for each piece , then for gray scale image ( 512 * 512 ) and the four pieces (256 * 256 ) calculate wavelet with moment and invariant moment, then store the result with the author ,owner for this image to build data base for the original image to decide the authority of these images by using comparison using Mean Square Error (MSE) as shown below :- The moments value of any image will be compared with the original data base images moment. The experiments were performed on a Pentium IV, 1.6 GHz processor, running Microsoft Windows XP and the programs were implemented by MATLAB . Index Terms— wavelet, digital image, moment Introduction Searching a digital library having large numbers of digital images or video sequences has become important in this visual age. Every day, large numbers of people are using the Internet for searching and browsing through different multimedia databases. Image feature vector indexing has been developed and implemented in several multimedia database systems such as the IBM QBIC System developed at the IBM Almaden Research Center, the Virage System developed by Virage, Inc., and the Photo book System developed by the MIT Media Lab[1]. For each image inserted into the database, a feature vector on the order of 500 elements is generated to represent accurately the content of the image. This vector is much smaller in size than the original image. The difficult part of the problem is to construct a vector that both preserves the image content and yet is efficient for searching. Once the feature vectors are generated, they are then stored in permanent storage. To answer a query, the image search engine scans through the previously computed vector indexes to 2 1 0 1 0 ),(),( M y N x   1  yxfyx N* M MSE         IHJPAS IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.23 (2) 2010 select those with shortest distances to the image query vector. In this project, the research develops a new algorithm to make semantically-meaningful comparisons of images efficient and accurate. Figure 1 shows the basic structure of the system. To accurately encode semantic features of images we employ wavelets based. Using these wavelets and statistical moments' analysis, the algorithm produces feature vectors that provide much better frequency localization than other traditional color layout coding al- gorithms. The libraries can use the digital image processing to decide the authority of each picture in them by using simple algorithm by extracting the moment of each picture and store that values in term of data base to compare these values with any unknown p icture. As a result, millions of pictures flow on the Internet everyday. Nowadays, the interchange of images becomes more and more frequent. Many techniques operating on images formats have been published and become publicly available. To answer a query, the image search engine scans through the previously com- puted vector indexes to select those with shortest moment terms to the image query vector. Many color image formats are currently in use, e.g., GIF, JPEG, PPM and TIFF are the most widely used formats. Because images in the image database can have different formats and different sizes. For the test database of relatively small images, a rescaled thumbnail consisting of 512 x 512 pixels in Red-Green-Blue (RGB) color space is adequate for the purpose of computing the feature vectors, and then convert the input image from colored image to the gray-scale image. The original gray scale image (512 * 512) will be divided into four equal divisions ,each part is ( 256 * 256 ) p ixel as shown in fig. 2 . Wavelet Wavelets are mathematical functions that cut up data into different frequency components, and then study each component with a resolution matched to its scale. Wavelets were developed independently in the fields of mathematics, quantum physics, electrical engineering, and seismic geology. Interchanges between these fields during the last ten years have led to many new wavelet applications such as image compression, turbulence, human vision, radar, and earthquake prediction [2]. So that , this project use the Haar as a type of wavelet with MATLAB Language as a function of image compression. The Haar wavelet is the oldest and simplest transform and based on the Haar scaling and wavelet functions. The decomposition and reconstruction filter for a Haar based transform are of length 2 and obtained as followes : >> [ Lo_D, Hi_D, Lo_R, Hi_D] = wfilters('Haar') Lo_D = 0.7071 0.7071 Hi_D = -0.7071 0.7071 Lo_R = 0.7071 0.7071 Hi_D = 0.7071 -0.7071 Invariant Moments Invariant moments which are a set of seven moments can be derived from the second and IHJPAS IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.23 (2) 2010 third moments. Moment features used in this paper can provide the properties of invariance to scale, position, and rotation. We used moment analysis to extract invariant features from tessellated cells in an ROI. This section gives a brief description of the moment analysis. For a 2-D continuous function f(x, y), the moment of order (p+q) is defined as [3,4] : ∞ ∞ μpq = ∫ ∫ x p yq f(x,y) dxdy for p,q = 0,1,2,……….. (1) -∞ -∞ A uniqueness theorem states that if f(x, y) is piecewise continuous and has nonzero values only in a finite part of the xy-plane, moment of all orders exist, and the moment sequence (μpq) is uniquely determined by f(x, y). Conversely, (μpq) is uniquely determined by f(x, y). The central moments are defined as: ∞ ∞ μpq = ∫ ∫(x - xbar) p(y –ybar)q f(x, y) dx dy ………………...….(2) -∞ -∞ Where xbar =( µ10/ µ00) and ybar = (µ01/ µ00). i.e. moments where the centre of gravity has been moved to the origin (i.e. µ10 = µ01 = 0). If f(x, y) is a digital image, then Eq. (2) becomes μpq =∑ ∑ (x – xbar ) p (y – ybar) q f (x , y) ……………..(3) x y and the normalized central moments, denoted ŋpq ,are defined as: ŋpq = μpq / μ00 ; where ybar = (p + q) / 2 + 1 for p + q = 2 , 3 , . . . …(4) A set of seven invariant moments can be derived from the second and third moments (4), It shows the derivation of expressions from algebraic invariants applied to the moment generating function under a rotation transformation. The moments consist of groups of nonlinear centralized moment expressions. The result is a set of absolute orthogonal moment invariants that can be used for scale, position, and rotation invariant pattern identification, by using the invariant moments which are a set of seven moments can be derived from the second and third moments as below[5]. Ø1 = ŋ20 +ŋ02 Ø2 = (ŋ20 - ŋ02) 2 + 4ŋ211 Ø3 = (ŋ30 - 3ŋ12) 2 + 3(ŋ21 + ŋ03) 2 Ø4 = (ŋ30 + ŋ12) 2 + (ŋ21 + ŋ03)2 Ø5 = (ŋ30-3ŋ12) (ŋ30+ŋ12) [(ŋ30+ŋ12)2-3(ŋ21+ŋ03)2] + (3ŋ21- ŋ03) (ŋ21+ŋ03)[3(ŋ30+ ŋ12 )2 - (ŋ21+ ŋ03 )2 ] Ø6 = (ŋ20-ŋ02) [(ŋ30+ŋ12)2 - (ŋ21+ŋ03) 2] +4ŋ11 (ŋ30+ŋ12)(ŋ21+ŋ03) Ø7 = (3ŋ21-ŋ03)(ŋ30+ŋ12)[(ŋ30+ŋ12) 2 -3(ŋ21+ŋ03) 2 ] +(ŋ30-3ŋ12) (ŋ21+ŋ03) [3(ŋ30 + ŋ12) 2 - (ŋ21+ŋ03)2] Central moments have the advantage of being invariant to translation. It is well known that a small number of moments can characterize an image fairly well; it is equally known that moments can be used to reconstruct the original image (1). In order to achieve invariance to common factors and operations such as scale, rotation and contrast, rather than using the moments themselves algebraic combinations there of known as moment invariants are used that are independent of these transformations. IHJPAS IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.23 (2) 2010 Experimental Results and Discussion The moment invariant descriptors described above were used to index an image database of many images (10 images as a sample). An example of an image of a flower was used to perform image retrieval on the whole dataset. The result of this query is given which shows the descending similarity from other stored images data. Unfortunately, due to the lack of enough samples of images, we are in the processes of collecting a large number of images, This documented dataset will then provide a test for the evaluation of our method proposed in this paper as well as future approaches. As public databases, were established with the aim of providing acquired system by using scanners. Here the proposed algorithm was evaluated on image taken from the database which contains five distinctive databases: DB1, DB2, DB3, DB4 and DB5. Each database consists of many images data in gray scale levels. A series of experiments was conducted to evaluate the performance of the proposed method. Conclusions We have investigated the application of content-based image retrieval to the domain images. Each image is characterized by a set of moment invariants which are independent to translation, scale, rotation and contrast as shown in table (1,2). Retrieval is performed by returning those images whose moments are most similar to the ones of a given query image. A moment based object recognition system is proposed. In a given scene, an object may be occluded due to various reasons and hence recognition of original object becomes necessary for machine vision systems. The invariant moments as well as some of the lower order moments are used to authorize of unknown images owner. In this paper the search for known image is more accurate than the comparison of two colored images as pixel to pixel, because the use of moment and invariant moment is done by comparing little values of moments. References 1- James Ze Wang1, Gio Wiederhold2, Oscar Firschein2, Sha Xin Wei3 Content-based image indexing and searching using Daubechies' wavelets 1 Department of Computer Science and School of Medicine, Stanford University, Stanford, CA 94305, USA 2 Department of Computer Science, Stanford University, Stanford, CA 94305, USA 3 Stanford University Libraries, Stanford University, Stanford, CA 94305, USA International journal on Digital Libraries , Springer-Verleg 1007 .Int J Digit Libr(1997) 1: 311-328 2- Asmara Graps , An Introduction To Wavelets. 3- Shao Ying Zhu and Gerald Schaefer , Thermal medical image retrieval by moment invariants. 1Applied Computing, University of Derby, Derby, U.K., e-mail: S.Y.Zhu@derby.ac.uk 2School of Computing and Informatics, Nottingham Trent University , Nottingham,U.K., e-mail: Gerald.Schaefer@ntu.ac.uk 45- Saibal Dutta and P.K.Nanda , Moment based Object Recognition using Artificial Neural Network .http://dspace.nitrk1.ac.in/dspace 5- Rafael, C. Gonzales & Richard, E. (2004),Woods. digital image processing using MATLAB, ,by Pearson Education . Inc,Pearson Prentice- Hall. IHJPAS IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.23 (2) 2010 Table( 1): Example of calculating the moment of the image Moments Origin first quarter second quarter third quarter fourth quarter μ00 0 0 0 0 0 μ10 3.783863e+007 4.938875e+006 5.871984e+006 3.908114e+006 4.200341e+006 μ01 8.913924e+009 2.514108e+008 2.944227e+008 3.014090e+008 3.480867e+008 μ20 9.738164e+009 2.690497e+008 3.935360e+008 2.041220e+008 2.833067e+008 μ02 2.277567e+012 1.214415e+010 2.021076e+010 1.672020e+010 2.333748e+010 μ11 3.204147e+012 1.214415e+010 2.062193e+010 2.905460e+010 3.337624e+010 μ30 3.475306e+012 2.176426e+010 3.441361e+010 1.629083e+010 2.486389e+010 μ12 1.379838e+015 2.060579e+012 3.370046e+012 1.534540e+012 2.446069e+012 μ21 8.146100e+014 9.409422e+011 1.800647e+012 1.354361e+012 2.033085e+012 μ03 8.214088e+014 8.776290e+011 1.437899e+012 1.662394e+012 2.235337e+012 Table( 2):Example of retrieving the set of seven invariant moments of the image Fig. (1a) illustrates the overview of the system to build the database. PHI Origin first quarter second quarter third quarter fourth quarter Ø1 1.448088e-003 5.644571e-004 4.030901e-004 7.489013e-004 5.829668e-004 Ø2 9.441665e-009 1.652168e-008 4.767174e-009 1.652238e-008 5.077208e-009 Ø3 2.284418e-011 1.643365e-011 4.770410e-013 2.653920e-011 6.309182e-012 Ø4 3.304694e-011 8.909984e-012 1.111096e-012 2.546404e-011 1.096206e-011 Ø5 3.087560e-022 -7.821719e-23 4.962452e-025 -5.997825e-22 8.625016e-023 Ø6 3.191786e-015 -1.032175e-15 -7.380705e-17 -3.010348e-15 -7.610436e-016 Ø7 8.538908e-022 -7.420455e-23 6.388198e-025 2.801038e-022 -2.952706e-023 Read The Image Pre- processing (Convert to Divide the image into four equal divisions Wavelet Transformation On the divisions of image Extract Moment Store the moments of the image in the database IHJPAS IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.23 (2) 2010 Fig. (1b) illustrates the overview of the comparison system of image information with the database . Fig.(2.a) the gray scale of the original image Fig.(2.b) the four equal divisions Read the image Pre- processing (Convert to grayscale + resize) Divide the image into four equal divisions Wavelet transformation On the divisions of image Extract Moment terms Compare the result with database Final result (found or not found) IHJPAS 2010) 2( 32المجلد مجلة ابن الهیثم للعلوم الصرفة والتطبیقیة اللحظات الثابتة الموجي التحویل إستندْت َمع ُیسَتعمُل لَتْقریر عائدیة واصالة الصوِر الرقمیة حسین لفتة حسین جامعة بغداد ،ابن الهیثم -كلیة التربیة ،قسم الحاسبات الخالصة ـِة وبــأدواِت التحویــل المــوجي مــع لغــة مــاتالب تزایــد فــي الوقــت الحاضــر إســتعمال الصــوِر الرقمیـ اِت ُیْمِكــُن َأْن تُشــَتقَّ ِمـــْن وباســتخدام هــذه التقنیــ ة ِمــْن ســبع لحظــ ـِة وهــي مجموعــ اِت الثابتـ ة مســتندة علــى اللحظــ ة الـــى ـا مـــن الصــور الملونــ ـد قــراءة الصـــورة الرقمیــة وتحویلهـ ــابها بعـ اِت الثانیــِة والثالثـــِة ، التــي یمكــن حسـ اللحظــ ة بقیـاس ، الصـور ذي التـدرج الرمــادي وتقســیم هـذه الصــورة ، ) 512 * 512(ثـم تحجــیم الصـورة وجعلهـا ثابتــ 512(التحویل المـوجي للصـورة ثم عمِل ، لكل جزء منها ) 256* 256( على اربعة اجزاء متساویة بقیاس لغـرض ضـغط الصـورة مـع ازالـة ، ) 256* 256( التدرج الرمادي و االجـزاء االربعـة االخـرى يذ) 512* الثالثة وخزن النتیجِة لِبنـاء قاعـدِة البیانـات ) Ø( مشتقتها مع احتساب اللحظات االولى و ، الضوضاء منها .للصوِر األصلیِة لَتْقریر اصالة هذه الصور عند مقارنتها مع صور اخرى حیث تبین ان عملیة المقارنة بین الصور الرقمیة تكون صعبة وتاخذ وقتا كبیرا نتیجة لكمیة البیانات التي تعمل ة تعتمـد علـى قـیم علیها عملیة المقارنة ولكن باسـتخدام هـذه الخوارزمیـة اصـبحت العملیـة اسـرع وادق الن المقارنـ ة وكمـا مبـین فــي اللحظـات بعـد ضـغط الصـورة باسـتخدام مربـع معـدل الخطـأ لتحد یـد اقـل نسـبة االخطـاء المقبولـ ) .2و 1(الجدولین IHJPAS