dlareklami / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

tesseract 3.01 actual_tessdata_num_entries_ <= TESSDATA_NUM_ENTRIES #1096

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm building tesseract 3.01 and magick++ into a program because the command 
line versions were too slow. getting everything compiled correctly took forever 
but finally I get no errors in my compiler, but as soon as I go to run my 
console app I get (skip down to my int main to read the cout statements that 
I'm just using for debug)

PS C:\Users\sirus\Documents\Visual Studio 
2013\Projects\ConsoleApplication4\Release> .\ConsoleApplication4.exe
first command
actual_tessdata_num_entries_ <= TESSDATA_NUM_ENTRIES:Error:Assert failed:in 
file ..\ccutil\tessdatamanager.cpp, line 48
PS C:\Users\sirus\Documents\Visual Studio 
2013\Projects\ConsoleApplication4\Release> l
searching for this online shows that this is what happens when you have to 
incorrect language data, but I have tesseract 3.01 and the tesseract 3.01 
language data downloaded directly from their google code site.

I'm using visual studio 2013 on windows 8.1 building 32 bit /MD

here is a sample of my source

#include <stdio.h>
#include <string>
#include <iostream>               
#include <iomanip>
#include <locale>
#include <sstream>
#include <string> 
#include <Magick++.h>
#include "baseapi.h"
#include "allheaders.h"
using namespace Magick;
using namespace std;
using namespace tesseract;
#define MaxRGB ((Magick::Quantum)65545)
tesseract::TessBaseAPI tess;

string cmd = "";
string cmd2 = "";

void img_split(){
    string tesseract = "\"C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe\" text/";
    int rect_y = 141;
    string del = "del /s /q text\\*";
    system(del.c_str());
    for (int x = 1; x < 40; x++){
        rect_y += 19;
        Image image;
        image.read("source.jpg");
        Magick::Image* mImage;
        Image sub_image(image);
        mImage = &sub_image;
        //mImage->write("test.jpg");

        sub_image.chop(Geometry(1481, rect_y));
        sub_image.crop(Geometry(220, 17));

        sub_image.quantizeColorSpace(GRAYColorspace);
        sub_image.quantizeColors(2);
        sub_image.quantizeDither(false);
        sub_image.quantize();
        sub_image.scale(Geometry(2200,170));
        sub_image.antiAlias();
        sub_image.compressType(Magick::NoCompression);

        //const unsigned char* imagedata = (unsigned char*)mImage;
        //tess.SetImage(imagedata, 2200, 170, 1, 17300);
        //tess.Recognize(0);
        //const char* out = tess.GetUTF8Text();
        //cout << "\n\nno idea if this will work: " << out << endl;

        sub_image.write("text/" + static_cast<ostringstream*>(&(ostringstream() << x))->str() + ".gif");
        //cmd2 = tesseract + static_cast<ostringstream*>(&(ostringstream() << x))->str() + ".png text/" + static_cast<ostringstream*>(&(ostringstream() << x))->str();
        //tesseract_ocr(x);
    }

}

int main(int argc, char **argv)
{
    cout << "first command\n";
    //tess.Init(argv[0], "eng", tesseract::OEM_DEFAULT);
    tess.Init(*argv, "eng");
    tess.SetPageSegMode(tesseract::PSM_AUTO);
    cout << "\ntest" << endl;
    InitializeMagick(*argv);
    //img_split();

    return 0;
}

Original issue reported on code.google.com by sirus2...@gmail.com on 4 Feb 2014 at 3:48

GoogleCodeExporter commented 9 years ago
3.01 is too old. Please use resent (svn) code. Nobody is going to fix (and 
release) old code.

Original comment by zde...@gmail.com on 4 Feb 2014 at 5:36

GoogleCodeExporter commented 9 years ago
svn doesnt build on visual studio 2013

Original comment by sirus2...@gmail.com on 4 Feb 2014 at 5:37

GoogleCodeExporter commented 9 years ago
i should add that's because 3.03 requires leptonica 1.7 but leptonica doesnt 
build on windows after 1.68

Original comment by sirus2...@gmail.com on 4 Feb 2014 at 5:55

GoogleCodeExporter commented 9 years ago
Leptonica and tesseract build on linux without any problem.
If you choose to use windows it is your choice and you need to wait until 
somebody will release leptonica 1.70 for windows (if you are not able to build 
it by yourself).

Original comment by zde...@gmail.com on 6 Feb 2014 at 8:40