Last active
August 29, 2015 14:22
-
-
Save bpteam/653b1b0531a5bc46a6e4 to your computer and use it in GitHub Desktop.
demo phpORC
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
<?php | |
require_once __DIR__ . '/bootstrap.php'; | |
use bpteam\phpOCR\Recognizer; | |
use bpteam\phpOCR\Img; | |
$file_name = __DIR__ . '/template/test_img/olx1.png'; | |
$ex = 'png'; | |
Recognizer::setInfelicity(10); | |
$img = Recognizer::openImg($file_name); | |
//Source image | |
echo "<br>Step 0 src img<br>"; | |
Img::show($img,$ex,100); | |
//load template | |
$name = 'olx'; | |
Recognizer::setTemplateDir(__DIR__ . '/template/'); | |
$template = Recognizer::loadTemplate($name); | |
// OCR | |
echo "<br>defineImg<br>"; | |
$text = Recognizer::read($file_name, $template); | |
echo $text."<br>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment