aanred / ssocr-for-php
There is no license information available for the latest version (dev-master) of this package.
A wrapper to work with Seven Segment OCR for PHP.
dev-master
2017-02-21 03:02 UTC
Requires
- php: >=5.6.0
This package is not auto-updated.
Last update: 2025-04-26 23:52:23 UTC
README
A wrapper to work with Seven Segment OCR for PHP. This wrapper is adoption from the one built for Tesseract OCR Tesseract OCR for PHP.
Installation
You first need to make sure you have installed OCR library for seven segment number SSOCR by auerswal.
To use this library,
$ composer require aanred/ssocr-for-php
Quick Start and Examples
Basic Usages,
$ssocr = new SSOCR('img.png'); echo $ssocr->run();
Examples,
Monochrome image (004200_mono.png)
$ssocr = new SSOCR('004200_mono.png'); echo $ssocr->run(); // Result // 004200
Coloured image (004200.png)
$ssocr = new SSOCR('004200.png'); // use iterative thresholding $ssocr->iterativeThreshold(); // we need to crop the image so the tiny dot on the right bottom corner is not processed $ssocr->crop(0, 0, 598, 172); echo $ssocr->run(); // Result // 004200
Manual threshold (inside_box.png)
$ssocr = new SSOCR('inside_box.png'); // use manual thresholding $ssocr->threshold(20); // we need to crop the image to take only the boxed numbers $ssocr->crop(230, 195, 220, 60); echo $ssocr->run(); // Result // 086861