@Fox ну вот счётчик яши развлекается со шрифтами, покушаясь на мою анонимность. Хотелось бы разобраться с этим топорно, заменить "что надо" и всё...
wg = "monospace;sans-serif;serif;Andale Mono;Arial;Arial Black;Arial Hebrew;Arial MT;Arial Narrow;Arial Rounded MT Bold;Arial Unicode MS;Bitstream Vera Sans Mono;Book Antiqua;Bookman Old Style;Calibri;Cambria;Cambria Math;Century;Century Gothic;Century Schoolbook;Comic Sans;Comic Sans MS;Consolas;Courier;Courier New;Garamond;Geneva;Georgia;Helvetica;Helvetica Neue;Impact;Lucida Bright;Lucida Calligraphy;Lucida Console;Lucida Fax;LUCIDA GRANDE;Lucida Handwriting;Lucida Sans;Lucida Sans Typewriter;Lucida Sans Unicode;Microsoft Sans Serif;Monaco;Monotype Corsiva;MS Gothic;MS Outlook;MS PGothic;MS Reference Sans Serif;MS Sans Serif;MS Serif;MYRIAD;MYRIAD PRO;Palatino;Palatino Linotype;Segoe Print;Segoe Script;Segoe UI;Segoe UI Light;Segoe UI Semibold;Segoe UI Symbol;Tahoma;Times;Times New Roman;Times New Roman PS;Trebuchet MS;Verdana;Wingdings;Wingdings 2;Wingdings 3".split(";"), wk = v(function(a) { a = cb(a)("canvas"); var c = n(a, "getContext"); if (!c) return null; try { var b = B(c, a)("2d"); b.font = "72px mmmmmmmmmmlli"; var d = b.measureText("mmmmmmmmmmlli").width; return function(e) { b.font = "72px " + e; return b.measureText("mmmmmmmmmmlli").width === d } } catch (e) { return null } }),Node.js подключение модуля OCR.
-
Добрый день.
Кто-нибудь работал с OCR, а именно распознание текста с картинки формата png (нужно распознать тест).
Пытался подключить к Node.js модули «ng-ocr» и «n-ocr» не могу понять, как подтянуть зависимости для работы с файлами png.var Ngocr = require("Ngocr"); var fs = require("fs"); var stream = fs.createReadStream("test/fixture/hello_world.png"); Ngocr.decodeStream(stream, function(error, data){ console.log(data); // Hello World! });Вопрос в том, что при подключении не подтягивает нужные библиотеки.
Если кто сталкивался с такой проблемой и как решил, какой библиотекой пользовался c npmjs.comЗаранее благодарен за любую помощь.
-
Да тоже думал об этом, но хочется не зависимую систему без привязки к сайтам.
Если собирать на другой платформе:
$ npm install n-ocr -SВсе работает так как собирает все нужные библиотеки:
сolo
commander
ocrad.js
pngjs
simple-bufferstreamПытался подключить все библиотеки вручную, не работает библиотека: ocrad.js мануала нет.
В видео уроке на ютубе: BrowserAutomationStudio "Встроенные языки, node.js, npm." все классно, ну нет пояснений как работать с зависимыми библиотеками.
(ХЗ). -
@stevenr2214 said in Node.js подключение модуля OCR.:
@Fox could you explain how we could go about this please
In 2018, I used a website that allowed me to upload an image to it and recognize it for free. I repeated browser requests in the BAS http client and solved the text for free. But more than six years have passed, that site has not been working for a long time, now you can find other ways to recognize the text.