PHPackages                             baraveli/bml-ocr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. baraveli/bml-ocr

ActiveLibrary

baraveli/bml-ocr
================

v0.3(5y ago)527MITPHP

Since Aug 6Pushed 5y agoCompare

[ Source](https://github.com/baraveli/bml-ocr)[ Packagist](https://packagist.org/packages/baraveli/bml-ocr)[ RSS](/packages/baraveli-bml-ocr/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (4)Versions (8)Used By (0)

BML OCR:camera: (Experimental)
==============================

[](#bml-ocrcamera-experimental)

[![StyleCI](https://camo.githubusercontent.com/39cdef71b8d2ae2177e630c102aee4a5206a81c8fa01d33039c59e387cf1645f/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3238353434323038302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/285442080?branch=master)[![Build Status](https://camo.githubusercontent.com/1b026c8d8503bc6dd8c4f886498efda215d3fe2e8255bf65057f5f8c95b46643/68747470733a2f2f7472617669732d63692e6f72672f6261726176656c692f626d6c2d6f63722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/baraveli/bml-ocr)

BML Transaction Receipt OCR based on Tesseract OCR. At the moment this returns the result as an array. We will be switching to an Receipt object with regex matching for a later release.

Would not recommend to use in production.

Installation
------------

[](#installation)

Via [Composer](http://getcomposer.org/):

```
composer require baraveli/bml-ocr

```

‼️ **This library depends on [Tesseract OCR](https://github.com/tesseract-ocr/tesseract), version *3.02* or later.**

### Note for Linux users

[](#note-for-linux-users)

It is pretty simple to install tesseract, run the following commands:

```
sudo apt install tesseract-ocr

```

If the default installation doesn't include english language pack. You have to pull that one seperately, run the following command:

```
sudo apt-get install tesseract-ocr-eng

```

### [![](https://camo.githubusercontent.com/02979a56ab84a0cc36fef243c1d8e4754dca7192cfb80268601339eab161ac01/68747470733a2f2f74686961676f616c657373696f2e6769746875622e696f2f7465737365726163742d6f63722d666f722d7068702f696d616765732f77696e646f77732d31382e737667)](https://camo.githubusercontent.com/02979a56ab84a0cc36fef243c1d8e4754dca7192cfb80268601339eab161ac01/68747470733a2f2f74686961676f616c657373696f2e6769746875622e696f2f7465737365726163742d6f63722d666f722d7068702f696d616765732f77696e646f77732d31382e737667) Note for Windows users

[](#-note-for-windows-users)

There are [many ways](https://github.com/tesseract-ocr/tesseract/wiki#windows) to install [Tesseract OCR](https://github.com/tesseract-ocr/tesseract) on your system, but if you just want something quick to get up and running, I recommend installing the [Capture2Text](https://chocolatey.org/packages/capture2text) package with [Chocolatey](https://chocolatey.org).

```
choco install capture2text --version 3.9

```

⚠️ Recent versions of [Capture2Text](https://chocolatey.org/packages/capture2text) stopped shipping the `tesseract` binary.

### [![](https://camo.githubusercontent.com/e47a2447dd05578dc5203d4197928f309f60621a17d6cca7b37468e52b99043a/68747470733a2f2f74686961676f616c657373696f2e6769746875622e696f2f7465737365726163742d6f63722d666f722d7068702f696d616765732f6170706c652d31382e737667)](https://camo.githubusercontent.com/e47a2447dd05578dc5203d4197928f309f60621a17d6cca7b37468e52b99043a/68747470733a2f2f74686961676f616c657373696f2e6769746875622e696f2f7465737365726163742d6f63722d666f722d7068702f696d616765732f6170706c652d31382e737667) Note for macOS users

[](#-note-for-macos-users)

With [MacPorts](https://www.macports.org) you can install support for individual languages, like so:

```
$ sudo port install tesseract-

```

But that is not possible with [Homebrew](https://brew.sh). It comes only with **English** support by default, so if you intend to use it for other language, the quickest solution is to install them all:

```
$ brew install tesseract --with-all-languages

```

Usage
-----

[](#usage)

```
use Baraveli\BmlOcr\BmlOcr;

BmlOcr::make("/home/image/imagename.jpg", __DIR__)
        ->detect();
```

The first argument of the make method is the path to the receipt you want to do OCR on. and the second argument is the temporary directory path. When the image path is first given it creates a temporary image with higher sharpness because the original BML receipt uses grey color for typography. It is really hard to detect by using just the default image. It deletes after finishing the detection.

When you call the detect method it will return the result as an array.

```
$receipt = BmlOcr::make("/home/image/imagename.jpg", __DIR__)
        ->detect();

var_dump($receipt);
```

Result:

```
array:9 [
  0 => "Transaction Receipt"
  1 => "Status SUCCESS"
  2 => "Message Transfer transaction is successful."
  3 => "Ref # BLAZ418696504822"
  4 => "Date 30/07/2020 21:46"
  5 => "From SHIHAM A.RAHMAN"
  6 => "To Mohamed Jinas"
  7 => "7730000151614"
  8 => "Amount MVR 750"
]

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2109d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf0464cf5ff5afa87f8940e92f2e9974200ef0939a3cd1a922bc3b5793850a06?d=identicon)[jinas123](/maintainers/jinas123)

---

Tags

bmlocrtesseract-ocr

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/baraveli-bml-ocr/health.svg)

```
[![Health](https://phpackages.com/badges/baraveli-bml-ocr/health.svg)](https://phpackages.com/packages/baraveli-bml-ocr)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[laravolt/avatar

Turn name, email, and any other string into initial-based avatar or gravatar.

2.0k5.4M31](/packages/laravolt-avatar)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[aimeos/aimeos-core

Full-featured e-commerce components for high performance online shops

4.5k346.9k48](/packages/aimeos-aimeos-core)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
