Created
June 14, 2019 11:55
-
-
Save jgalazm/356199b69e2e7f101ccd4d5510df8560 to your computer and use it in GitHub Desktop.
tesseract-demo
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
<body> | |
<script src='https://unpkg.com/tesseract.js@v2.0.0-alpha.10/dist/tesseract.min.js'></script> | |
<script> | |
const { TesseractWorker } = Tesseract; | |
const worker = new TesseractWorker(); | |
const imgUrl = './tes.jpg'; | |
const img =new Image(512,512); | |
img.src = imgUrl; | |
document.body.appendChild(img); | |
worker | |
.recognize(imgUrl) | |
.progress((p) => { | |
console.log('progress', p); | |
}) | |
.then(({ text }) => { | |
const p = document.createElement('p'); | |
p.innerText = text; | |
document.body.appendChild(p); | |
console.log(text); | |
worker.terminate(); | |
}); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/9480013/image-processing-to-improve-tesseract-ocr-accuracy