簡體   English   中英

Tesseract“估計分辨率為304”行逐字打印+需要> 1秒才能打印。 為什么以及如何抑制?

[英]Tesseract "estimating resolution as 304" line prints word by word + takes >1 second to print. Why and how to supress?

    tesseract::TessBaseAPI tess;
    if (tess.Init("./languages/fast/", "eng"))
    {
        std::cout << "OCRTesseract: Could not initialize tesseract." << std::endl;
        std::exit(1);
    }
    tess.SetPageSegMode(tesseract::PageSegMode::PSM_AUTO);
    tess.SetVariable("save_best_choices", "T");
    tess.SetVariable("user_defined_dpi", "70");
    auto buffer = ocrQueue.getBuffer();

    tess.SetImage((const unsigned char*)buffer->data(), buffer->getWidth(), buffer->getHeight(), 3, buffer->getWidth()*3);
    tess.Recognize(0);

    std::cout << tess.GetUTF8Text() << std::endl;

每次運行此代碼時,我都會得到

Estimating resolution as 304

打印需要>1 秒,並且逐字打印,這很煩人。

如何抑制這種情況?

tess.SetVariable("user_defined_dpi", "71");

或者

tess.SetVariable("debug_file", "/dev/null");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM