You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
816 B
29 lines
816 B
10 years ago
|
<canvas id="c"></canvas>
|
||
8 years ago
|
<script type="text/javascript" src="./build/tesseract.js"></script>
|
||
10 years ago
|
<script type="text/javascript">
|
||
|
var canvas = document.getElementById('c')
|
||
|
canvas.width = 400
|
||
|
canvas.height = 400
|
||
|
var ctx = canvas.getContext('2d');
|
||
|
ctx.font = '30px "Arial Black"'
|
||
|
ctx.fillText('Hell0 World', 100, 40)
|
||
|
// ctx.fillText("囚犯離奇掙脫囚犯離奇掙脫", 100, 40)
|
||
|
ctx.font = '30px "Times New Roman"'
|
||
|
ctx.fillText('from beyond', 100, 80)
|
||
|
// ctx.fillText('2小時可換乘2次2小時可換乘2次', 100, 80)
|
||
|
ctx.font = '30px sans-serif'
|
||
|
ctx.fillText('the Cosmic Void', 100, 120)
|
||
10 years ago
|
|
||
8 years ago
|
var tesseract = Tesseract();
|
||
|
|
||
|
tesseract.recognize(canvas, {
|
||
|
tessedit_char_blacklist: 'e'
|
||
|
})
|
||
|
.progress(function(e){
|
||
|
console.log('progress', e)
|
||
|
})
|
||
|
.then(function(e){
|
||
|
console.log('result', e)
|
||
|
})
|
||
10 years ago
|
|
||
10 years ago
|
</script>
|