I have 1000 Image of book page, Its text is dimmed as this piece
Now I tried to repair it to be more clearly to read, I use this code
private Bitmap repairImage(Bitmap bmp)
{
Color cc=Color.FromArgb(255, 251, 251, 251);
for (int x = 0; x < bmp.Width; x++)
{
for (int y = 0; y < bmp.Height; y++)
{
if (bmp.GetPixel(x, y).R>238)
{
bmp.SetPixel(x, y, Color.White);
}
else
{
bmp.SetPixel(x, y, Color.Black);
}
}
}
return bmp;
}
Due to the image dimensions is 1168 x 1807 it took a lot of time to finish repair, it exactly loops 2110576 cycles.
Is there any another way to solve this problem? Thanks.