We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Out Of memory Exception using OCR .NET

Hi. I am getting an Out Of Memory Exception. I have downloaded the latest version ocr .net.

How do I solve this exception? Thank you!

Image 2.jpg (703.6 KB)

My Code:


using Aspose.OCR;
using Aspose.OCR.Filters;
using System;
using System.Collections.Generic;
using System.ComponentModel;

using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

public partial class Form1 : Form
Aspose.OCR.OcrEngine ocrEngine = new Aspose.OCR.OcrEngine();

    public Form1()
        CorrectionFilters filters = new CorrectionFilters();
        Filter filter = null;
        // Initialize Median filter
        filter = new MedianFilter(5);

        // Create Gaussian Blur filter
        filter = new GaussBlurFilter();

        ocrEngine.Config.ProcessColoredBackground = false;
        ocrEngine.Config.DoSpellingCorrection = false;
        ocrEngine.Config.DetectTextRegions = false;
        ocrEngine.Config.CorrectionFilters = filters;
    private void button1_Click(object sender, EventArgs e)
        timer1.Enabled = !timer1.Enabled;
        if (timer1.Enabled)
            button1.Text = "Stop";
            button1.Text = "Start";

    private void ocr()
        ocrEngine.Image = ImageStream.FromFile("Code.bmp");
        if (ocrEngine.Process())
            label1.Text = DateTime.Now.ToString("HH:mm:ss") + "-" +  ocrEngine.Text.ToString();

    private void timer1_Tick(object sender, EventArgs e)



We have investigated the issue at our end. We are unable to observe the said issue. The OCR process executed the fine. We have used the latest version i.e. Aspose.OCR for .NET 17.6. Please provide more details about the issue.