Skip to content

Instantly share code, notes, and snippets.

@bpteam
Last active August 29, 2015 14:22
Show Gist options
  • Save bpteam/653b1b0531a5bc46a6e4 to your computer and use it in GitHub Desktop.
Save bpteam/653b1b0531a5bc46a6e4 to your computer and use it in GitHub Desktop.
demo phpORC
<?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