0

I have a project which is to read character in a captured image but I'm stuck at the button which is to scan image. I ended up tesseract dll in c#, but I don't know how can I code it. I'm a newbie to this programming.

 private void Browse_Click(object sender, EventArgs e)
    {
        //FileInfo fi = new FileInfo(string.Format(@"C:\Documents and Settings\JOrce0201610\My Documents\Visual Studio 2005\Projects\OCR Reader\{0}", imageName));
        OpenFileDialog fi = new OpenFileDialog();
        fi.InitialDirectory = @"C:\\Documents and Settings\JOrce0201610\My Documents\Visual Studio 2005\Projects\OCR Reader\Card";
        fi.Filter = "BMP Image|*.bmp";
        fi.FilterIndex = 2;
        fi.RestoreDirectory = true;
        if (fi.ShowDialog() == DialogResult.OK)
        {
            //image file path
            textBox1.Text = fi.FileName;
            //display image in picture box
            pictureBox1.Image = new Bitmap(fi.FileName);
        }
    }
    private void Scan_Click(object sender, EventArgs e)
    {
        Bitmap temp = source.Clone() as Bitmap; //Clone image to keep original image

        FiltersSequence seq = new FiltersSequence();
        seq.Add(Grayscale.CommonAlgorithms.BT709);  //First add  GrayScaling filter
        seq.Add(new OtsuThreshold()); //Then add binarization(thresholding) filter
        temp = seq.Apply(source); // Apply filters on source image

winform

hcham1
  • 1,799
  • 2
  • 16
  • 27
  • 2
    And so what is your question? – Roy Dictus Sep 20 '13 at 07:50
  • 2
    Maybe OCR isn't the best place for a *newbie* to start? – Liam Sep 20 '13 at 07:50
  • 1
    There's no question here, but I assume you're not getting the results you're expecting. I recommend reading the documentation of the implementation of OCR you're using. In addition, usually there are tutorials available which show you how to do it. – Stefan Sep 20 '13 at 07:53
  • 2
    You should start by creating a calculator application or a game of yathzee, when being a newbie, not reading characters from an image. – Max Sep 20 '13 at 07:53

1 Answers1

3

If you are a 'newbie' to programming, OCR is not the best place to start. The best I can suggest is that you use a webservice or existing library that can do this for you.

Microsoft has project Hawaii, Hawaii has an OCR service which is quite easy to use.

SynerCoder
  • 12,493
  • 4
  • 47
  • 78