You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tesseract.js version (version number for npm/GitHub release, or specific commit for repo)
5.1.0
Describe the bug
I have processed an image to monochromatic black and white with no noise. I then tell tesseract.js to OCR the top half. Tesseract.js OCRs the bottom half, and interprets blocks of pure white as tildes
Please attach any input image required to replicate this behavior.
Expected behavior
I expect this run on the attached image to result in "WWWWWWWWWW", or at least "Mark", not "~~ Mark"
Hopefully I'm doing something wrong and this is not actually a bug?
Device Version:
Windows 10
Node 18.19.0
Additional context
Add any other
context about the problem here.
The text was updated successfully, but these errors were encountered:
@markschwartzkopf I believe this is a quirk inherited from the main Tesseract program--you need to subtract 1 from the image width when specifying the rectangle. In this case, if you set width to 349 rather than 350 your image is recognized correctly.
Tesseract.js version (version number for npm/GitHub release, or specific commit for repo)
5.1.0
Describe the bug
I have processed an image to monochromatic black and white with no noise. I then tell tesseract.js to OCR the top half. Tesseract.js OCRs the bottom half, and interprets blocks of pure white as tildes
To Reproduce
Steps to reproduce the behavior:
(async () => {
const worker = await createWorker('eng', 1, {
/* logger: (m) => nodecg.log.info(m) */
});
worker
.recognize(__dirname + '/OBS.png', { rectangle: { top: 0, left: 0, width: 350, height: 39 } })
.then((result) => {
fs.writeFileSync(__dirname + '/ocr.json', JSON.stringify(result));
console.log(result.data.text);
console.log('Confidence: ' + result.data.confidence);
});
})();
Please attach any input image required to replicate this behavior.
Expected behavior
I expect this run on the attached image to result in "WWWWWWWWWW", or at least "Mark", not "~~ Mark"
Hopefully I'm doing something wrong and this is not actually a bug?
Device Version:
Additional context
Add any other
context about the problem here.
The text was updated successfully, but these errors were encountered: