ocr update

This commit is contained in:
LukasNowy
2019-01-28 17:32:07 +01:00
parent 1579c199c3
commit c8fe9b045a
3 changed files with 58 additions and 28 deletions

View File

@ -28,7 +28,7 @@ function movePurchases() {
firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
$.ajax({
type: "POST",
url: "/donepurchases",
url: "/dones",
data:{
idtoken: idtoken,
sl_id: "BplQ5lFU",
@ -47,11 +47,38 @@ function movePurchases() {
$(".test").click(function() {
movePurchases();
});
function analyzeUploaded() {
var img = document.getElementById("blah");
Tesseract.recognize(img).progress((progress) => {
if (progress.status == "recognizing text") {
loading = true;
}
}).then((result) => {
loading = false;
$(".output").text(result.text);
$('#modal1').modal("open");
movePurchases();
$(".determinate").css("width", "0%");
});
}
setInterval(updateProgress(), 500);
function updateProgress(percent) {
if(loading == true) {
$(".determinate").css("width", progress.progress * 100 + "%");
}
}
});
var loading = false;
function analyze() {
/*function analyze() {
var img = document.getElementById("canvas").toDataURL();
Tesseract.recognize(img).progress((progress) => {
@ -67,29 +94,4 @@ function analyze() {
$(".determinate").css("width", "0%");
});
}
function analyzeUploaded() {
var img = document.getElementById("blah");
Tesseract.recognize(img).progress((progress) => {
if (progress.status == "recognizing text") {
loading = true;
}
}).then((result) => {
loading = false;
$(".output").text(result.text);
$('#modal1').modal("open");
$(".determinate").css("width", "0%");
});
}
setInterval(updateProgress(), 500);
function updateProgress(percent) {
if(loading == true) {
$(".determinate").css("width", progress.progress * 100 + "%");
}
}
*/