We have the requirement to be able to do offline OCR. I have tried tesseract.js but could not get it to work with a image blob
import { createWorker } from 'tesseract.js';
function onPhotoChange(currentBlob, oldBlob, newBlob) {
// photo is null when the photo is deleted on the capture-photo control
if (currentBlob) {
(async () => {
try {
const worker = await createWorker('eng');
const ret = await worker.recognize(currentBlob.);
console.log(ret.data.text);
view.image_text = ret.data.text;
await worker.terminate();
} catch (error) {
console.error('Text recognition failed:', error);
view.image_text = 'Error: Failed to recognize text';
}
})();
}
}