{
    "version": "https:\/\/jsonfeed.org\/version\/1",
    "title": "Блог Артёма Агасиева: заметки с тегом Tesseract",
    "_rss_description": "Telegram: @aagasiev",
    "_rss_language": "ru",
    "_itunes_email": "",
    "_itunes_categories_xml": "",
    "_itunes_image": "",
    "_itunes_explicit": "",
    "home_page_url": "https:\/\/agasiev.com\/tags\/tesseract\/",
    "feed_url": "https:\/\/agasiev.com\/tags\/tesseract\/json\/",
    "icon": "https:\/\/agasiev.com\/user\/userpic@2x.jpg?1529202066",
    "author": {
        "name": "Артём Агасиев",
        "url": "https:\/\/agasiev.com\/",
        "avatar": "https:\/\/agasiev.com\/user\/userpic@2x.jpg?1529202066"
    },
    "items": [
        {
            "id": "33",
            "url": "https:\/\/agasiev.com\/all\/podgotovka-izobrazheniya-k-raspoznavaniyu\/",
            "title": "Подготовка изображения к OCR",
            "content_html": "<p>Бывает, что мне нужно провести несколько экспериментов по распознаванию текста на довольно зашумленных изображениях при помощи <a href=\"https:\/\/github.com\/tesseract-ocr\/tesseract\">Tesseract<\/a> с одним условием — надо сделать быстро.<\/p>\n<p>Но совсем плохой результат получить тоже не хочется. Поэтому, чтобы улучшить точность распознавания, нужно очистить исходное изображение от шумов и посторонних объектов. Для этого можно либо написать чутка кода, либо использовать утилиту convert из <a href=\"https:\/\/www.imagemagick.org\">ImageMagick<\/a>, либо можно взять вот <a href=\"http:\/\/www.fmwconcepts.com\/imagemagick\/textcleaner\/index.php\">этот<\/a> скрипт textcleaner, который, по факту, является надстройкой над convert, но простой как три копейки и сильно ускоряет работу. Вся документация подробно изложена на официальной страничке.<\/p>\n<p>Пример удаления бэкграунда, очистки текста, поворота и обрезки изображения:<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">.\/textcleaner -g -e stretch -f 30 -o 17 -t 15 -u -s 2 -T -p 20 -c 5 infile.jpg outfile.jpg<\/code><\/pre><p>Было\/стало:<\/p>\n<div class=\"e2-text-picture\">\n<div class=\"fotorama\" data-width=\"484\" data-ratio=\"0.9272030651341\">\n<img src=\"https:\/\/agasiev.com\/pictures\/abbott2.jpg\" width=\"484\" height=\"522\" alt=\"\" \/>\n<img src=\"https:\/\/agasiev.com\/pictures\/outfile.jpg\" width=\"511\" height=\"566\" alt=\"\" \/>\n<\/div>\n<\/div>\n<p>Дальше запускаем сам tesseract (у меня <a href=\"https:\/\/github.com\/tesseract-ocr\/tesseract\/releases\">4ая бета<\/a> с <a href=\"https:\/\/github.com\/tesseract-ocr\/tessdata_best\">LSTM моделями<\/a>):<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">tesseract outfile.jpg stdout -l eng --oem 1<\/code><\/pre><p>И получаем уже чистый текст:<\/p>\n<blockquote>\n<p>Clarification<\/p>\n<p>In the last edition of the “Catholic New World,” an<br \/>\narticle on the annual conference hosted by the Re-<br \/>\nspect Life Oftice did not fully reflect the context of<br \/>\nCardinal George’s remarks.<\/p>\n<p>During an informal question-and-answer session<br \/>\nwith the archdiocese’s parish Respect Life Coordi-<br \/>\nnators, the cardinal emphasized that the participa-<br \/>\ntion by any person in the promotion of abortion, in-<br \/>\ncluding through his or her political position, is a<br \/>\ngrave matter. While the issue of withholding Com-<br \/>\nmunion- from some of these individuals can be<br \/>\ncomplex, Cardinal George said that when any per-<br \/>\nson presents him or herself to receive the Eucharist,<br \/>\nthey “take their salvation into their own hands.” For<br \/>\na more complete explanation of this matter, refer-<br \/>\nence the cardinal’s column “Catholic participation<br \/>\nin political life, revisited” (CNW, Oct. 10, 2004)<br \/>\nonline at www.catholicnewworld.com\/<br \/>\ncnw\/issue\/2004\/cardinal _101004.html .<\/p>\n<\/blockquote>\n<p>Качество распознавания получилось вполне достойное.<\/p>\n<p>Есть только один минус: бесплатное использование textcleaner разрешено только в некоммерческих целях. В общем, автор жадина-говядина :) Так что используем только для домашних проектов, либо вполне заслуженно поддерживаем финансово создателя скрипта.<\/p>\n",
            "date_published": "2018-07-13T13:02:55+03:00",
            "date_modified": "2018-07-13T16:21:31+03:00",
            "image": "https:\/\/agasiev.com\/pictures\/abbott2.jpg",
            "_date_published_rfc2822": "Fri, 13 Jul 2018 13:02:55 +0300",
            "_rss_guid_is_permalink": "false",
            "_rss_guid": "33",
            "_e2_data": {
                "is_favourite": false,
                "links_required": [
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css",
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css",
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css",
                    "system\/library\/jquery\/jquery.js",
                    "system\/library\/fotorama\/fotorama.css",
                    "system\/library\/fotorama\/fotorama.js",
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css"
                ],
                "og_images": [
                    "https:\/\/agasiev.com\/pictures\/abbott2.jpg",
                    "https:\/\/agasiev.com\/pictures\/outfile.jpg"
                ]
            }
        }
    ],
    "_e2_version": 3576,
    "_e2_ua_string": "E2 (v3576; Aegea)"
}