Skip to content

Instantly share code, notes, and snippets.

@KostaMalsev
Created May 9, 2022 11:33
Show Gist options
  • Save KostaMalsev/84e18b72ae401e60f324afc1e803c2ea to your computer and use it in GitHub Desktop.
Save KostaMalsev/84e18b72ae401e60f324afc1e803c2ea to your computer and use it in GitHub Desktop.
async function detectTFMOBILE(imgToPredict) {
//Get next video frame:
//Perform OCR:
if (Analyzef)
{
c.getContext('2d').drawImage(canvas, click_pos.x, click_pos.y,
captureSize.w, captureSize.h, 0, 0, captureSize.w, captureSize.h);
let tempMark = MarkAreaSimple(mouse_pos.x - captureSize.w / 2, mouse_pos.y - captureSize.h / 2, captureSize.w, captureSize.h);
//Identify the digits using tesssaract:
let res = await Recognize(c);
tempMark.remove();
MarkArea(mouse_pos.x - captureSize.w / 2, mouse_pos.y - captureSize.h / 2, captureSize.w, captureSize.h, res);
Analyzef = false;
//We can use the number to dial using whatsapp:
/* if (res.length >= 10)
window.location.href = 'sms:' + res.replaceAll('-', '');
*/
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment