I am using OCR method to read the image, the challenge is i want to read the text(For Ex: From a Passport or some other document which has the background image in it plus the quality of the image is also not good),so can you suggest any of the ideas to execute so that it reads each of the text clearly,any suggestions are welcomed for example increasing the brightness or any such ideas. Kindly don't mark it as a copy because my question is a copy but the challenge is different. Below is the code which I got through stack overflow itself.
protected void Button1_Click(object sender, EventArgs e)
{
string filePath = Server.MapPath("~/Uploads/"
+ Path.GetFileName(FileUpload1.PostedFile.FileName));
FileUpload1.SaveAs(filePath);
string extractText = this.ExtractTextFromImage(filePath);
lblText.Text = extractText.Replace(Environment.NewLine, "<br />");
}
private string ExtractTextFromImage(string filePath)
{
Document modiDocument = new Document();
modiDocument.Create(filePath);
modiDocument.OCR(MiLANGUAGES.miLANG_ENGLISH);
MODI.Image modiImage = (modiDocument.Images[0] as MODI.Image);
string extractedText = modiImage.Layout.Text;
modiDocument.Close();
return extractedText;
}