1. 25 7月, 2017 1 次提交
  2. 15 7月, 2017 7 次提交
  3. 03 7月, 2017 1 次提交
  4. 06 6月, 2017 1 次提交
  5. 20 5月, 2017 1 次提交
    • S
      UNICHARSET: Add missing initialization · fb863c97
      Stefan Weil 提交于
      The member variable default_sid_ was used without being initialized.
      
      Valgrind report for `tesseract --oem 1 hello.png hello`:
      
          Conditional jump or move depends on uninitialised value(s)
             at 0x14352E: BITS16::set_bit(unsigned char, unsigned char) (bits16.h:50)
             by 0x143E27: WERD::set_flag(WERD_FLAGS, unsigned char) (werd.h:129)
             by 0x27D053: WERD_RES::SetupWordScript(UNICHARSET const&) (pageres.cpp:381)
             by 0x27CAFD: WERD_RES::SetupForRecognition(UNICHARSET const&, tesseract::Tesseract*, Pix*, int, TBOX const*, bool, bool, bool, ROW*, BLOCK const*) (pageres.cpp:316)
             by 0x145903: tesseract::Tesseract::SetupWordPassN(int, tesseract::WordData*) (control.cpp:182)
             by 0x145780: tesseract::Tesseract::SetupAllWordsPassN(int, TBOX const*, char const*, PAGE_RES*, GenericVector<tesseract::WordData>*) (control.cpp:168)
             by 0x146293: tesseract::Tesseract::recog_all_words(PAGE_RES*, ETEXT_DESC*, TBOX const*, char const*, int) (control.cpp:336)
             by 0x12F356: tesseract::TessBaseAPI::Recognize(ETEXT_DESC*) (baseapi.cpp:878)
             by 0x13036D: tesseract::TessBaseAPI::ProcessPage(Pix*, int, char const*, char const*, int, tesseract::TessResultRenderer*) (baseapi.cpp:1184)
             by 0x13014A: tesseract::TessBaseAPI::ProcessPagesInternal(char const*, char const*, int, tesseract::TessResultRenderer*) (baseapi.cpp:1140)
             by 0x12FBCE: tesseract::TessBaseAPI::ProcessPages(char const*, char const*, int, tesseract::TessResultRenderer*) (baseapi.cpp:1040)
             by 0x12C3DF: main (tesseractmain.cpp:515)
           Uninitialised value was created by a heap allocation
             at 0x4C2C21F: operator new(unsigned long) (vg_replace_malloc.c:334)
             by 0x12D88B: tesseract::TessBaseAPI::Init(char const*, int, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool, bool (*)(STRING const&, GenericVector<char>*)) (baseapi.cpp:320)
             by 0x12D6DA: tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool) (baseapi.cpp:284)
             by 0x12C088: main (tesseractmain.cpp:440)
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      fb863c97
  6. 17 5月, 2017 4 次提交
  7. 15 5月, 2017 1 次提交
  8. 13 5月, 2017 3 次提交
  9. 12 5月, 2017 7 次提交
  10. 11 5月, 2017 2 次提交
  11. 04 5月, 2017 1 次提交
  12. 03 5月, 2017 1 次提交
    • S
      genericvector: Fix minimum size · 46c887b7
      Stefan Weil 提交于
      Commit 907de599 tried to improve
      GenericVector, but missed a case where vectors with less than
      kDefaultVectorSize were allocated. This resulted in additional
      alloc / free operations.
      
      Commit a28b2a03 (before memory optimization)
      oem 0: total heap usage: 739,238 allocs, 739,237 frees, 161,699,214 bytes allocated
      oem 1: total heap usage: 690,182 allocs, 690,175 frees, 144,470,400 bytes allocated
      oem 2: total heap usage: 728,213 allocs, 728,206 frees, 182,885,824 bytes allocated
      
      Commit fd3f8f9b without genericvector change
      oem 0: total heap usage: 738,980 allocs, 738,979 frees, 161,697,150 bytes allocated
      oem 1: total heap usage: 690,182 allocs, 690,175 frees, 144,470,400 bytes allocated
      oem 2: total heap usage: 728,213 allocs, 728,206 frees, 182,885,824 bytes allocated
      => Improvements for oem 0, no change for oem 1 and oem 2.
      
      Commit fd3f8f9b
      oem 0: total heap usage: 772,648 allocs, 772,647 frees, 160,083,901 bytes allocated
      oem 1: total heap usage: 748,591 allocs, 748,584 frees, 143,581,672 bytes allocated
      oem 2: total heap usage: 764,796 allocs, 764,789 frees, 181,212,197 bytes allocated
      => Less bytes allocated, but more allocs / frees = bad for performance.
      
      Commit fd3f8f9b with this patch
      oem 0: total heap usage: 677,537 allocs, 677,536 frees, 160,444,634 bytes allocated
      oem 1: total heap usage: 653,812 allocs, 653,805 frees, 143,423,008 bytes allocated
      oem 2: total heap usage: 670,029 allocs, 670,022 frees, 181,517,760 bytes allocated
      => Improvements for all three cases.
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      46c887b7
  13. 02 5月, 2017 1 次提交
  14. 30 4月, 2017 1 次提交
  15. 29 4月, 2017 1 次提交
  16. 28 4月, 2017 1 次提交
  17. 15 4月, 2017 1 次提交
  18. 08 3月, 2017 1 次提交
  19. 01 3月, 2017 1 次提交
  20. 26 1月, 2017 1 次提交
  21. 24 1月, 2017 1 次提交
  22. 16 1月, 2017 1 次提交
    • A
      Remove code that is no longer needed · 5d627aac
      amitdo 提交于
      The code in ccutil/hashfn.h was needed for some old compilers. Now that we support MSVC >= 2010 and compilers that has good support for C++11, we can drop this code.
      
      As a result of this file removal, we now use:
        std::unordered_map
        std::unordered_set
        std::unique_ptr
      directly in the codebase with '#include' for the needed headers.
      5d627aac