tesseract-ocr / tesseract

Tesseract Open Source OCR Engine (main repository)
https://tesseract-ocr.github.io/
Apache License 2.0
61.92k stars 9.48k forks source link

RAII, smart pointers etc. #3328

Open egorpugin opened 3 years ago

egorpugin commented 3 years ago

After we upgraded to C++17, did cleanups on STRINGs and GenericVectors, it's time to use more RAII, more smart pointers.

Modernization must be started from unit tests and training tools. Because if we change something in core library (from the bottom), we must clean all the mess above (tess.exe, tr.tools and tests). Starting from the top is much easier.

Note that this affects only internals. We do not touch public APIs.

cc: @stweil


Upgrade tips:


Some new places: unittests: https://pastebin.com/ki8Fpt3C (partially fixed) training tools: https://pastebin.com/puKvFT7M (partially fixed)

amitdo commented 3 years ago

@egorpugin added the tess6.0 label

Egor, maybe you want to use a milestone instead of a label?

egorpugin commented 3 years ago

ok, ty :)

egorpugin commented 3 years ago

For the info: this ticket is blocked by api changes. See https://github.com/tesseract-ocr/tesseract/commit/7d17b72ba5d10bbd0c65a1992ddba8ec6ac1dcd0#r48512779

egorpugin commented 3 years ago

For leptonica raii see https://github.com/tesseract-ocr/tesseract/pull/921