Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrey Kucherenko  >  phpOCR  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: phpOCR
Recognize text & objects in graphical images
Author: By
Last change: Learning from image file suported, example added
Date: 8 years ago
Size: 1,198 bytes
 

Contents

Class file image Download
<?php
/**
 * Example, learn OCR to recognition letters
 *
 * @author Andrey Kucherenko <kucherenko.andrey@gmail.com>
 * @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("W");
//save sarialized object to file
$char->saveResult();
echo 
'Save information about "W"<br>';


//method draw letter & learn system
$char->Learn("z");
//save sarialized object to file
$char->saveResult();
echo 
'Save information about "z"<br>';

//method draw letter & learn system
$char->Learn("Z");
//save sarialized object to file
$char->saveResult();
echo 
'Save information about "Z"<br>';

//method draw letter & learn system
$char->Learn("M");
//save sarialized object to file
$char->saveResult();
echo 
'Save information about "M"<br>';

//method draw letter & learn system
$char->Learn("B");
//save sarialized object to file
$char->saveResult();
echo 
'Save information about "B"<br>';

//learn system to understand symbol "plus"
$char->LearnFromImage("plus.png","plus");
//save sarialized object to file
$char->saveResult();
echo 
'Save information about "plus"<br/><img src="plus.png"/>';




?>