docs: 添加项目 README,说明愿景与目标
大石头 authored at 2026-12-02 00:23:01
21.97 KiB
NewLife.Vision
# NewLife.Vision - .NET 視覚理解ライブラリ ![GitHub top language](https://img.shields.io/github/languages/top/newlifex/NewLife.Vision?logo=github) ![GitHub License](https://img.shields.io/github/license/NewLifeX/NewLife.Vision?logo=github) ![NuGet Downloads](https://img.shields.io/nuget/dt/NewLife.Vision?logo=nuget) ![NuGet](https://img.shields.io/nuget/v/NewLife.Vision?logo=nuget) ![NuGet prerelease](https://img.shields.io/nuget/vpre/NewLife.Vision?label=dev%20nuget&logo=nuget) [![test](https://github.com/NewLifeX/NewLife.Vision/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/NewLifeX/NewLife.Vision/actions/workflows/test.yml) ![locales](https://img.shields.io/badge/locales-11-2ea44f?logo=dotnet) ![platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-blue) ![arch](https://img.shields.io/badge/arch-x64%20%7C%20arm64-orange) [![contributors](https://img.shields.io/github/contributors/NewLifeX/NewLife.Vision?logo=github)](https://github.com/NewLifeX/NewLife.Vision/graphs/contributors) <!-- lang:start --> 🌐 [English](/NewLife/NewLife.Vision/Blob/master/README.md) | [简体中文](/NewLife/NewLife.Vision/Blob/master/README.zh-CN.md) | [繁體中文](/NewLife/NewLife.Vision/Blob/master/README.zh-TW.md) | [Español](/NewLife/NewLife.Vision/Blob/master/README.es.md) | [Deutsch](/NewLife/NewLife.Vision/Blob/master/README.de.md) | [Français](/NewLife/NewLife.Vision/Blob/master/README.fr.md) | [Português](/NewLife/NewLife.Vision/Blob/master/README.pt.md) | [Русский](/NewLife/NewLife.Vision/Blob/master/README.ru.md) | [한국어](/NewLife/NewLife.Vision/Blob/master/README.ko.md) | [العربية](/NewLife/NewLife.Vision/Blob/master/README.ar.md) <!-- lang:end --> ピクセルを、検索・活用できるテキスト、バーコード、物体、顔の情報に変換します.エンジンは交換可能です. ソース: https://github.com/NewLifeX/NewLife.Vision NuGet: `NewLife.Vision` ## クイックスタート 組み込みの純マネージドリーダーでバーコードをデコードします: ```bash dotnet add package NewLife.Vision ``` ```csharp using NewLife.Imaging.Codecs; using NewLife.Vision; using NewLife.Vision.Barcode; var image = ImageCodecs.Decode(File.ReadAllBytes("qr.png")).ToVisionImage(); var results = new BarcodePipeline(new ManagedBarcodeReader()).Read(image); Console.WriteLine(results[0].Text); ``` 組み込みのピュアマネージド型テンプレート認識器でテキストを認識します: ```bash dotnet add package NewLife.Vision ``` ```csharp using NewLife.Imaging.Codecs; using NewLife.Vision; using NewLife.Vision.Ocr; var recognizer = new TemplateOcrRecognizer(); var pipeline = new OcrPipeline(recognizer); var image = ImageCodecs.Decode(File.ReadAllBytes("label.png")).ToVisionImage(); var result = await pipeline.RecognizeAsync(image); Console.WriteLine(result.Text); ``` Targets `netstandard2.0`, `netstandard2.1`, `net461`, `net8.0`, `net10.0` and `net11.0`. ## 機能 <details> <summary><b>前処理と幾何補正</b> (6 項目)</summary> | Capability | What it gives you | | --- | --- | | ステップ契約 | `IImagePreprocessor` で無状態ステップを順に合成し、並列実行できます | | 基本ステップ | グレースケール、Otsu 二値化、コントラスト伸長、拡大縮小、ROI 切り出し(NewLife.Imaging の演算を利用) | | 傾き補正 | 投影プロファイルで角度を推定して回転し、推定角度を返します | | 射影補正 | 四点の単応変換と双線形サンプリング。出力サイズは任意 | | プリセット | `PreprocessPipeline.CreateOcr()` と `CreateBarcode()` ですぐ使えます | | キャリブレーション | `CameraCalibrator` が平面ターゲットから内部パラメータと半径方向の歪みを推定し、`ImageUndistorter` が画像を補正 | </details> <details> <summary><b>テキスト認識</b> (5 items)</summary> | 機能 | 提供する価値 | | --- | --- | | Engine contract | `ITextRecognizer` with a single async entry point and cancellation support | | 組み込みテンプレート OCR | ピュアマネージドのテンプレート照合。モデルファイルは不要です | | OCR pipeline | Score filtering, region sorting and line-aware text merging on top of any engine | | Region model | Text, confidence, bounding box and tilt angle for every detected line | | 穏やかな縮退 | 認識できない場合は例外ではなく空の結果とスコアを返します | </details> <details> <summary><b>バーコード</b> (4 items)</summary> | 機能 | 提供する価値 | | --- | --- | | Engine contract | `IBarcodeReader` returns text, format and bounding box per result | | 組み込みリーダー | サードパーティ製パッケージなしで QR、Code128、Code39、Code93、EAN-13、EAN-8、UPC-A を純マネージドでデコード | | バーコード pipeline | Duplicate removal by content and format, plus `MaxResults` truncation | | Format selection | Restrict decoding to the codes you expect to cut latency on busy images | </details> <details> <summary><b>検出と顔認識</b> (4 項目)</summary> | 機能 | 提供する価値 | | --- | --- | | 検出契約 | `IObjectDetector` が矩形・クラス・スコアを返し、`DetectionPipeline` がスコア/クラス絞り込みとクラス別 NMS を行います | | 検出 NMS | `IntersectionOverUnion` を公開し再利用可能。結果は `MaxResults` で打ち切ります | | セッション駆動モデル | `IModelSession` で任意のバックエンドを接続。YOLO/顔のデコード、セグメンテーションとポーズの後処理、1:1 顔照合と純マネージド ONNX サブセット実行を内蔵 | | クラウド OCR | `ChatVisionRecognizer` は任意の OpenAI 互換エンドポイントを呼び出し、追加クライアント依存なし | | 顔契約 | `IFaceDetector` と `IFaceMatcher`。特徴量は結果モデルに入れません | | 顔パイプライン | スコアと生体判定による絞り込み、重複除去、打ち切り。モデルは自研の推論スタックとともに提供します | </details> <details> <summary><b>フレームとピクセルモデル</b> (3 items)</summary> | 機能 | 提供する価値 | | --- | --- | | Vision image | `VisionImage` wraps any buffer with offset, stride and five packed pixel formats | | Imaging interop | `ImageFrame` と `VisionImage` はコアパッケージ内で双方向に変換できます | | Zero-copy views | Row and pixel spans expose the underlying buffer without copies | </details> ## エコシステムマップ NewLife は、独立したバージョン管理を行うオープンソースプロジェクトの階層型エコシステムです。以下のマップはすべての NewLife リポジトリで逐語的に同一の内容を共有しており、各プロジェクトはコードリポジトリと主要な NuGet パッケージにリンクしています。 | プロジェクト | 概要 | ダウンロード数 | | --- | --- | --- | | **基盤** | | | | [NewLife.Core](https://github.com/NewLifeX/X) | ログ、構成、キャッシュ、ネットワーク、シリアライズ、スケジューリング、APM トレーシング。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Core?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Core) | | [NewLife.XCode](https://github.com/NewLifeX/NewLife.XCode) | データミドルウェア:単一テーブルで数百億件級、自動シャーディング、読み書き分離、10 種類以上のデータベースに対応。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.XCode?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.XCode) | | [NewLife.Net](https://github.com/NewLifeX/NewLife.Net) | 高性能ネットワークライブラリ:単一マシンで 177 万 pps、14.5 Gbps(TCP 1KB、2026-10 実測)、400 万 Tcp 長接続。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Net?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Net) | | [NewLife.Remoting](https://github.com/NewLifeX/NewLife.Remoting) | CS アプリケーションと IoT デバイス向けのプロトコル通信と RPC フレームワーク。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Remoting?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Remoting) | | [NewLife.Agent](https://github.com/NewLifeX/NewLife.Agent) | .NET アプリケーションを OS デーモンとしてインストール:Windows サービスと Linux systemd。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Agent?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Agent) | | [NewLife.Templates](https://github.com/NewLifeX/NewLife.Zero) | コンソール、Web、API、サービス、データ、IoT 向けの `dotnet new` プロジェクトテンプレート。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Templates?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Templates) | | **データとメッセージング** | | | | [NewLife.Redis](https://github.com/NewLifeX/NewLife.Redis) | マイクロ秒級の遅延、数百万 ops/s のスループット、メッセージキュー内蔵の Redis クライアント。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Redis?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Redis) | | [NewLife.RocketMQ](https://github.com/NewLifeX/NewLife.RocketMQ) | Apache RocketMQ と Alibaba Cloud Message Queue に対応した純マネージド RocketMQ クライアント。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.RocketMQ?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.RocketMQ) | | [NewLife.MQTT](https://github.com/NewLifeX/NewLife.MQTT) | MQTT クライアントとサーバー。Alibaba Cloud IoT への接続を含みます。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.MQTT?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.MQTT) | | [NewLife.NovaDb](https://github.com/NewLifeX/NewLife.NovaDb) | C# 製ハイブリッドデータベース:組み込み/ネットワークの両モード、リレーショナル、時系列、メッセージキュー、KV を 1 つに。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.NovaDb?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.NovaDb) | | [NewLife.MySql](https://github.com/NewLifeX/NewLife.MySql) | NewLife データスタック上に構築された MySql ドライバーとヘルパー層。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.MySql?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.MySql) | | [NewLife.TDengine](https://github.com/NewLifeX/NewLife.TDengine) | 純マネージド TDengine ADO.NET ドライバー。REST、WebSocket、ネイティブ RPC の 3 方式に対応し、ネイティブ依存はありません。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.TDengine?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.TDengine) | | [NewLife.Presto](https://github.com/NewLifeX/NewLife.Presto) | 純粋な C# 製 Presto/Trino ADO.NET ドライバー。サードパーティ依存がなく、XCode ORM と統合できます。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Presto?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Presto) | | **Web と分散** | | | | [NewLife.Cube](https://github.com/NewLifeX/NewLife.Cube) | 高速管理プラットフォームフレームワーク:権限、SSO、OAuth サーバー、CRUD スキャフォールディング。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Cube?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Cube) | | [NewLife.Cube.React](https://github.com/NewLifeX/NewLife.Cube.React) | Cube のフロントエンド分離サンプル。WebAPI バックエンド + Swagger と React/Vue/Blazor クライアント。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Cube.React?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Cube.React) | | [Stardust](https://github.com/NewLifeX/Stardust) | 分散サービスプラットフォーム:ノード管理、APM、構成センター、登録センター、リリースセンター。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Stardust?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Stardust) | | [AntJob](https://github.com/NewLifeX/AntJob) | シャーディング、リトライ、バックフィルに対応した分散タスクとリアルタイムデータのスケジューリングプラットフォーム。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.AntJob?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.AntJob) | | **AI とビジョン** | | | | [NewLife.AI](https://github.com/NewLifeX/NewLife.AI) | 46 社の LLM プロバイダーに統一接続するクライアントと、すぐに使える Web チャットアプリ ChatAI。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.AI?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.AI) | | [NewLife.Imaging](https://github.com/NewLifeX/NewLife.Imaging) | 純マネージド画像基盤ライブラリ。ピクセルモデル、コーデック契約、描画、メタデータを提供し、ネイティブ依存はありません。 | — | | [NewLife.Vision](https://github.com/NewLifeX/NewLife.Vision) | 画像認識アルゴリズムライブラリ。OCR、バーコード、物体検出、顔認識を NewLife.Imaging 上に構築します。 | — | | [NewLife.ML](https://github.com/NewLifeX/NewLife.ML) | .NET 向け表形式の機械学習。データベースのテーブルや Excel を、デプロイ可能な予測・分類モデルに変換します。 | — | | **産業と IoT** | | | | [NewLife.IoT](https://github.com/NewLifeX/NewLife.IoT) | プロトコル契約とデバイス抽象を定義する IoT 標準ライブラリ。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.IoT?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.IoT) | | [NewLife.Modbus](https://github.com/NewLifeX/NewLife.Modbus) | NewLife.IoT 上に実装された Modbus TCP/RTU/ASCII。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Modbus?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Modbus) | | [NewLife.Siemens](https://github.com/NewLifeX/NewLife.Siemens) | NewLife.IoT 上に実装されたシーメンス PLC プロトコル。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Siemens?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Siemens) | | [NewLife.Omron](https://github.com/NewLifeX/NewLife.Omron) | NewLife.IoT 上に実装されたオムロン PLC プロトコル。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Omron?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Omron) | | [NewLife.Melsec](https://github.com/NewLifeX/NewLife.Melsec) | NewLife.IoT 上に実装された三菱 Melsec PLC プロトコル。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Melsec?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Melsec) | | [NewLife.Schneider](https://github.com/NewLifeX/NewLife.Schneider) | Modbus TCP を基盤とするシュナイダー PLC 通信用ドライバー。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Schneider?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Schneider) | | [NewLife.OPC](https://github.com/NewLifeX/NewLife.OPC) | 産業データアクセス向けの OPC クライアント。 | — | | [NewLife.BACnet](https://github.com/NewLifeX/NewLife.BACnet) | BACnet ビル管理プロトコルスタック。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.BACnet?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.BACnet) | | [NewLife.LoRa](https://github.com/NewLifeX/NewLife.LoRa) | 超低消費電力の広域 IoT 通信用プロトコル LoRaWAN。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.LoRa?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.LoRa) | | [ZeroIoT](https://github.com/NewLifeX/ZeroIoT) | ゲートウェイとデバイス管理を備えた軽量なオープンソース IoT プラットフォーム。 | — | | **車載テレマティクス** | | | | [NewLife.JT808](https://github.com/NewLifeX/NewLife.JT808) | JT/T 808 車両位置情報プロトコル:70 以上のメッセージボディ、2011/2013/2019 に対応。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.JT808?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.JT808) | | [NewLife.JT809](https://github.com/NewLifeX/NewLife.JT809) | 運輸管理部門向けの JT/T 809 プラットフォーム間プロトコル。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.JT809?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.JT809) | | [NewLife.JT1078](https://github.com/NewLifeX/NewLife.JT1078) | JT/T 1078 車載ビデオ:RTP 解析、FLV/fMP4 リマックス、ライブ配信。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.JT1078?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.JT1078) | | **ドメインコンポーネント** | | | | [NewLife.Office](https://github.com/NewLifeX/NewLife.Office) | Excel、Word、PPT、PDF など 15 以上のドキュメント形式を 1 パッケージで。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Office?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Office) | | [NewLife.Audio](https://github.com/NewLifeX/NewLife.Audio) | クロスプラットフォーム音声:コーデック、デバイス IO、DSP、コンテナ、ストリーミング。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Audio?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Audio) | | [NewLife.Video](https://github.com/NewLifeX/NewLife.Video) | ビデオコーデック、コンテナ形式、フレーム処理、ストリーミング。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Video?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Video) | | [NewLife.Map](https://github.com/NewLifeX/NewLife.Map) | 百度地図、高徳地図、テンセント地図、天地図を統一インターフェイス化。ジオコーディングと座標変換に対応。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Map?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Map) | | [NewLife.IP](https://github.com/NewLifeX/NewLife.IP) | IPv4 位置情報:オフラインのメモリマップデータベースとオンライン API のフォールバック。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.IP?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.IP) | | [NewLife.Holiday](https://github.com/NewLifeX/NewLife.Holiday) | 中国の祝日と振替休日を判定するライブラリ。年中の祝日データを内蔵し、旧暦の祝日にも対応、完全オフラインで動作します。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Holiday?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Holiday) | | **ツールと製品** | | | | [CrazyCoder](https://github.com/NewLifeX/XCoder) | 開発者向けツールボックス:ネットワーク、シリアルポート、暗号化、正規表現、Modbus、MQTT。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.XCoder?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.XCoder) | | [NewLife.UnitTest](https://github.com/NewLifeX/NewLife.UnitTest) | 単体テスト拡張ライブラリ。テスト基底クラス、データドリブンテスト、依存性注入の補助を提供します。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.UnitTest?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.UnitTest) | | [GitCandy](https://github.com/NewLifeX/GitCandy) | セルフホスト型 Git ソースコード管理システム。 | — | | [LuckyClover](https://github.com/NewLifeX/LuckyClover) | 古いホストから起動した際に対応する .NET ランタイムを自動インストールします。 | — | > バッジは各プロジェクトの主要パッケージを示します。テーマ、拡張、サテライトパッケージは各 NuGet ページを参照してください。ここに記載していない 30 以上のパッケージ(FTP、Office 拡張、各種プロトコルドライバーなど)は [NewLifeX 組織](https://github.com/NewLifeX) と [newlifex.com](https://newlifex.com) で公開しています。 ## ドキュメント | Document | Description | | --- | --- | | [Requirements](/NewLife/NewLife.Vision/Blob/master/Doc/需求文档.md) | Vision, goals, module scope and non-goals | | [Feature List](/NewLife/NewLife.Vision/Blob/master/Doc/功能清单.md) | Feature status across implementation, testing and comments | | [Architecture](/NewLife/NewLife.Vision/Blob/master/Doc/架构设计.md) | Layers, contracts, pipelines and adapter boundaries | | [Competitive Analysis](/NewLife/NewLife.Vision/Blob/master/Doc/竞品分析.md) | Engine comparison and positioning | | [パフォーマンス基準](/NewLife/NewLife.Vision/Blob/master/Doc/性能测试.md) | 主要パイプラインの実測レイテンシとメモリ割り当て | | [Change Log](/NewLife/NewLife.Vision/Blob/master/Doc/ChangeLog.md) | Release history generated at publish time | ## コントリビューション ```bash dotnet build -c Release dotnet test -c Release ``` Issues and pull requests are welcome. Please keep public API free of third-party engine types and add a focused test for every new behavior. ## ライセンス MIT License ## チーム <img src="https://newlifex.com/logo.png" width="48" align="right" alt="NewLife" /> Founded in 2002, the NewLife team has spent more than two decades on the .NET and IoT ecosystem and maintains nearly 100 open-source projects. Open-source components have been downloaded <!--nuget-total:start-->6.48M<!--nuget-total:end--> times from NuGet (ecosystem-wide, as of 2026-10). Website: https://newlifex.com · Open source organization: https://github.com/NewLifeX