定制 hossamsoliuman/laravel-ocr 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hossamsoliuman/laravel-ocr

最新稳定版本:1.0.0

Composer 安装命令:

composer require hossamsoliuman/laravel-ocr

包简介

Optimal character recognition with Laravel

README 文档

README

Packagist Version Packagist Downloads License

The Laravel OCR package provides optimal character recognition capabilities in Laravel applications. It integrates with Tesseract OCR and offers features such as offline OCR, language selection, and more.

Table of Contents

Package Dependencies

This package depends on Tesseract OCR. Before using the Laravel OCR package, you must install Tesseract OCR on your server. You can find installation instructions for various operating systems on the Tesseract OCR Page https://github.com/tesseract-ocr/tesseract.

Installation

Software Installation

For Windows users, we provide installation guidance in the screenshot. Please clich the https://github.com/tesseract-ocr to install Tesseract OCR on your Windows machine.

Windows Installation Guide

For general users and not windows specifically, you can visit https://tesseract-ocr.github.io/tessdoc/Installation.html

Package Installation

To install the Laravel OCR package, you can use Composer:

composer require hossamsoliuman/laravel-ocr

Usage

Routes and Controllers

Routes

This package provides routes and controllers for OCR processing. You can access the OCR functionality via the following routes:

  • POST /api/offline-ocr/image: Perform offline OCR on an image.

    • Accepts image (image file) and lang (language selection) parameters.
    • Optional user_words parameter for user-specific words (see User Words).
  • GET /languages: Retrieve a list of available languages for OCR.

Make sure to include these routes in your Laravel application as needed. You can also customize the routes and controllers to fit your application's requirements.

Available Languages

You can select the language(s) for OCR processing using the lang parameter when making requests. By default, English (eng) is used. You can specify multiple languages as a comma-separated list, e.g., eng,ara.

To retrieve a list of available languages, you can access the /languages route.

User Words

You can provide a user-specific words file to improve OCR accuracy when dealing with technical terminology or jargon. To use user words, include the user_words parameter when making OCR requests, and provide a text file containing the desired words.

Example usage:

curl -X POST -F "image=@image.png" -F "user_words=@user-words.txt" http://your-app.com/offline-ocr/image

Current and Upcoming Features

Here's a table detailing the current and upcoming features of the Laravel OCR package:

Feature Status
Offline OCR ✅ Available
Language Selection ✅ Available
User Words ✅ Available
Download Language Support ⏳ Upcoming
PDF Support ⏳ Upcoming
Google vision Support ⏳ Upcoming
More Features ⏳ Upcoming

Contributing

Contributions are welcome! We appreciate your interest in improving this package. To get started with contributing, please read our contribution guidelines. Your contributions can help make this package even better.

License

This package is open-source software licensed under the MIT License. You are free to use, modify, and distribute this software in accordance with the terms of the MIT License. See the LICENSE file for more details.

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-19