Saturday, September 16, 2006

Facial Recognition Using Eigan Face

Face is an important biometric feature for personal identification. This paper describes a brief idea about face verification method based on principal component analysis, eigenface technology because it is widely implemented and well known for its simplicity and computational efficiency.

How it works?

The task of facial recognition is discriminating input image data into several classes (persons). The input images are highly noisy (e.g. the noise is caused by differing lighting conditions, pose etc.), yet the input images are not completely random and in spite of their differences there are patterns which occur in any input image. Such patterns, which can be observed in all images, could be in the domain of facial recognition the presence of some objects (eyes, nose, and mouth) in any face as well as relative distances between these objects. These characteristic features are called eigenface in the facial recognition domain (or principal components generally). They can be extracted out of original image data by means of a mathematical tool called Principal Component Analysis (PCA).

We can represent a training image as a two dimensional image having MxN dimensions. We can represent the same image as a vector having MN coordinates. A vector having MN coordinates can be thought as a point in a MN dimensional space. Now if we find the distance between two points in MN dimensional space, which is the representation of the image then we will find that the similar images are placed in the nearer location in that space. The problem with this technique is that the input images are very noisy. So, there is a chance that a different image is placed in the closer location. Principal component analysis solves this problem.

An eigenvector of a matrix is a vector such that, if multiplied with the matrix, the result is always an integer multiple of that vector. This integer value is the corresponding eigen value of the eigenvector. This relationship can be described by the equation M u = ? u, where u is an eigenvector of the matrix M and ? is the corresponding eigen value. Eigen values are the characteristic features of a matrix, we can reconstruct the original matrix from its eigen value and eigen vectors. The eigen vector having maximum eigen value represents the maximum characteristic features of the matrix. So, if we take the eigen vectors having larger eigen values and reject the eigen vectors having lower eigen values we construct an approximation of the original matrix having maximum characteristic features. In principal component analysis the eigen vectors are called as eigenface. By selecting the eigenface having larger eigen values we can construct a space having lower dimension from the higher dimensional training set where the maximum characteristics feature is present. Thus we can eliminate the unwanted features, which are not the part of the object. For example we can calculate MN eigenface from a MN dimensional space. If we take first T eigenface having larger eigen values, where MN>>T, then we can construct a space having T dimensions. This space is called as eigen space. So, the eigen space is constructed from the maximum characteristic features of the training image set.

As the images are represented as a point in a MN dimensional space, we can find the co-ordinates of a test image into the eigen space by projecting the image into the eigen space. Then we can find the distance between the two projected points on the eigen space projected from two different image by Euclidean distance.

We can set a threshold value theta, which will decide the classification of the test image.

Flowchart of face recognition is as follows..

Eigenface

Wednesday, September 13, 2006

How RSA Algorithm Works

The RSA algorithm is used for public key encryption and digital signature. In this algorithm data (input) is encrypted using a public key and decrypted using private key. The public key is exposed to the sender and the receiver will keep the private key. Most people knows this ability of RSA algorithm. But they don’t know how it is possible.

Here is the mathematical explanation of RSA algorithm

  1. Let’s assume that p and q are two large prime numbers.
  2. Now calculate n = p*q and (φ) phi = (p-1)(q-1).
  3. Choose an integer e, 1 < e < phi, such that gcd(e, phi) = 1
  4. Find the secret exponent d, 1 < d < phi, such that
    (e*d) % phi = 1
  5. The public key is (n, e) and the private key is (n, d).
  6. The values of p, q, and phi should also be kept secret.
  7. Encryption : C=(I^e)%n
  8. Decryption: I=(C^d)%n
  • n is known as the modulus.
  • e is known as the public exponent or encryption exponent.
  • d is known as the secret exponent or decryption exponent.

Let us examine the algorithm step by step

  1. Let p=7 and q=17
  2. n=pq=7*17=119
  3. phi=(p-1)*(q-1)=(7–1)*(17–1)*17=96
  4. Let e=5. So, gcd(5,96)=1
  5. Calculated d=77 as (5*77)%96=1
  6. So our private key is (119,77) and the public key is (119,5)

Now we can examine encrypt and decrypt method.
Let our input I is 7. So, C=(7^5)%119=16807%119=28
So, 28 is the encrypted number. We cannot find 7 from the encrypted number 28 and public key (119,5).

Let us use our private key (119,77) to decrypt 28.
I=(28^77)%119=2.6987857810871449487269638198368e+111%119=7. So, 7 is the decrypted number.

Tuesday, September 12, 2006

My articles in CodeProject

Average article rating: 3.6

C# Controls

Dialogs and Windows

A Floating Popup Control
Last Updated: 4 May 2006 Page views: 8,901 Rating: 3.9/5 Votes: 4 Popularity: 2.4
A floating popup control which can display any form.

Edit Controls

A Calculator Control Box
Last Updated: 25 Nov 2005 Page views: 10,238 Rating: 4.0/5 Votes: 15 Popularity: 4.7
A Calculator Control Box which can be used instead of a text box for numeric input.

Unedited Reader Contributions

A Control List View
Last Updated: 1 Dec 2005 Page views: 6,769 Rating: 3.9/5 Votes: 8 Popularity: 3.6
A Control List View which can display Like Tile View

C# Programming

Unedited Reader Contributions

A Command Line Calculator
Last Updated: 24 Nov 2005 Page views: 6,488 Rating: 4.0/5 Votes: 5 Popularity: 2.8
A Command Line Calculator using CodeDom

A richtext note application which is automatically managed
Last Updated: 4 Feb 2006 Page views: 12,204 Rating: 2.5/5 Votes: 11 Popularity: 2.6
A richtext note application which is automatically managed. It has many features which is very important to use.

Light Note 2.1
Last Updated: 11 Feb 2006 Page views: 10,446 Rating: 2.5/5 Votes: 24 Popularity: 3.5
A smart note application

Utilities

Microsoft Visual Source Safe Client
Last Updated: 20 Sep 2006 Page views: 1,795 Rating: 4.7/5 Votes: 12 Popularity: 5.1
Microsoft Visual Source Safe client which can notify of check-ins.

Internet / Network

Network

A collection class for listing all the computers and servers in your network, with category information
Last Updated: 21 Sep 2006 Page views: 7,260 Rating: 4.5/5 Votes: 15 Popularity: 5.3
A collection class for listing all the computers and servers in your network, with category information.

VB / VBScript

Unedited Reader Contributions

A Formated Text Box
Last Updated: 23 Nov 2005 Page views: 5,992 Rating: 0.0/5 Votes: 0 Popularity: 0.0
A Formated Text Box for VB