PHP Classes

How to Create a PHP Captcha Decoder with PHP OCR Class: Recognize text & objects in graphical images

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 56%Total: 35,304 This week: 1All time: 13 This week: 47Down
Version License PHP version Categories
phpocr 1.0.0Free for non-comm...3Algorithms, PHP 5, Graphics, Artifici...
Description 

Author

This is class can be used as a tool for optical character recognition.

It can recognize text in monochrome graphical images after a training phase. The training phase is necessary to let the class build recognition data structures from images that have known characters.

The training data structures are used during the recognition process to attempt to identify text in real images using the corner algorithm.

Innovation Award
PHP Programming Innovation award winner
February 2006
Winner


Prize: One copy of the Zend Studio
Certain types of applications require reading text from documents that are stored as graphical images. That is the case of scanned documents.

An OCR (Optical Character Recognition) tool can be used to recover the original text that is written in scanned documents. These are sophisticated tools that are trained to recognize text in graphical images.

This class provides a base implementation for an OCR tool. It can be trained to learn how to recognize each letter drawn in an image. Then it can be used to recognize longer texts in real documents.

Manuel Lemos
Picture of Andrey Kucherenko
Name: Andrey Kucherenko is available for providing paid consulting. Contact Andrey Kucherenko .
Classes: 1 package by
Country: Ukraine Ukraine
Age: 43
All time rank: 201 in Ukraine Ukraine
Week rank: 50 Down1 in Ukraine Ukraine Equal
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

Recommendations

Extract table text from images
I need to parse text from images and extract it into CSV file

What is the best PHP ocr class?
I read a TIFF document image to transform into an editable text

ocr
i need to read text from a php file

What is the best PHP extract text from image class?
Extract text from images with accuracy

What is the best PHP scanned image to text converter class?
Extract scanned image to text file conversion code

Decaptha OCR Class
Get the text in CAPTCHA images

Recognize text in images
We want a complete PHP ocr to embed in our application

Example

<?php
/**
 * Example, check images from file
 *
 * @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();

//Recognition process, check images from files
echo "<hr/><img src='M.png'/><br/>";
$res = $char->Recognition('M.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}

echo
"<hr/><img src='M1.png'/><br/>";
$res = $char->Recognition('M1.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}

echo
"<hr/><img src='z11.png'/><br/>";
$res = $char->Recognition('z11.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}

echo
"<hr/><img src='z1.png'/><br/>";
$res = $char->Recognition('z1.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}

echo
"<hr/><img src='Z.png'/><br/>";
$res = $char->Recognition('Z.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}

echo
"<hr/><img src='B.png'/><br/>";
$res = $char->Recognition('B.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}

echo
"<hr/><img src='B1.png'/><br/>";
$res = $char->Recognition('B1.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}

echo
"<hr/><img src='W.png'/><br/>";
$res = $char->Recognition('W.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}

echo
"<hr/><img src='W1.png'/><br/>";
$res = $char->Recognition('W1.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}


echo
"<hr/><img src='W2.png'/><br/>";
$res = $char->Recognition('W2.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}

echo
"<hr/><img src='plus1.png'/><br/>";
$res = $char->Recognition('plus1.png');
if (
$res!==false){
    echo
"<b>".$res->getName()."</b>";
}else{
    echo
"Not yet recognised.<br/>";
}


?>


Details

This folder must have right to read/write for php user.

  Files folder image Files (18)  
File Role Description
Files folder imagestorage (1 file)
Accessible without login Image file B.png Data B.png
Accessible without login Image file B1.png Data B1.png
Plain text file char.object.php Class char object
Accessible without login Plain text file config.php Conf. config
Accessible without login Plain text file example.php Example example
Accessible without login Plain text file example_1.php Example example #1
Accessible without login Image file M.png Data M.png
Accessible without login Image file M1.png Data Sample image
Plain text file OCR.class.php Class main phpOCR class
Accessible without login Image file plus.png Data plus.png
Accessible without login Image file plus1.png Data plus1.png
Accessible without login Image file W.png Data char data
Accessible without login Image file W1.png Data W1.png
Accessible without login Image file W2.png Data Negative example image
Accessible without login Image file Z.png Data Z.png
Accessible without login Image file z1.png Data z1.png
Accessible without login Image file z11.png Data z11.png

  Files folder image Files (18)  /  storage  
File Role Description
  Accessible without login Plain text file readme Data Storage description

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:35,304
This week:1
All time:13
This week:47Down
User Ratings User Comments (6)
 All time
Utility:81%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:-
Examples:69%StarStarStarStar
Tests:-
Videos:-
Overall:56%StarStarStar
Rank:1862
 
Thank you for this package.
1 month ago (First)
55%StarStarStar
Extremely old and forgotten package, don't bother
7 years ago (Microservice)
35%StarStar
It's don't works ;(.
7 years ago (Tsumiki)
15%Star
Could you please add Example about Reading some text from a S...
9 years ago (Tariqul Islam)
65%StarStarStarStar
This site needs more unique stuff like this class.
16 years ago (Alexander Skakunov)
70%StarStarStarStar
hmmm nice one.
16 years ago (Adnan Haider)
50%StarStarStar