{"id":320684,"date":"2021-04-01T15:00:52","date_gmt":"2021-04-01T15:00:52","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320684"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320684","title":{"rendered":"\u042f\u043d\u0434\u0435\u043a\u0441-\u043a\u0430\u043f\u0447\u0430 vs tesseract"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0420\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e\u0431 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u043c \u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0438 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043a\u0430\u043f\u0447\u0430-\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430, \u043d\u043e\u0432\u043e\u0439 \u044f\u043d\u0434\u0435\u043a\u0441-\u043a\u0430\u043f\u0447\u0435. \u041f\u043e\u0438\u0449\u0435\u043c \u0441\u043b\u0430\u0431\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u043f\u0440\u043e\u043b\u0435\u0437\u0435\u043c \u0432 \u044d\u0442\u0438 \u0441\u043b\u0430\u0431\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0438 \u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c\u0441\u044f \u0442\u0430\u043c. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0435\u043c \u043d\u0430 \u0442\u0435\u043c\u0443 \u2014 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0430\u043a\u0435\u0442\u0443 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u2014 Tesseract \u2014 \u0441\u0442\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jz\/nt\/j-\/jzntj-gvjtgxpkl0xqgthizapgu.jpeg\"> <br \/>  <a name=\"habracut\"><\/a><\/p>\n<h3>\u0414\u0430\u043d\u043e.<\/h3>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u043e\u0432\u043e\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u043f\u0447\u0438 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043d\u043e\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u044d\u0442\u043e \u0434\u0435\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0432\u043a\u0443\u0441 \u0438 \u0446\u0432\u0435\u0442. \u041a\u0430\u043f\u0447\u0438 \u0447\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u043e-\u0441\u0435\u0440\u044b\u0435, \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0445\u043e\u0436\u0438\u0445 \u0446\u0432\u0435\u0442\u043e\u0432.<br \/>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0439\u0442\u0438 \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u0432 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u043a\u0430\u043f\u0447\u0430\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u0438\u0431\u043e \u0442\u0430\u043a (\u00ab\u0437\u043c\u0435\u0439\u043a\u0430\u00bb):<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/m7\/qe\/26\/m7qe26lb9nzmym_k5znwfneu2uw.jpeg\"><br \/>  \u043b\u0438\u0431\u043e \u0442\u0430\u043a (\u00ab\u0443\u043b\u044b\u0431\u043a\u0430\u00bb):<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eq\/hd\/nv\/eqhdnvd-cveuxyiebsb5ajjn0js.jpeg\"><br \/>  \u043b\u0438\u0431\u043e \u0442\u0430\u043a(\u00ab\u0433\u043e\u0440\u043a\u0430\u00bb):<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uh\/3q\/dd\/uh3qddjlabx11kjkgm21xlvia1o.jpeg\"><br \/>  \u0422\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0440\u0443\u0441\u0441\u043a\u0438\u0439, \u0442\u0430\u043a \u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439 \u0442\u0435\u043a\u0441\u0442, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0434\u0432\u0443\u043c\u044f \u0441\u043b\u043e\u0432\u0430\u043c\u0438. \u0414\u0430\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0432 \u043a\u0430\u043a\u0443\u044e-\u043b\u0438\u0431\u043e \u0432\u043c\u0435\u043d\u044f\u0435\u043c\u0443\u044e \u0444\u0440\u0430\u0437\u0443, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b.<\/p>\n<h3>\u0421 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c.<\/h3>\n<p>  \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 opencv \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043a\u0430\u043f\u0447\u0430 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0430 \u043a \u0442\u0430\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043a\u0430\u043a Erosion, Dilation, Harris_corners:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ct\/pz\/hd\/ctpzhdppg_ztuhfha8locveunpw.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/go\/cn\/s7\/gocns7mdais5kigxy3rbxcjgpr4.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-n\/od\/48\/-nod48rubq1uxxy8kywguov2-es.png\"><\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0430\u0435\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u00ab\u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c\u00bb \u043f\u0438\u043a\u0441\u0435\u043b\u0438 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043a\u0430\u043f\u0447\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0448\u0443\u043c\u044b:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_4\/q6\/qb\/_4q6qb8kyhwkrkba90jhhwoitia.jpeg\"><\/p>\n<h3>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435.<\/h3>\n<p>.<br \/>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0442\u0430\u0440\u044b\u0439, \u0434\u043e\u0431\u0440\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 tesseract, \u0430 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043a\u043e\u0434 \u0438\u0437 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/www.pyimagesearch.com\/2020\/05\/25\/tesseract-ocr-text-localization-and-detection\/\" rel=\"nofollow noopener noreferrer\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>.<br \/>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0438 \u0446\u0435\u043b\u043e\u043c \u0432 \u043d\u0435\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0430\u043a\u0435\u0442 tesseract \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f confidence \u0438 text. \u0413\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0441\u0430\u043c \u0442\u0435\u043a\u0441\u0442. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0438\u0441\u0443\u0435\u0442 \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435, \u0447\u0442\u043e \u043e\u043d\u0430 \u00ab\u0432\u0438\u0434\u0438\u0442\u00bb. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.<br \/>  \u041f\u043e\u0432\u044b\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0438\u0437 \u043d\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043e \u0438 \u0442.\u043f.<br \/>  \u0412 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># import the necessary packages from pytesseract import Output import pytesseract import argparse import cv2 # \u041f\u0443\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f tesseract pytesseract.pytesseract.tesseract_cmd = 'D:\\\\Tesseract-OCR\\\\tesseract.exe' image = cv2.imread('4-.jpg') rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) config = r'--oem 3 --psm 6' results = pytesseract.image_to_data(rgb, output_type=Output.DICT,config=config,lang='rus') # loop over each of the individual text localizations for i in range(0, len(results[&quot;text&quot;])): \t# extract the bounding box coordinates of the text region from \t# the current result \tx = results[&quot;left&quot;][i] \ty = results[&quot;top&quot;][i] \tw = results[&quot;width&quot;][i] \th = results[&quot;height&quot;][i] \t# extract the OCR text itself along with the confidence of the \t# text localization \ttext = results[&quot;text&quot;][i] \tconf = int(results[&quot;conf&quot;][i]) \tif conf &gt; 0: \t   print(&quot;Confidence: {}&quot;.format(conf)) \t   print(&quot;Text: {}&quot;.format(text)) \t   print(&quot;&quot;) \t   text = &quot;&quot;.join([c if ord(c) &lt; 128 else &quot;&quot; for c in text]).strip() \t   cv2.rectangle(image, (x, y), (x + w, y + h), (0, 255, 0), 2) \t   #cv2.putText(image, text, (x, y - 10), cv2.FONT_HERSHEY_SIMPLEX,1.2, (0, 0, 255), 3)  # show the output image cv2.imshow(&quot;Image&quot;, image) cv2.waitKey(0)<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  *\u0420\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u043d\u0430\u0434\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 tesseract, \u043d\u043e \u044d\u0442\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u0430\u0434\u043e \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0435\u0433\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e.<br \/>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ap\/kv\/5x\/apkv5xnzgy2zvl8lpuhllz-n2fg.png\"><br \/>  \u0425\u043c, \u043f\u0435\u0440\u0432\u0430\u044f \u043a\u0430\u043f\u0447\u0430 \u043a\u0430\u043a-\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0434\u0430\u043b\u0430\u0441\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u0440\u0443\u0433\u0443\u044e:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/n-\/av\/ed\/n-avedpx7aom4c2x793c04gxm1y.png\"><br \/>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u043e\u0441\u044c, \u0430 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435\u0442. <\/p>\n<h3>\u0423\u043b\u0443\u0447\u0448\u0430\u0435\u043c tesseract.<\/h3>\n<p>  \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0442\u043e\u043c\u043b\u044f\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438 \u0431\u0435\u0437\u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u0443\u0442\u0438.<br \/>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043e\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 tesseract \u043f\u0440\u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430 10 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432.<br \/>  \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qt\/3r\/kd\/qt3rkdt35cqwbob30lj_trl3ssa.png\"><br \/>  \u0422\u043e \u0435\u0441\u0442\u044c, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e.<br \/>  \u041f\u043e\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0443\u0433\u043b\u0430\u043c\u0438 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043e\u0442 -20 \u0434\u043e 20 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0441\u0435\u0447\u0435\u043c \u0441\u043b\u043e\u0432\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 5 \u0431\u0443\u043a\u0432 (\u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u043b\u043e\u0432\u0430 \u0434\u043b\u0438\u043d\u043d\u0435\u0435):  <\/p>\n<pre><code class=\"python\"> from pytesseract import Output import pytesseract import argparse import cv2 pytesseract.pytesseract.tesseract_cmd = 'D:\\\\Tesseract-OCR\\\\tesseract.exe' a=[]  # \u043f\u043e\u0432\u0435\u0440\u043d\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 x \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 for x in range (-20,20):         image = cv2.imread('4-.jpg')                 (h, w) = image.shape[:2]         center = (w \/ 2, h \/ 2)         #print(&quot;\u0443\u0433\u043e\u043b: {}&quot;.format(x))         M = cv2.getRotationMatrix2D(center, x, 1.0)         rotated = cv2.warpAffine(image, M, (w, h))          rgb = cv2.cvtColor(rotated, cv2.COLOR_BGR2RGB)         config = r'--oem 3 --psm 6'         results = pytesseract.image_to_data(rgb, output_type=Output.DICT,config=config,lang='rus')                  # loop over each of the individual text localizations         for i in range(0, len(results[&quot;text&quot;])):                                             text = results[&quot;text&quot;][i]                 conf = int(results[&quot;conf&quot;][i])                 if conf &gt; 0:                                       if len(text)&gt;5:                                                       a.append(text)  print(a) <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:  <\/p>\n<pre><code class=\"python\"> ['\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0435\u043b\u0438\u0447\u0438\u0438\u043b', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0427', '\u0432\u0435\u043b\u0438\u0447\u0438\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438\u0427', '\u0432\u0435\u043b\u0438\u0447\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438', '\u0432\u0435\u043b\u0438\u0447\u0438', '\u043b\u0438\u0448\u0438\u043b!', '\u043b\u0438\u0448\u0430\u043b|', '\u043b\u0438\u0449\u0438\u043b`'] <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, tesseract \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043f\u043b\u043e\u0445, \u0435\u0441\u043b\u0438 \u0438\u043c \u043f\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c.<\/p>\n<h3>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0430\u043c\u043e\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0435.<\/h3>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0432\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435.<br \/>  \u041f\u043e\u0447\u0438\u0441\u0442\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043b\u043e\u0432, \u0443\u0434\u0430\u043b\u0438\u0432 \u043e\u0442\u0442\u0443\u0434\u0430 \u0441\u043b\u043e\u0432\u0430, \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0431\u0443\u043a\u0432\u044b \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435, \u0441\u043f\u0435\u0446\u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0443\u0431\u043b\u0438 \u0441\u043b\u043e\u0432:  <\/p>\n<pre><code class=\"python\"> for i in set(a): #\u0432\u044b\u043a\u0438\u043d\u0443\u043b\u0438 \u0434\u0443\u0431\u043b\u0438         if any(char in &quot; .,:;!_*-+()\/#\u00a4%&amp;?)&quot; for char in i)==True:#\u0432\u044b\u043a\u0438\u043d\u0443\u043b\u0438 \u0441\u043b\u043e\u0432\u0430 \u0441\u043e \u0441\u043f\u0435\u0446\u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438                 pass         else:                 if i.islower(): #\u0432\u044b\u043a\u0438\u043d\u0443\u043b\u0438 \u0441 \u0432\u0435\u0440\u0445\u043d\u0438\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u043c                                         print(i)  <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u043b\u043e\u0432:  <\/p>\n<pre><code class=\"python\"> \u0432\u0435\u043b\u0438\u0447\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u0438 \u0435\u043b\u0438\u0447\u0438\u0438\u043b \u043b\u0438\u0448\u0438\u043b \u0432\u0435\u043b\u0438\u0447 <\/code><\/pre>\n<p>  \u0414\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c \u2014 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0441\u0432\u044f\u0437\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430.<br \/>  \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 pyenchant, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<br \/>  \u0414\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c <a href=\"https:\/\/github.com\/LibreOffice\/dictionaries\/tree\/master\/ru_RU\" rel=\"nofollow noopener noreferrer\">\u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b<\/a> \u0432 <a href=\"http:\/\/C:%5C...%5CPython%5CPython36%5Csite-packages%5Cenchant%5Cdata%5Cmingw64%5Cshare%5Cenchant%5Chunspell\">\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e<\/a> \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u0430. \u041f\u0440\u043e pyenchant \u0435\u0441\u0442\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f <a href=\"https:\/\/%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%81%D1%82%D1%83.%D1%80%D1%84\/python\/python-proverka-orfografii-windows-linux-pyenchant\/\" rel=\"nofollow noopener noreferrer\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435, \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 pyenchant, \u0438\u043c\u0435\u0435\u043c:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ng\/io\/ay\/ngioayxelh51ctnaju_0qnz4r1a.png\"><br \/>  \u041d\u0443 \u0438 \u00ab\u043f\u043e\u0432\u0435\u0440\u0436\u0435\u043d\u043d\u0443\u044e\u00bb \u043a\u0430\u043f\u0447\u0443 \u043f\u043e\u0441\u043b\u0435 \u0446\u0438\u043a\u043b\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_c\/c2\/ck\/_cc2ckkzcgo9d1pqnvfsznnad2i.png\"><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u043f\u0447\u0438 \u0441 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0442\u0438\u043f\u0443 \u00ab\u0437\u043c\u0435\u0439\u043a\u0438\u00bb \u0442\u0430\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0433\u043b\u043e\u0449\u0430\u0442\u044c\u0441\u044f tesser\u0430ct\u043e\u043c. \u041f\u0435\u0447\u0430\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0438\u0445 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043c\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0447\u0438\u0445. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043a\u0430\u043f\u0447\u0430\u043c\u0438 \u043f\u043e \u0442\u0438\u043f\u0443 \u00ab\u0433\u043e\u0440\u043e\u043a\u00bb \u0438 \u00ab\u0443\u043b\u044b\u0431\u043e\u043a\u00bb \u043f\u043e\u043a\u0430 \u043d\u0435 \u044f\u0441\u043d\u043e.<\/p>\n<p>  \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 <a href=\"https:\/\/disk.yandex.ru\/d\/0kTepfApOB5_cw\" rel=\"nofollow noopener noreferrer\">\u043a\u043e\u0434<\/a>.<br \/>  \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0442\u0443\u0448\u043a\u0438 \u043a\u0430\u043f\u0447 \u2014 <a href=\"https:\/\/disk.yandex.ru\/d\/dOWP9b6sal-P-w\" rel=\"nofollow noopener noreferrer\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/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=\"https:\/\/habr.com\/ru\/post\/549442\/\"> https:\/\/habr.com\/ru\/post\/549442\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0420\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e\u0431 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u043c \u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0438 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043a\u0430\u043f\u0447\u0430-\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430, \u043d\u043e\u0432\u043e\u0439 \u044f\u043d\u0434\u0435\u043a\u0441-\u043a\u0430\u043f\u0447\u0435. \u041f\u043e\u0438\u0449\u0435\u043c \u0441\u043b\u0430\u0431\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u043f\u0440\u043e\u043b\u0435\u0437\u0435\u043c \u0432 \u044d\u0442\u0438 \u0441\u043b\u0430\u0431\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0438 \u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c\u0441\u044f \u0442\u0430\u043c. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0435\u043c \u043d\u0430 \u0442\u0435\u043c\u0443 \u2014 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0430\u043a\u0435\u0442\u0443 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u2014 Tesseract \u2014 \u0441\u0442\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jz\/nt\/j-\/jzntj-gvjtgxpkl0xqgthizapgu.jpeg\">   <\/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-320684","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320684","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=320684"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320684\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}