{"id":325783,"date":"2021-07-01T03:00:17","date_gmt":"2021-07-01T03:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325783"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325783","title":{"rendered":"Tesseract OCR, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0425\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0422\u0430\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043f\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0432\u0430\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043e\u0442\u0447\u0435\u0442\u0430 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0435\u0451 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443.<\/p>\n<p>\u0420\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c, \u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0441\u043e\u0431\u044b\u0439 output_type:<\/p>\n<pre><code class=\"python\">pd_dataframe = pytesseract.image_to_data(image, output_type=Output.DATAFRAME)<\/code><\/pre>\n<p>\u0418 \u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u0438\u0437 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u043e\u0434\u043d\u0443 \u0435\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 (\u043d\u0438\u0436\u0435 \u043d\u0430 \u043d\u0435\u0439 \u0436\u0435 \u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c) \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/32a\/3eb\/975\/32a3eb9756693f5af36753b8dc718189.png\" alt=\"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 output_type = Output.DATAFRAME\" title=\"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 output_type = Output.DATAFRAME\" width=\"730\" height=\"348\"><figcaption>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 output_type = Output.DATAFRAME<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043b\u043e\u043d\u043e\u043a (eng)<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>level = 1\/2\/3\/4\/5\uff0cthe level of current item.<\/p>\n<\/li>\n<li>\n<p>page_num: the page index of the current item. In most instances, a image only has one page.<\/p>\n<\/li>\n<li>\n<p>block_num: the block item of the current item. when tesseract OCR Image, it will split the image into several blocks according the PSM parameters and some rules. The words in a line often in a block.<\/p>\n<\/li>\n<li>\n<p>par_num: The paragraph index of the current item. It is the page analysis results. <\/p>\n<\/li>\n<li>\n<p>line_num: The line index of the current item. It is the page analysis results.<\/p>\n<\/li>\n<li>\n<p>word_num: The word index in one block.<\/p>\n<\/li>\n<li>\n<p>left\/top\/width\/height\uff1athe top-left coordinate and the width and height of the current word.<\/p>\n<\/li>\n<li>\n<p>conf: the confidence of the current word, the range is -1~100.. The -1 means that there is no text here. The 100 is the highest value.<\/p>\n<\/li>\n<li>\n<p>text: the word ocr results.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u043e\u0432, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0443\u043a\u0430\u0437\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 (\u043e\u0431\u044b\u0447\u043d\u043e \u043e\u0434\u043d\u0430 \u0443 \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0432), \u0431\u043b\u043e\u043a, \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0432 \u0431\u043b\u043e\u043a\u0435, \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430, \u043d\u043e\u043c\u0435\u0440 \u0441\u043b\u043e\u0432\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9dd\/eae\/217\/9ddeae217911e973cf9312530f8a3226.png\" alt=\"\u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0431\u043b\u043e\u043a\u043e\u0432 \u043e\u0442 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u043e\u0432 (block vs par_num)\" title=\"\u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0431\u043b\u043e\u043a\u043e\u0432 \u043e\u0442 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u043e\u0432 (block vs par_num)\" width=\"779\" height=\"314\"><figcaption>\u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0431\u043b\u043e\u043a\u043e\u0432 \u043e\u0442 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u043e\u0432 (block vs par_num)<\/figcaption><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u0445:<\/p>\n<p>left &#8212; \u043e\u0442\u0441\u0442\u0443\u043f \u043e\u0442 \u043b\u0435\u0432\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0434\u043e \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u043b\u043e\u0432\u0430<\/p>\n<p>top &#8212; \u043e\u0442\u0441\u0442\u0443\u043f \u043e\u0442 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0434\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u043b\u043e\u0432\u0430<\/p>\n<p>width &#8212; \u0434\u043b\u0438\u043d\u0430 \u0441\u043b\u043e\u0432\u0430 (\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043b\u0435\u0432\u043e\u0439 \u0438 \u043f\u0440\u0430\u0432\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u0441\u043b\u043e\u0432\u0430)<\/p>\n<p>height &#8212; \u0432\u044b\u0441\u043e\u0442\u0430 \u0441\u043b\u043e\u0432\u0430 (\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u0436\u043d\u0435\u0439 \u0438 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u0441\u043b\u043e\u0432\u0430)<\/p>\n<p>\u0414\u043b\u044f \u0431\u043b\u043e\u043a\u0430 \u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430 \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u043c \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 left \u0438 top, \u0430 width \u0438 height \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d0\/c6b\/5d3\/3d0c6b5d3095d695850364c37e69eca6.png\" width=\"721\" height=\"365\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u0441 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0431\u043b\u043e\u043a\u043e\u0432, \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u043e\u0432, \u0441\u0442\u0440\u043e\u043a, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439.. \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0435\u0448\u0430\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0414\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f (\u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0438\u0433\u0443\u0440, \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0434\u0440.) \u043f\u043e \u044d\u0442\u0438\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043d\u0430 \u043d\u0435\u0439 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432\u044b \u0438\u0441\u043a\u0443\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u0438 \u0435\u0451 &#8212; \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435.<\/p>\n<p>\u041a\u043e\u0434 \u0447\u0442\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430, \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f cv2.rectangle \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c <a href=\"https:\/\/github.com\/eny01\/ocr-habr\" rel=\"noopener noreferrer nofollow\">\u0432\u044b\u043b\u043e\u0436\u0443 \u043d\u0430 GitHub<\/a><\/p>\n<\/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\/565566\/\"> https:\/\/habr.com\/ru\/post\/565566\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0425\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0422\u0430\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043f\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0432\u0430\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043e\u0442\u0447\u0435\u0442\u0430 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0435\u0451 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443.<\/p>\n<p>\u0420\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c, \u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0441\u043e\u0431\u044b\u0439 output_type:<\/p>\n<pre><code class=\"python\">pd_dataframe = pytesseract.image_to_data(image, output_type=Output.DATAFRAME)<\/code><\/pre>\n<p>\u0418 \u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u0438\u0437 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u043e\u0434\u043d\u0443 \u0435\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 (\u043d\u0438\u0436\u0435 \u043d\u0430 \u043d\u0435\u0439 \u0436\u0435 \u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c) \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 output_type = Output.DATAFRAME<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043b\u043e\u043d\u043e\u043a (eng)<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>level = 1\/2\/3\/4\/5\uff0cthe level of current item.<\/p>\n<\/li>\n<li>\n<p>page_num: the page index of the current item. In most instances, a image only has one page.<\/p>\n<\/li>\n<li>\n<p>block_num: the block item of the current item. when tesseract OCR Image, it will split the image into several blocks according the PSM parameters and some rules. The words in a line often in a block.<\/p>\n<\/li>\n<li>\n<p>par_num: The paragraph index of the current item. It is the page analysis results. <\/p>\n<\/li>\n<li>\n<p>line_num: The line index of the current item. It is the page analysis results.<\/p>\n<\/li>\n<li>\n<p>word_num: The word index in one block.<\/p>\n<\/li>\n<li>\n<p>left\/top\/width\/height\uff1athe top-left coordinate and the width and height of the current word.<\/p>\n<\/li>\n<li>\n<p>conf: the confidence of the current word, the range is -1~100.. The -1 means that there is no text here. The 100 is the highest value.<\/p>\n<\/li>\n<li>\n<p>text: the word ocr results.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u043e\u0432, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0443\u043a\u0430\u0437\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 (\u043e\u0431\u044b\u0447\u043d\u043e \u043e\u0434\u043d\u0430 \u0443 \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0432), \u0431\u043b\u043e\u043a, \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0432 \u0431\u043b\u043e\u043a\u0435, \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430, \u043d\u043e\u043c\u0435\u0440 \u0441\u043b\u043e\u0432\u0430.<\/p>\n<figure class=\"full-width\"><figcaption>\u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0431\u043b\u043e\u043a\u043e\u0432 \u043e\u0442 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u043e\u0432 (block vs par_num)<\/figcaption><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u0445:<\/p>\n<p>left &#8212; \u043e\u0442\u0441\u0442\u0443\u043f \u043e\u0442 \u043b\u0435\u0432\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0434\u043e \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u043b\u043e\u0432\u0430<\/p>\n<p>top &#8212; \u043e\u0442\u0441\u0442\u0443\u043f \u043e\u0442 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0434\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u043b\u043e\u0432\u0430<\/p>\n<p>width &#8212; \u0434\u043b\u0438\u043d\u0430 \u0441\u043b\u043e\u0432\u0430 (\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043b\u0435\u0432\u043e\u0439 \u0438 \u043f\u0440\u0430\u0432\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u0441\u043b\u043e\u0432\u0430)<\/p>\n<p>height &#8212; \u0432\u044b\u0441\u043e\u0442\u0430 \u0441\u043b\u043e\u0432\u0430 (\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u0436\u043d\u0435\u0439 \u0438 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u0441\u043b\u043e\u0432\u0430)<\/p>\n<p>\u0414\u043b\u044f \u0431\u043b\u043e\u043a\u0430 \u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430 \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u043c \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 left \u0438 top, \u0430 width \u0438 height \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u0441 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0431\u043b\u043e\u043a\u043e\u0432, \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u043e\u0432, \u0441\u0442\u0440\u043e\u043a, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439.. \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0435\u0448\u0430\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0414\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f (\u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0438\u0433\u0443\u0440, \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0434\u0440.) \u043f\u043e \u044d\u0442\u0438\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043d\u0430 \u043d\u0435\u0439 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432\u044b \u0438\u0441\u043a\u0443\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u0438 \u0435\u0451 &#8212; \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435.<\/p>\n<p>\u041a\u043e\u0434 \u0447\u0442\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430, \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f cv2.rectangle \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c <a href=\"https:\/\/github.com\/eny01\/ocr-habr\" rel=\"noopener noreferrer nofollow\">\u0432\u044b\u043b\u043e\u0436\u0443 \u043d\u0430 GitHub<\/a><\/p>\n<\/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\/565566\/\"> https:\/\/habr.com\/ru\/post\/565566\/<\/a><br \/><\/br><\/br><\/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-325783","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325783","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=325783"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325783\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}