PHPackages                             smaller\_fan/b\_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. [Utility &amp; Helpers](/categories/utility)
4. /
5. smaller\_fan/b\_ocr

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

smaller\_fan/b\_ocr
===================

Baidu OCR by smallerfan

1.0.3(5y ago)116MITPHPPHP &gt;=5.3

Since Sep 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/smallerfan/baidu_ocr)[ Packagist](https://packagist.org/packages/smaller_fan/b_ocr)[ RSS](/packages/smaller-fan-b-ocr/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

laravel+baiduocr 百度文字识别
=======================

[](#laravelbaiduocr-百度文字识别)

描述
--

[](#描述)

基于百度sdk的图片文字识别，当前baidu sdk : aip-php-sdk-4.15.1

目前暂支持laravel 5.6+

Install
-------

[](#install)

1.安装插件

```
composer require smaller_fan/b_ocr ^1.0.2

```

2.在config/app.php文件内添加

```
'providers' => [
        SmallerFan\BaiduOcr\BaiduOcrServiceProvider::class,
    ],

'aliases' => [
        'BaiduOcr' => SmallerFan\BaiduOcr\BaiduOcrFacade::class,
    ],
```

3.生成配置文件

```
php artisan vendor:publish

生成之后会在项目 config 文件夹中出现 baiduocr.php 配置文件

将百度OCR里的配置信息填入【APP_ID，API_KEY，SECRET_KEY】

接下来就可以使用它啦~
```

使用范例：

```
// new 个对象 ~
$ocr = new BaiduOcr();
//这个方法基于百度提供的方法，网络图片文字识别接口
//【具体根据自己所需要的业务范围使用，参考路径:b_ocr/api-php-sdk/AipOcr.php】
$res = $ocr->webImageUrl('http://*****.jpg');
```

第一次封装包，欢迎ISSUES ,给个STAR吧~

你真好看！

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~38 days

Total

4

Last Release

1947d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/212d64e8cd71e06e526d18b8048e8b126eac6e7bfa81735ee542e0c25e1cf35c?d=identicon)[xiaofan](/maintainers/xiaofan)

---

Top Contributors

[![smallerfan](https://avatars.githubusercontent.com/u/26760368?v=4)](https://github.com/smallerfan "smallerfan (7 commits)")

---

Tags

ChineseOCRbaidu

### Embed Badge

![Health badge](/badges/smaller-fan-b-ocr/health.svg)

```
[![Health](https://phpackages.com/badges/smaller-fan-b-ocr/health.svg)](https://phpackages.com/packages/smaller-fan-b-ocr)
```

###  Alternatives

[overtrue/pinyin

Chinese to pinyin translator.

4.5k6.5M72](/packages/overtrue-pinyin)[thiagoalessio/tesseract_ocr

A wrapper to work with Tesseract OCR inside PHP.

3.0k3.3M24](/packages/thiagoalessio-tesseract-ocr)[zhuzhichao/ip-location-zh

get the ip's location info with Chinese

617212.5k11](/packages/zhuzhichao-ip-location-zh)[overtrue/chinese-calendar

中国农历转换与查询工具

557103.7k4](/packages/overtrue-chinese-calendar)[zhuzhichao/bank-card-info

Get the bank card info

45464.8k](/packages/zhuzhichao-bank-card-info)[douyasi/identity-card

Chinese Identity Card package

17851.4k3](/packages/douyasi-identity-card)

PHPackages © 2026

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