louissu/ssocr-php

ssocr-php is a package which implement ssocr with pure php

v1.0.0 2021-09-18 16:37 UTC

This package is auto-updated.

Last update: 2024-04-17 07:02:49 UTC


README

A package implements ssocr with pure php.

Requirement

  • Imagick extension

Installation

Make sure you have installed Imagick extension, and run the command below and you will get the latest version:

composer require louissu/ssocr-php

Document

setThreshold

This function sets Threshold for binarization, the value is between 0 to 1. If the result of recognizing is not satisfactory, you can adjust this value.

setScale

This function sets the scale parameter of resize, the value means the denominator of width and height. For example, the below example means the width and height of 87.png will divide by 2.

If your image is too large to make it slow, you can adjust this value.

Example

<?php
require "vendor/autoload.php";

use Louissu\Main\SSOCR;

$ssocr  = new SSOCR('87.png');
$result = $ssocr
    ->setThreshold(0.1)
    ->setScale(2)
    ->run();

echo $result;

More

I write the reason why I do this project and some explanations of code in my blog article. You can visit if you are interested it!