Оригинальная не рабочая часть кода
doRecognize(args): void {
let img: ImageSource = new ImageSource();
img.fromAsset(args.imagenEnAsset);
args.ocr.retrieveText({
image: img,
whitelist: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<",
blacklist: "/Ñ,",
onProgress: (percentage: number) => {
console.log(`Decoding progress: ${percentage}%`);
}
})
Теперь рабочая часть кода
doRecognize(args): void {
let img: ImageSource = new ImageSource();
img.fromAsset(args.imagenEnAsset)
.then(
(imageSource) => {
if (imageSource) {
args.ocr.retrieveText({
image: imageSource,
whitelist: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<",
blacklist: "/Ñ,",
onProgress: (percentage: number) => {
console.log(`Decoding progress: ${percentage}%`);
}
})