I am trying to convert image to text using emguCV but it is showing me error tess.reconize instance not set for reference. My code is
using Emgu.CV;
using Emgu.Util;
using Emgu.CV.CvEnum;
using Emgu.CV.OCR;
using Emgu.CV.Structure;
using Emgu.CV.UI;
using Emgu.CV.Util;
namespace jo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Tesseract tess;
Image img;
private void button1_Click(object sender, EventArgs e)
{
DialogResult dr = openFileDialog1.ShowDialog();
if (dr == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
}
img = Image.FromFile(openFileDialog1.FileName);
pictureBox1.Image = img; pro(); textBox2.Text = tess.GetText();
}
public void load()
{
try
{
tess = new Tesseract("tessdata", "eng", Tesseract.OcrEngineMode.OEM_DEFAULT);
}
catch (Exception ex)
{
MessageBox.Show(ex.GetBaseException().ToString());
} }
private void Form1_Load(object sender, EventArgs e)
{ load(); }
public void pro() { tess.Recognize(new Image(textBox1.Text)); } } }?
Clara AshfordPosted Jan 29, 2025, 6:16 PM
If you're looking for a reliable image to text conversion tool, I highly recommend ImgOCR.com. It’s an AI powered platform that provides fast and accurate text extraction from images and documents.
With ImgOCR, you can:
? Convert images to text effortlessly
? Use an AI image translator for multilingual support
? Convert PDF to Word with AI precision
? Extract text from PNG to Word or JPG to Word in seconds
Whether you need to digitize documents or extract text from scanned images, ImgOCR.com is the perfect tool to simplify your workflow. Try it today.
Maen BadwanPosted Feb 9, 2017, 12:22 PM
http://www.emgu.com/wiki/files/2.4.0/document/html/d30f9aa6-5f5a-37b1-140e-f940c5271ee4.htm
http://www.emgu.com/wiki/files/2.4.0/document/html/279f760a-fc66-902d-e291-2ee897610e77.htm
Note that you can still try using a different programming toolkit that supports OCR (optical character recognition) and image loading features such as LEADTOOLS SDK. You can find useful ready sample projects here:
https://www.leadtools.com/support/forum/posts/m40423-HOWTO--Minimum-Arabic-OCR-C--Console-Application#post40423
Disclaimer: I am an employee of this library.