21/02
2017
A wrapper to work with Seven Segment OCR for PHP.
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., (*1)
You first need to make sure you have installed OCR library for seven segment number SSOCR by auerswal., (*2)
To use this library,, (*3)
$ composer require aanred/ssocr-for-php
Basic Usages,, (*4)
$ssocr = new SSOCR('img.png'); echo $ssocr->run();
Examples,, (*5)
Monochrome image (004200_mono.png), (*6)
, (*7)
$ssocr = new SSOCR('004200_mono.png'); echo $ssocr->run(); // Result // 004200
Coloured image (004200.png), (*8)
, (*9)
$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), (*10)
, (*11)
$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