27 lines
678 B
JavaScript
27 lines
678 B
JavaScript
$(document).ready(function() {
|
|
|
|
//initialize all modals
|
|
$('.modal').modal();
|
|
|
|
$(".btnanalyze").click(function() {
|
|
analyze();
|
|
});
|
|
});
|
|
|
|
function analyze() {
|
|
var img = document.getElementById("canvas").toDataURL();
|
|
|
|
Tesseract.recognize(img).progress((progress) => {
|
|
console.log(progress, "$$$$");
|
|
|
|
if (progress.status == "recognizing text") {
|
|
$(".determinate").css("width", progress.progress * 100 + "%");
|
|
}
|
|
}).then((result) => {
|
|
console.log(result);
|
|
$(".output").text(result.text);
|
|
$('.modal').modal("open");
|
|
|
|
$(".determinate").css("width", "0%");
|
|
});
|
|
} |