承接 funnydevjsc/image-captcha-solver-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

funnydevjsc/image-captcha-solver-laravel

最新稳定版本:1.0.1

Composer 安装命令:

composer require funnydevjsc/image-captcha-solver-laravel

包简介

Laravel package for solving image captcha

README 文档

README

The free Laravel package to help you convert image captcha to text by OCR with Tesseract

Use Cases

  • Solve image text captcha by OCR from images with Tesseract

Features

  • Easy and free to solve image text captcha with a simple line code

Know issues

  • Please consider your server's environment before using this package. It doesn't have to be a physical server or support GPUs but at least you have to have the ability to install applications and run commands.

Requirements

  • PHP: 8.1 or higher
  • Laravel 9.0 or higher
  • Server with permissions to install applications and execute commands (like APT or YUM/DNF)

Quick Start

If you prefer to install this package into your own Laravel application, please follow the installation steps below

Installation

Step 1. Install a Laravel project if you don't have one already

https://laravel.com/docs/installation

Step 2. Install dependencies (If you use an operating system other than Ubuntu, please edit it accordingly):

apt install -y tesseract-ocr libtesseract-dev tesseract-ocr-all libmemcached-tools

Step 3. Require the current package using composer:

composer require funnydevjsc/image-captcha-solver-laravel

Testing

use Imagick;
use FunnyDev\ImageCaptchaSolver\ImageCaptchaSolverSdk;

class TestCaptchaSolver
{
    /**
     * Handle the event.
     * @throws \Exception
     */
    public function handle(): void
    {
        $instance = new ImageCaptchaSolverSdk();
        $image = 'base64-image-captcha-content-here';
        
        /* Set image data and sanity to make it more clear */
        $instance->setImage(base64image: $image);
        $instance->sanityImage();
        
        /* Convert image to black and white, remove unnecessary pixels. Be careful when customizing the `fuzz` value to ensure that you don't lose the stroke of the necessary character. */
        $instance->changeColorImage(fuzz: 33.0);
        
        /* Resize the image to make it easier to recognize and remove pixels inserted into the characters that need to be recognized that were not completely processed in the previous step. */
        $instance->resizeImage(width: 165, height: 50, filter: Imagick::FILTER_LANCZOS, blur: 1, best_fit: false);
        
        /*
        *   Regarding how to train the recognition library, it can be simplified as follows instead of interfering with tesseract:
        *   1. You can run $instance->ocr(...args) with limit 0 to return all the results that this library finds.
        *   2. With the character length of the found results, depending on the frequency, we will separate the characters that need to be replaced and put them into the corresponding table. For example, if the captcha is ABCDEF but the recognition is ABCDDDF, we have the replacement phrase ['DDD' => 'DE'] to add to $instance->moreCharactersDictionary. Similarly with $instance->lessCharactersDictionary and $instance->equalCharactersDictionary.
        *   3. Replace $instance->moreCharactersDictionary = your dictionary array before executing $instance->ocr(...args) for the next time.
        */
        
        /* Returns a set of recorded results, where the `limit` value is the number of characters in the captcha to be recognized. */
        $results = $instance->ocr(limit: 6, language: 'eng', dictionary: 'QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm123456789');
    }
}

Feedback

Respect us in the Laravel Việt Nam

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email contact@funnydev.vn or use the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

funnydevjsc/image-captcha-solver-laravel 适用场景与选型建议

funnydevjsc/image-captcha-solver-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 30 次下载、GitHub Stars 达 13, 最近一次更新时间为 2025 年 02 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「package」 「image」 「captcha」 「laravel」 「solver」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 funnydevjsc/image-captcha-solver-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 funnydevjsc/image-captcha-solver-laravel 我们能提供哪些服务?
定制开发 / 二次开发

基于 funnydevjsc/image-captcha-solver-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 13
  • Watchers: 0
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-24