Wednesday, August 27, 2008

Multilingual Compressed Database

Multilingual compressed database is a one of the most striking feature for multilingual web page or software developers. I have worked on multilingual compressed database.

Compressed database means the maximum effort to reduce data redundancy. For example if I consider a student database then I must have to ensure that in the whole database each word only exist for onetime.

We will use the index of word in the database table. Using the index we can find out the word in the data dictionary. Data Dictionary contain several word category. Data dictionary is maintained to handle the word used on other table. Almost in every database contain Noun type data or numerical or alphanumerical data. So if we map the Noun type data based on category and put them only one time in a database i.e. we want to use the word id instead of name such as Md Nazmul kibria. If we place in the name column of a table the id 012 of Md Nazmul Kibria we can save storage. Another thin is that in a database there may same name or same name segment for several user. For example in a student database contain 1000 data; in this thousand data the name Islam repeats in 50 data. So if I insert Islam in 50 different row of a table it is reduntant approach. Instead saving 50 data if I use the index id of Islam (015) it is more space saving approach. If I have 3 or 4 different languages used to represent this student database in 3 or 4 different languages; in this case data dictionary and using word index is much efficient approach in saving time and space in the database.

I will post later on this topic in detail with some examples.



Tuesday, August 19, 2008

Skin color segmentation process

Detection of skin color in color images is a very popular and useful technique for face detection. Many techniques exists have reported for locating skin color regions in the input image. While the input color image is typically in the RGB format, these techniques usually use color components in the color space, such as the HSV or YIQ formats. That is because RGB components are subject to the lighting conditions thus the face detection may fail if the lighting condition changes. Among many color spaces, this project used YCbCr components since it is one of existing Matlab functions thus would save the computation time. In the YCbCr color space, the luminance information is contained in Y component; and, the chrominance information is in Cb and Cr. Therefore, the luminance information can be easily de-embedded. The RGB components were converted to the YCbCr components using the following formula given by



Threshold value is chosen by the following equation given by






Our proposed skin color segmentation is described below:
Two rules to segment skin color pixels from inputted RGB image:

R1: R>G>B
R2: R-G>=45


If both R1 and R2 are true then the pixel is considered as skin color pixel. We put a black pixel for the skin color pixels and put white pixel for non-skin color pixels.

Comparison with two system:




Algorithms of our proposed Edge detection

Algorithm 1:


For i=1 to (Width-1)
For j=1 to (Height -1)
Set(i,j)th pixel as White Color;


For i=1 to (Width-1)
For j=1 to (Height -1)
{
diff:=Abs( Difference between Red component of (i, j)th and (i+1, j+1)th pixel )
+ Abs( Difference between Green component of (i, j)th and (i+1, j+1)th pixel)
+ Abs( Difference between Blue component of (i, j)th and (i+1, j+1)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF


diff:=Abs( Difference between Red component of (i, j)th and (i+1, j-1)th pixel)
+ Abs( Difference between Green component of (i, j)th and (i+1, j-1)th pixel)
+ Abs( Difference between Blue component of (i, j)th and (i+1, j-1)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF

diff:=Abs( Difference between Red component of (i, j)th and (i-1, j-1)th pixel )
+ Abs( Difference between Green component of (i, j)th and (i-1, j-1)th pixel)
+ Abs( Difference between Blue component of (i, j)th and (i-1, j-1)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF

diff:=Abs( Difference between Red component of (i, j)th and (i-1, j+1)th pixel )
+ Abs( Difference between Green component of (i, j)th and (i-1, j+1)th pixel)
+ Abs( Difference between Blue component of (i, j)th and (i-1, j+1)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF




diff:=Abs( Difference between Red component of (i, j)th and (i+1, j)th pixel)
+ Abs( Difference between Green component of (i, j)th and (i+1, j)th pixel)
+ Abs( Difference between Blue component of (i, j)th and (i+1, j)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF


diff:=Abs( Difference between Red component of (i, j)th and (i, j-1)th pixel)
+ Abs( Difference between Green component of (i, j)th and (i, j-1)th pixel)
+ Abs( Difference between Blue component of (i, j)th and (i, j-1)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF

diff:=Abs( Difference between Red component of (i, j)th and (i-1, j)th pixel )
+ Abs( Difference between Green component of (i, j)th and (i-1, j)th pixel)
+ Abs( Difference between Blue component of (i, j)th and (i-1, j)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF

diff:=Abs( Difference between Red component of (i, j)th and (i, j+1)th pixel )
+ Abs( Difference between Green component of (i, j)th and (i, j+1)th pixel)
+ Abs( Difference between Blue component of (i, j)th and (i, j+1)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF



}


Algorithm 2:



For i=1 to (Width-1)
For j=1 to (Height -1)
Set(i,j)th pixel as White Color;


For i=1 to (Width-1)
For j=1 to (Height -1)
{
diff:=Abs( Difference between Red component of (i, j)th and (i+1, j+1)th pixel )
+ Abs( Difference between Blue component of (i, j)th and (i+1, j+1)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF

diff:=Abs( Difference between Red component of (i, j)th and (i-1, j+1)th pixel )
+ Abs( Difference between Blue component of (i, j)th and (i-1, j+1)th pixel);

IF diff > threshold
Set (i,j)th pixel as Black Color;
Continue;
End IF

}

Monday, August 18, 2008

New approache to detect edge.......


This is an experimental approach to detect edge......we are very happy to get good edges from our derived formula....

This edge detectin is one the approaches of our contribution to image processing...hopefully I am going to organise all my works and making available in internet.....

C# sample code for edge detection function....

Bitmap b;
b = (Bitmap)pictureBox1.Image;
int n, m;
n = b.Height;
m = b.Width;
int cc = 0, total = 0;
Bitmap B1 = new Bitmap(m, n);
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
{
B1.SetPixel(i, j, Color.White);
}




for (int i = 1; i < m - 1; i++)
for (int j = 1; j < n - 1; j++)
{
total = Math.Abs(b.GetPixel(i + 1, j + 1).B - b.GetPixel(i, j).B) + Math.Abs(b.GetPixel(i + 1, j + 1).R - b.GetPixel(i, j).R);
if (total > val)
{ B1.SetPixel(i, j, Color.Black); continue; }


total = Math.Abs(b.GetPixel(i - 1, j + 1).B - b.GetPixel(i, j).B) + Math.Abs(b.GetPixel(i - 1, j + 1).R - b.GetPixel(i, j).R);
if (total > val)
{ B1.SetPixel(i, j, Color.Black); continue; }


}

pictureBox4.Image = new Bitmap(B1);

Sunday, August 17, 2008

Face extraction from an image



Automatically face extraction from an image is essential for many advance application developers or intelligent robot developers. I have worked on face extraction. Think some important tips to be write on blogg. Three basic steps required:

1. Skin Color Segmentation
2. Extract Connected components
3. Extract faces



1. Skin color segmentation
Two vital rules for skin color segmentation:

R1: R>G>B
R2: R-G>=45

When Both R1 and R2 are true, the pixel is considered as skin color pixel. Where R, G, B are red, green and blue components of a pixel.

2. Extract Connected components
We put skin color pixel as black and non skin color pixel as white color. Then after skin color segmentatin operatoin we will find out an image of black and white color. Now will find out the black connected components. Because through this method we can extract multiple faces from an group photo. Each large components are probable face area.

3. Extract faces
Now cut faces from original image using each connected component.

PC Magazine Tips and Solutions

PC World: Latest Technology News

PCWorld.com - Most Popular Downloads of the Week