Created
May 9, 2022 11:33
-
-
Save KostaMalsev/84e18b72ae401e60f324afc1e803c2ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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