{"id":381791,"date":"2024-06-29T03:52:42","date_gmt":"2024-06-29T03:52:42","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=381791"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=381791","title":{"rendered":"<span>\u041a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 HUAWEI ML Kit \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u043d\u043e\u043c\u0435\u0440\u043e\u0432<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2 id=\"obschaya-informaciya\">\u041e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0412 <a href=\"https:\/\/forums.developer.huawei.com\/forumPortal\/en\/topicview?tid=0201256094474040234&amp;fid=0101187876626530001\" rel=\"nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439<\/a> \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 HUAWEI ML Kit \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043a\u0430\u0440\u0442. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u0441\u0432\u043e\u0435\u0439 \u043a\u0430\u0440\u0442\u044b, \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0432\u0441\u044e \u0432\u0430\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0432\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u043e\u0439 \u043a\u0430\u0440\u0442\u044b. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u043e \u0441\u0447\u0435\u0442\u0430\u043c\u0438 \u0438 \u0441\u043a\u0438\u0434\u043e\u0447\u043d\u044b\u043c\u0438 \u043a\u0443\u043f\u043e\u043d\u0430\u043c\u0438? \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0432\u0430\u043c, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 HUAWEI ML Kit \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0441\u0447\u0435\u0442\u043e\u0432 \u0438 \u0441\u043a\u0438\u0434\u043e\u0447\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"naznachenie\">\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0441\u0447\u0435\u0442 \u043d\u0438\u0436\u0435, \u0443\u043a\u0430\u0436\u0438\u0442\u0435, \u0447\u0442\u043e \u043d\u043e\u043c\u0435\u0440 \u0443\u0441\u043b\u0443\u0433\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u00abNO.DE SERVICIO\u00bb, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u044b \u0434\u043e 12 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430 \u00ab123456789123\u00bb \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ai\/kc\/cr\/aikccreqsyov3vdx2rtadnwvgzm.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/ai\/kc\/cr\/aikccreqsyov3vdx2rtadnwvgzm.png\"\/><\/div>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0441\u043a\u0438\u0434\u043e\u0447\u043d\u044b\u0439 \u043a\u0443\u043f\u043e\u043d \u043d\u0438\u0436\u0435, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u0434\u0430 \u00abFAVE-\u00bb, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u044c\u0442\u0435 \u0434\u043b\u0438\u043d\u0443 \u0434\u043e 4 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434 \u0441\u043a\u0438\u0434\u043a\u0438 \u00ab8329\u00bb \u0438 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u043b\u0430\u0442\u0435\u0436.<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/5f\/oh\/h1\/5fohh1ybdcjjnnlo2jtqjsu1w4o.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/5f\/oh\/h1\/5fohh1ybdcjjnnlo2jtqjsu1w4o.png\"\/><\/div>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u043e, \u043f\u0440\u0430\u0432\u0434\u0430? \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"integraciya-funkcii-raspoznavaniya-teksta\">\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440\u0430 \u0441\u0447\u0435\u0442\u043e\u0432 \u0438 \u0441\u043a\u0438\u0434\u043e\u0447\u043d\u044b\u0435 \u043a\u043e\u0434\u044b.<\/p>\n<p>  <\/p>\n<h3 id=\"1--podgotovka\">1. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0430\u0433\u0430\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 <a href=\"https:\/\/developer.huawei.com\/consumer\/en\/doc\/development\/HMS-Guides\/ml-process-4\" rel=\"nofollow\">HUAWEI Developer<\/a>. \u041d\u0438\u0436\u0435 \u043c\u044b \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p>  <\/p>\n<h4 id=\"11-nastroyte-adres-repozitoriya-maven-v-fayle-na-urovne-proekta-buildgradle\">1.1 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f Maven \u0432 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 build.gradle<\/h4>\n<p>  <\/p>\n<pre><code class=\"javascript\">buildscript {     repositories {      ...         maven {url 'https:\/\/developer.huawei.com\/repo\/'}     } }  dependencies {    ...         classpath 'com.huawei.agconnect:agcp:1.3.1.300'     } allprojects {     repositories {      ...         maven {url 'https:\/\/developer.huawei.com\/repo\/'}     } }<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"12-dobavte-nastroyki-k-zagolovku-fayla\">1.2 \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 \u0444\u0430\u0439\u043b\u0430<\/h4>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 SDK \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">apply plugin: 'com.android.application' apply plugin: 'com.huawei.agconnect'<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"13-nastroyte-zavisimosti-sdk-v-fayle-na-urovne-prilozheniya-buildgradle\">1.3 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 SDK \u0432 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f build.gradle<\/h4>\n<p>  <\/p>\n<pre><code class=\"javascript\">dependencies {     \/\/ Import the base SDK.     implementation 'com.huawei.hms:ml-computer-vision-ocr:2.0.1.300'     \/\/ Import the Latin character recognition model package.     implementation 'com.huawei.hms:ml-computer-vision-ocr-latin-model:2.0.1.300'     \/\/ Import the Japanese and Korean character recognition model package.     implementation 'com.huawei.hms:ml-computer-vision-ocr-jk-model:2.0.1.300'     \/\/ Import the Chinese and English character recognition model package.     implementation 'com.huawei.hms:ml-computer-vision-ocr-cn-model:2.0.1.300' }<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"14-dobavte-eti-vyrazheniya-v-fayl-androidmanifestxml-dlya-avtomaticheskogo-obnovleniya-modeli-mashinnogo-obucheniya\">1.4 \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u044d\u0442\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b AndroidManifest.xml \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>  <\/p>\n<pre><code class=\"javascript\">&lt;manifest>     ...     &lt;meta-data         android:name=\"com.huawei.hms.ml.DEPENDENCY\"         android:value=\"ocr\" \/>      ... &lt;\/manifest>   <\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"15-otpravte-zayavku-na-pravo-ispolzovaniya-kamery\">1.5 \u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0437\u0430\u044f\u0432\u043a\u0443 \u043d\u0430 \u043f\u0440\u0430\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043c\u0435\u0440\u044b<\/h4>\n<p>  <\/p>\n<pre><code class=\"javascript\">&lt;uses-permission android:name=\"android.permission.CAMERA\" \/> &lt;uses-permission android:name=\"android.permission.INTERNET\" \/>  &lt;uses-feature android:name=\"android.hardware.camera\" \/> &lt;uses-feature android:name=\"android.hardware.camera.autofocus\" \/><\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"2-razrabotka-koda\">2. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u0434\u0430<\/h3>\n<p>  <\/p>\n<h4 id=\"21-sozdayte-analizator\">2.1 \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\">MLTextAnalyzer analyzer = new MLTextAnalyzer.Factory(context).setLanguage(type).create();<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"22-nastroyte-obrabotku-rezultatov-raspoznavaniya-dlya-privyazki-analizatora\">2.2 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\">analyzer.setTransactor(new OcrDetectorProcessor());<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"23-vyzovite-sinhronnyy-api\">2.3 \u0412\u044b\u0437\u043e\u0432\u0438\u0442\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 API<\/h4>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e <strong>LensEngine <\/strong>SDK \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442, \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u0430\u043c\u0435\u0440\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">lensEngine = new LensEngine.Creator(context, analyzer)   .setLensType(LensEngine.BACK_LENS)   .applyDisplayDimension(width, height)   .applyFps(30.0f)   .enableAutomaticFocus(true)   .create(); <\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"24-vyzovite-metod-run-dlya-zapuska-kamery-i-schityvaniya-dannyh-kamery-pri-raspoznavanii\">2.4 \u0412\u044b\u0437\u043e\u0432\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 run \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u0430\u043c\u0435\u0440\u044b \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u043c\u0435\u0440\u044b \u043f\u0440\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0438<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\">try {     lensEngine.run(holder); } catch (IOException e) {     \/\/ Exception handling logic.     Log.e(\"TAG\", \"e=\" + e.getMessage()); }<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"25-obrabotayte-rezultaty-raspoznavaniya-kak-pokazano-nizhe\">2.5 \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0439\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\">public class OcrDetectorProcessor implements MLAnalyzer.MLTransactor&lt;MLText.Block> {     @Override     public void transactResult(MLAnalyzer.Result&lt;MLText.Block> results) {          SparseArray&lt;MLText.Block> items = results.getAnalyseList();          \/\/ Process the recognition result as required. Only the detection results are processed.         \/\/ Other detection-related APIs provided by ML Kit cannot be called.         \u2026     }     @Override     public void destroy() {         \/\/ Callback method used to release resources when the detection ends.     } }<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"26-ostanovite-analizator-i-osvobodite-resursy-raspoznavaniya-posle-zaversheniya-raspoznavaniya\">2.6 \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0438 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\">if (analyzer != null) {     try {         analyzer.stop();     } catch (IOException e) {         \/\/ Exception handling.     } } if (lensEngine != null) {     lensEngine.release(); }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"demo\">\u0414\u0435\u043c\u043e<\/h2>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0435! \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u0442\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0435 \u0447\u0435\u043a\u0438.<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lr\/8a\/zn\/lr8azn7ehmzjlgx_pvavxeewyrw.gif\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/lr\/8a\/zn\/lr8azn7ehmzjlgx_pvavxeewyrw.gif\"\/><\/div>\n<p>  <\/p>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u043e\u0442\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0438\u0434\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043a\u0438\u0434\u043a\u0443 \u043e\u043d\u043b\u0430\u0439\u043d \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u043b\u0430\u0442\u0435\u0436.<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7u\/yk\/gc\/7uykgcvn73kekxraq-uwef9_uws.gif\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/7u\/yk\/gc\/7uykgcvn73kekxraq-uwef9_uws.gif\"\/><\/div>\n<p>  <\/p>\n<h2 id=\"ishodnyy-kod-github\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Github<\/h2>\n<p>  <\/p>\n<p>\u2192 <a href=\"https:\/\/github.com\/HMS-Core\/hms-ml-demo\/tree\/master\/Receipt-Text-Recognition\" rel=\"nofollow\">Github<\/a><br \/>  \u2192 \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u043d\u0430\u0448 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442: <a href=\"https:\/\/developer.huawei.com\/consumer\/en\/hms\/huawei-mlkit\" rel=\"nofollow\">HUAWEI ML Kit \u2014 \u041e \u0441\u0435\u0440\u0432\u0438\u0441\u0435<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/519682\/\"> https:\/\/habr.com\/ru\/articles\/519682\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2 id=\"obschaya-informaciya\">\u041e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0412 <a href=\"https:\/\/forums.developer.huawei.com\/forumPortal\/en\/topicview?tid=0201256094474040234&amp;fid=0101187876626530001\" rel=\"nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439<\/a> \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 HUAWEI ML Kit \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043a\u0430\u0440\u0442. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u0441\u0432\u043e\u0435\u0439 \u043a\u0430\u0440\u0442\u044b, \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0432\u0441\u044e \u0432\u0430\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0432\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u043e\u0439 \u043a\u0430\u0440\u0442\u044b. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u043e \u0441\u0447\u0435\u0442\u0430\u043c\u0438 \u0438 \u0441\u043a\u0438\u0434\u043e\u0447\u043d\u044b\u043c\u0438 \u043a\u0443\u043f\u043e\u043d\u0430\u043c\u0438? \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0432\u0430\u043c, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 HUAWEI ML Kit \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0441\u0447\u0435\u0442\u043e\u0432 \u0438 \u0441\u043a\u0438\u0434\u043e\u0447\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432.<\/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-381791","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/381791","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=381791"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/381791\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=381791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=381791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=381791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}