<?php
/**
* Example, learn OCR to recognition letters
*
* @author Andrey Kucherenko <
[email protected]>
* @package phpOCR
*/
include_once("config.php");
include_once("OCR.class.php");
//make new OCR object
$char = new OCR();
//method draw letter & learn system
$char->Learn("a");
$char->saveResult();
$char->Learn("A");
$char->saveResult();
$char->Learn("b");
$char->saveResult();
$char->Learn("c");
$char->saveResult();
$char->Learn("d");
$char->saveResult();
$char->Learn("e");
$char->saveResult();
$char->Learn("f");
$char->saveResult();
$char->Learn("g");
$char->saveResult();
$char->Learn("h");
$char->saveResult();
$char->Learn("i");
$char->saveResult();
$char->Learn("j");
$char->saveResult();
$char->Learn("k");
$char->saveResult();
$char->Learn("l");
$char->saveResult();
$char->Learn("m");
$char->saveResult();
$char->Learn("n");
$char->saveResult();
$char->Learn("o");
$char->saveResult();
$char->Learn("p");
$char->saveResult();
$char->Learn("q");
$char->saveResult();
$char->Learn("r");
$char->saveResult();
$char->Learn("s");
$char->saveResult();
$char->Learn("t");
$char->saveResult();
$char->Learn("u");
$char->saveResult();
$char->Learn("v");
$char->saveResult();
$char->Learn("w");
$char->saveResult();
$char->Learn("x");
$char->saveResult();
$char->Learn("y");
$char->saveResult();
$char->Learn("z");
$char->saveResult();
$char->Learn("1");
$char->saveResult();
$char->Learn("2");
$char->saveResult();
$char->Learn("3");
$char->saveResult();
$char->Learn("4");
$char->saveResult();
$char->Learn("5");
$char->saveResult();
$char->Learn("6");
$char->saveResult();
$char->Learn("7");
$char->saveResult();
$char->Learn("8");
$char->saveResult();
$char->Learn("9");
$char->saveResult();
?><?php
/**
* Example, check images from file
*
* @author Andrey Kucherenko <
[email protected]>
* @package phpOCR
*/
include_once("config.php");
include_once("OCR.class.php");
//make new OCR object
$char = new OCR();
//Recognition process, check images from files
echo "<hr/><img src='numeros-1.jpg'/><br/>";
$res = $char->Recognition('numeros-1.jpg');
if ($res!==false){
echo "<b>".$res->getName()."</b>";
}else{
echo "Not yet recognised.<br/>";
}
?>