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.
18 lines
493 B
18 lines
493 B
#!/usr/bin/env node |
|
const path = require('path'); |
|
const Tesseract = require('../../'); |
|
|
|
const [,, imagePath] = process.argv; |
|
const image = path.resolve(__dirname, (imagePath || '../../tests/assets/images/cosmic.png')); |
|
|
|
console.log(`Recognizing ${image}`); |
|
|
|
Tesseract.recognize(image, 'eng', { logger: m => console.log(m) }) |
|
.then(({ text }) => { |
|
console.log(text); |
|
}); |
|
|
|
//Tesseract.detect(image, { logger: m => console.log(m) }) |
|
// .then((data) => { |
|
// console.log(data); |
|
// });
|
|
|