Here is a code in the article: Unicode Optical Character Recognition
Unicode Optical Character Recognition[^][
^]
According author, I have done and detected the top and bottom
1. Image line Identification
public void identify_lines()
{
int y=image_start_pixel_y;
int x=image_start_pixel_x;
bool no_black_pixel;
int line_number=0;
line_present=true;
while(line_present)
{
x=image_start_pixel_x;
while(Convert.ToString (input_image.GetPixel (x,y))==
"Color [A=255, R=255, G=255, B=255]")
{
x++;
if(x==input_image_width)
{
x=image_start_pixel_x;
y++;
}
if(y>=input_image_height)
{
line_present=false;
break;
}
}
if(line_present)
{
line_top[line_number]=y;
no_black_pixel=false;
while(no_black_pixel==false)
{
y++;
no_black_pixel=true;
for(x=image_start_pixel_x;x<input_image_width;x++)
if((Convert.ToString (input_image.GetPixel (x,y))==
"Color [A=255, R=0, G=0, B=0]"))
no_black_pixel=false;
}
line_bottom[line_number]=y-1;
line_number++;
}
}
number_of_lines=line_number;
}
But now,I want to change this code get-set to lockbit because I think it will be it will be faster. If anyone has any better solutions, please tell me.