{"id":223743,"date":"2014-05-22T12:23:02","date_gmt":"2014-05-22T08:23:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=223743"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=223743","title":{"rendered":"<span class=\"post_title\">Tesseract. \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/447\/6e0\/a58\/4476e0a58c450b49ebb49ba72d22bb81.png\" alt=\"Tesseract and CppCat\" align=\"left\"\/><br \/>  Tesseract \u2014 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 Google. \u0412 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f: \u00abTesseract is probably the most accurate open source OCR engine available\u00bb. \u0410 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c, \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 CppCat \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<br \/>  <a name=\"habracut\"><\/a>   <\/p>\n<h2>Tesseract<\/h2>\n<p>  Tesseract \u2014 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0432\u0448\u0430\u044f\u0441\u044f Hewlett-Packard \u0441 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u044b 1980-\u0445 \u043f\u043e \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443 1990-\u0445, \u0430 \u0437\u0430\u0442\u0435\u043c 10 \u043b\u0435\u0442 \u00ab\u043f\u0440\u043e\u043b\u0435\u0436\u0430\u0432\u0448\u0430\u044f \u043d\u0430 \u043f\u043e\u043b\u043a\u0435\u00bb. \u0412 \u0430\u0432\u0433\u0443\u0441\u0442\u0435 2006 \u0433. Google \u043a\u0443\u043f\u0438\u043b \u0435\u0451 \u0438 \u043e\u0442\u043a\u0440\u044b\u043b \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u044b \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 Apache 2.0 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 UTF-8, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u044f\u0437\u044b\u043a\u043e\u0432 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0440\u0443\u0441\u0441\u043a\u0438\u0439) \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. [<a href=\"http:\/\/www.viva64.com\/go.php?url=1404\">\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a> \u0432\u0437\u044f\u0442\u043e \u0438\u0437 Wikipedia]<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 Google Code: <a href=\"https:\/\/code.google.com\/p\/tesseract-ocr\/\">https:\/\/code.google.com\/p\/tesseract-ocr\/<\/a><\/p>\n<p>  \u041e\u0431\u044a\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u043a\u043e\u043b\u043e 16 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442.<\/p>\n<h2>CppCat<\/h2>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 <a href=\"http:\/\/www.cppcat.com\">CppCat<\/a>. \u042d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 <a href=\"http:\/\/www.viva64.com\/en\/pvs-studio\/\">PVS-Studio<\/a>, \u043d\u043e \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. Tesseract \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0435\u0433\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f CppCat.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u2013 CppCat \u0438\u043b\u0438 PVS-Studio \u2013 \u0442\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0439\u0442\u0435 CppCat. \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 CppCat \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0430\u043c \u0442\u0435\u0441\u0435\u043d, \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0442\u044c, \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c PVS-Studio. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u044d\u0442\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &quot;<a href=\"http:\/\/www.viva64.com\/ru\/b\/0228\/\">\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 PVS-Studio \u0437\u0430 $250<\/a>&quot;.<\/p>\n<h2>\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435. \u0421\u043a\u043e\u0440\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 BitsDuJour \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f CppCat \u0441\u043e \u0441\u043a\u0438\u0434\u043a\u043e\u0439 \u0432 50%. \u041f\u043e\u0434\u043f\u0438\u0448\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/h2>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u044f CppCat \u0441\u043e \u0441\u043a\u0438\u0434\u043a\u043e\u0439: <a href=\"http:\/\/www.bitsdujour.com\/software\/cppcat\">http:\/\/www.bitsdujour.com\/software\/cppcat<\/a><\/p>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h2>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u043e\u0442\u0447\u0451\u0442 CppCat. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f \u0447\u0442\u043e-\u0442\u043e \u0443\u043f\u0443\u0441\u0442\u0438\u043b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f\u043c Tesseract \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u0440\u043e\u0431\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u0430\u043a\u0442\u0438\u0432\u043d\u0430 7 \u0434\u043d\u0435\u0439, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041d\u0443 \u0430 \u043f\u043e\u0442\u043e\u043c \u0438\u043c \u0440\u0435\u0448\u0430\u0442\u044c, \u0445\u043e\u0442\u044f\u0442 \u043e\u043d\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438, \u0438\u043b\u0438 \u043d\u0435\u0442.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u043d\u0430\u043f\u043e\u043c\u043d\u044e. <a href=\"http:\/\/www.viva64.com\/ru\/b\/0105\/\">\u0421\u0443\u0442\u044c<\/a> \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0435 \u0432 \u0440\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u0445, \u0430 \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<h3>\u041d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">void LanguageModel::FillConsistencyInfo(....) {   ....   float gap_ratio = expected_gap \/ actual_gap;   if (gap_ratio &lt; 1\/2 || gap_ratio &gt; 2) {     consistency_info-&gt;num_inconsistent_spaces++;   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f CppCat: V636 The &#8216;1 \/ 2&#8217; expression was implicitly casted from &#8216;int&#8217; type to &#8216;float&#8217; type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) \/ Y;. language_model.cpp 1163<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e &#8216;gap_ratio&#8217; \u0445\u043e\u0442\u044f\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 0.5. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u044b\u0431\u0440\u0430\u043d \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c 0.5. \u0414\u0435\u043b\u0435\u043d\u0438\u0435 1\/2 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c \u0438 \u0434\u0430\u0451\u0442 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 0.<\/p>\n<p>  \u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c:  <\/p>\n<pre><code class=\"cpp\">if (gap_ratio &lt; 1.0f\/2 || gap_ratio &gt; 2) {<\/code><\/pre>\n<p>  \u0418\u043b\u0438 \u0442\u0430\u043a\u0438\u043c:  <\/p>\n<pre><code class=\"cpp\">if (gap_ratio &lt; 0.5f || gap_ratio &gt; 2) {<\/code><\/pre>\n<p>  \u0415\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>  \u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c:<\/p>\n<ul>\n<li>baselinedetect.cpp 110<\/li>\n<li>bmp_8.cpp 983<\/li>\n<li>cjkpitch.cpp 553<\/li>\n<li>cjkpitch.cpp 564<\/li>\n<li>mfoutline.cpp 392<\/li>\n<li>mfoutline.cpp 393<\/li>\n<li>normalis.cpp 454<\/li>\n<\/ul>\n<p>  <\/p>\n<h3>\u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">uintmax_t streamtoumax(FILE* s, int base) {   int d, c = 0;   ....   c = fgetc(s);   if (c == 'x' &amp;&amp; c == 'X') c = fgetc(s);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 CppCat: V547 Expression &#8216;c == &#8216;x&#8217; &amp;&amp; c == &#8216;X&#187; is always false. Probably the &#8216;||&#8217; operator should be used here. scanutils.cpp 135<\/p>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:  <\/p>\n<pre><code class=\"cpp\">if (c == 'x' || c == 'X') c = fgetc(s);<\/code><\/pre>\n<p>  <\/p>\n<h3>\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0430\u0441\u044c \u043e\u0434\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f. \u042f \u0442\u0430\u043a\u043e\u0433\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0438\u0434\u0435\u043b:  <\/p>\n<pre><code class=\"cpp\">void TabVector::Evaluate(....) {   ....   int num_deleted_boxes = 0;   ....   ++num_deleted_boxes = true;   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 CppCat: V567 Undefined behavior. The &#8216;num_deleted_boxes&#8217; variable is modified while being used twice between sequence points. tabvector.cpp 735<\/p>\n<p>  \u041d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0430\u0432\u0442\u043e\u0440. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435\u043c \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438.<\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;num_deleted_boxes&#8217; \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0430 \u043a\u0430\u043a \u0434\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a \u0438 \u043f\u043e\u0441\u043b\u0435. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b \u0432 \u043e\u0434\u043d\u043e\u0439 <a href=\"http:\/\/www.viva64.com\/ru\/t\/0065\/\">\u0442\u043e\u0447\u043a\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f<\/a>.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0435 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 <a href=\"http:\/\/www.viva64.com\/ru\/b\/0142\/\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0434\u0432\u0438\u0433\u043e\u0432<\/a>. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">void Dawg::init(....) {   ....   letter_mask_ = ~(~0 &lt;&lt; flag_start_bit_);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 V610 Undefined behavior. Check the shift operator &#8216;&lt;&lt;. The left operand &#8216;~0&#8217; is negative. dawg.cpp 187<\/p>\n<p>  \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 &#8216;~0&#8217; \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f &#8216;int&#8217; \u0438 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e &#8216;-1&#8217;. \u0421\u0434\u0432\u0438\u0433 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438. \u0422\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0437\u0435\u043d\u0438\u0435\u043c \u0438 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u043e\u0433\u043e. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0434\u043e\u0447\u0451\u0442, \u0441\u0434\u0435\u043b\u0430\u0432 &#8216;0&#8217; \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u043c:  <\/p>\n<pre><code class=\"cpp\">letter_mask_ = ~(~0u &lt;&lt; flag_start_bit_);<\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0451\u0442 \u043d\u0430 \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<p>  V629 Consider inspecting the &#8216;~0 &lt;&lt; flag_start_bit_&#8217; expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type. dawg.cpp 187<\/p>\n<p>  \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;letter_mask_&#8217; \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f &#8216;uinT64&#8217;. \u041a\u0430\u043a \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432 \u0441\u0442\u0430\u0440\u0448\u0438\u0435 32 \u0431\u0438\u0442\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u041e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043c\u043b\u0430\u0434\u0448\u0438\u043c\u0438 \u0431\u0438\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u041d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b &#8216;0&#8217; \u0431\u044b\u043b 64-\u0431\u0438\u0442\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:   <\/p>\n<pre><code class=\"cpp\">letter_mask_ = ~(~0ull &lt;&lt; flag_start_bit_);<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u0433\u0434\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0434\u0432\u0438\u0433 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b:<\/p>\n<ul>\n<li>dawg.cpp 188<\/li>\n<li>intmatcher.cpp 172<\/li>\n<li>intmatcher.cpp 174<\/li>\n<li>intmatcher.cpp 176<\/li>\n<li>intmatcher.cpp 178<\/li>\n<li>intmatcher.cpp 180<\/li>\n<li>intmatcher.cpp 182<\/li>\n<li>intmatcher.cpp 184<\/li>\n<li>intmatcher.cpp 186<\/li>\n<li>intmatcher.cpp 188<\/li>\n<li>intmatcher.cpp 190<\/li>\n<li>intmatcher.cpp 192<\/li>\n<li>intmatcher.cpp 194<\/li>\n<li>intmatcher.cpp 196<\/li>\n<li>intmatcher.cpp 198<\/li>\n<li>intmatcher.cpp 200<\/li>\n<li>intmatcher.cpp 202<\/li>\n<li>intmatcher.cpp 323<\/li>\n<li>intmatcher.cpp 347<\/li>\n<li>intmatcher.cpp 366<\/li>\n<\/ul>\n<p>  <\/p>\n<h3>\u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u0432\u043e\u0439\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">TESSLINE* ApproximateOutline(....) {   EDGEPT *edgept;   ....   edgept = edgesteps_to_edgepts(c_outline, edgepts);   fix2(edgepts, area);   edgept = poly2 (edgepts, area);  \/\/ 2nd approximation.   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 CppCat: V519 The &#8216;edgept&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 76, 78. polyaprx.cpp 78<\/p>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439:  <\/p>\n<pre><code class=\"cpp\">inT32 row_words2(....) {   ....   this_valid = blob_box.width () &gt;= min_width;   this_valid = TRUE;   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 CppCat: V519 The &#8216;this_valid&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 396, 397. wordseg.cpp 397<\/p>\n<h3>\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u043b\u0435\u043d\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430<\/h3>\n<p>  \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043b\u0430\u0441\u0441 &#8216;MasterTrainer&#8217;. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0447\u043b\u0435\u043d \u043a\u043b\u0430\u0441\u0441\u0430 &#8216;samples_&#8217; \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0434\u043e \u0447\u043b\u0435\u043d\u0430 &#8216;fontinfo_table_&#8217;:  <\/p>\n<pre><code class=\"cpp\">class MasterTrainer {   ....   TrainingSampleSet samples_;   ....   FontInfoTable fontinfo_table_;   .... };<\/code><\/pre>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u043b\u0435\u043d\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0438\u0445 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e &#8216;samples_&#8217; \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0414\u041e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 &#8216;fontinfo_table_&#8217;.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440:  <\/p>\n<pre><code class=\"cpp\">MasterTrainer::MasterTrainer(NormalizationMode norm_mode,                              bool shape_analysis,                              bool replicate_samples,                              int debug_level)   : norm_mode_(norm_mode), samples_(fontinfo_table_),     junk_samples_(fontinfo_table_),     verify_samples_(fontinfo_table_),     charsetsize_(0),     enable_shape_anaylsis_(shape_analysis),     enable_replication_(replicate_samples),     fragments_(NULL), prev_unichar_id_(-1),     debug_level_(debug_level) { }<\/code><\/pre>\n<p>  \u0411\u0435\u0434\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 &#8216;samples_&#8217; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;fontinfo_table_&#8217;.<\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043b\u0435\u0439 &#8216;junk_samples_&#8217; \u0438 &#8216;verify_samples_&#8217;.<\/p>\n<p>  \u042f \u043d\u0435 \u0431\u0435\u0440\u0443\u0441\u044c \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 &#8216;fontinfo_table_&#8217; \u0432 \u0441\u0430\u043c\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<h3>\u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438<\/h3>\n<p>  \u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043b\u043e\u0441\u0442\u0438.  <\/p>\n<pre><code class=\"cpp\">class ScriptDetector {   ....   int korean_id_;   int japanese_id_;   int katakana_id_;   int hiragana_id_;   int han_id_;   int hangul_id_;   int latin_id_;   int fraktur_id_;   .... };  void ScriptDetector::detect_blob(BLOB_CHOICE_LIST* scores) {   ....   if (prev_id == katakana_id_)     osr_-&gt;scripts_na[i][japanese_id_] += 1.0;   if (prev_id == hiragana_id_)     osr_-&gt;scripts_na[i][japanese_id_] += 1.0;   if (prev_id == hangul_id_)     osr_-&gt;scripts_na[i][korean_id_] += 1.0;   if (prev_id == han_id_)     osr_-&gt;scripts_na[i][korean_id_] += kHanRatioInKorean;   if (prev_id == han_id_)             &lt;&lt;&lt;&lt;====     osr_-&gt;scripts_na[i][japanese_id_] += kHanRatioInJapanese;   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 CppCat: V581 The conditional expressions of the &#8216;if&#8217; operators situated alongside each other are identical. Check lines: 551, 553. osdetect.cpp 553<\/p>\n<p>  \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0441\u0430\u043c\u043e\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c:  <\/p>\n<pre><code class=\"cpp\">if (prev_id == japanese_id_)<\/code><\/pre>\n<p>  <\/p>\n<h3>\u041d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h3>\n<p>  \u041d\u0435\u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;new&#8217;. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;new&#8217;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u043d\u043e \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 (<a href=\"http:\/\/www.viva64.com\/ru\/d\/0293\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438<\/a>).<\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"cpp\">void SetLabel(char_32 label) {   if (label32_ != NULL) {     delete []label32_;   }   label32_ = new char_32[2];   if (label32_ != NULL) {     label32_[0] = label;     label32_[1] = 0;   } }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 CppCat: V668 There is no sense in testing the &#8216;label32_&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. char_samp.h 73<\/p>\n<p>  \u0415\u0441\u0442\u044c \u0435\u0449\u0451 <b>101<\/b> \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0443\u043b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;new&#8217;. \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0438\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u0441\u043c\u044b\u0441\u043b\u0430. \u041f\u0440\u043e\u0449\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e CppCat.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e, \u0438 \u0432\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u0435 \u043c\u0430\u0441\u0441\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0447\u0435\u043c \u043e\u0442\u043b\u043e\u0432 \u0433\u043b\u0443\u043f\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a.<\/p>\n<p>  \u0418 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0437\u0430 \u043c\u043d\u043e\u044e \u0432 Twitter: <a href=\"https:\/\/twitter.com\/Code_Analysis\">@Code_Analysis<\/a>. \u042f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u0421\u0438++.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441?<\/b><\/p>\n<div class=\"spoiler_text\">\u0427\u0430\u0441\u0442\u043e \u043a \u043d\u0430\u0448\u0438\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c \u0437\u0430\u0434\u0430\u044e\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u041e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u043d\u0438\u0445 \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0437\u0434\u0435\u0441\u044c: <a href=\"http:\/\/www.viva64.com\/ru\/a\/0085\/\">\u041e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e PVS-Studio \u0438 CppCat, \u0432\u0435\u0440\u0441\u0438\u044f 2014<\/a>. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c.  <\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/223743\/\"> http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/223743\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/447\/6e0\/a58\/4476e0a58c450b49ebb49ba72d22bb81.png\" alt=\"Tesseract and CppCat\" align=\"left\"\/><br \/>  Tesseract \u2014 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 Google. \u0412 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f: \u00abTesseract is probably the most accurate open source OCR engine available\u00bb. \u0410 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c, \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 CppCat \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-223743","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/223743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=223743"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/223743\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=223743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=223743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=223743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}