Replies: 2 comments 1 reply
-
For performance and memory reasons, Version 6.0.0 and onward reduced the number of formats results are reported in by default. However, it still is easy to get results as an array of word objects (including // Run recognition with `blocks` (JavaScript object output) enabled
const ret = await worker.recognize(img, {}, { blocks: true });
// Array of words
const words = ret.data.blocks.map((block) => block.paragraphs.map((paragraph) => paragraph.lines.map((line) => line.words))).flat(3); |
Beta Was this translation helpful? Give feedback.
-
Hi, For me it also does not work even when I apply your suggested change, my 'blocks' remain of value null, while the 'text' value is true to the image that I have uploaded. I'm using React and when I try to OCR an image through:
The console.log returned looks like:
|
Beta Was this translation helpful? Give feedback.
-
I want to get the coordinates of a Matching word. I'm getting text with many thimgs but not "word" splited.
I would like to get the
bbox
I mean, the rectangle so I can properly decide where to click. The examples use theresults.words
, but minewords
is undefined. Not sure if its a setup problem.This is my code:
Beta Was this translation helpful? Give feedback.
All reactions