docs: 添加项目 README,说明愿景与目标
|
<!-- generated from README.md by sync-readme-package.ps1; do not edit -->
# NewLife.Vision - .NET Vision Understanding Library





[](https://github.com/NewLifeX/NewLife.Vision/actions/workflows/test.yml)



[](https://github.com/NewLifeX/NewLife.Vision/graphs/contributors)
<!-- lang:start -->
🌐 [简体中文](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.zh-CN.md) | [繁體中文](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.zh-TW.md) | [Español](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.es.md) | [Deutsch](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.de.md) | [日本語](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.ja.md) | [Français](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.fr.md) | [Português](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.pt.md) | [Русский](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.ru.md) | [한국어](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.ko.md) | [العربية](https://github.com/NewLifeX/NewLife.Vision/blob/master/README.ar.md)
<!-- lang:end -->
Turn pixels into searchable, actionable structure: text, barcodes, objects and faces, with swappable engines.
Source: https://github.com/NewLifeX/NewLife.Vision
NuGet: `NewLife.Vision`
## Quick Start
Barcode decoding with the built-in pure managed reader:
```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);
```
Text recognition with the built-in pure managed template recognizer:
```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`.
## Features
<details>
<summary><b>Preprocessing & Geometry</b> (6 items)</summary>
| Capability | What it gives you |
| --- | --- |
| Step contract | `IImagePreprocessor` composes stateless steps that can run concurrently |
| Basic steps | Grayscale, Otsu binarization, contrast stretch, resize and ROI crop on top of NewLife.Imaging |
| Deskew | Projection-profile angle search plus rotation, returns the estimated angle |
| Perspective correction | Four-corner homography with bilinear sampling, output size optional |
| Presets | Ready-made chains via `PreprocessPipeline.CreateOcr()` and `CreateBarcode()` |
| Calibration | `CameraCalibrator` solves intrinsics + radial distortion from planar targets; `ImageUndistorter` rectifies frames |
</details>
<details>
<summary><b>Text Recognition</b> (5 items)</summary>
| Capability | What it gives you |
| --- | --- |
| Engine contract | `ITextRecognizer` with a single async entry point and cancellation support |
| Built-in template OCR | Pure managed template matching, ships with no model files |
| 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 |
| Graceful degradation | Unreadable text returns an empty result with a score instead of throwing |
</details>
<details>
<summary><b>Barcode</b> (4 items)</summary>
| Capability | What it gives you |
| --- | --- |
| Engine contract | `IBarcodeReader` returns text, format and bounding box per result |
| Built-in reader | Pure managed QR, Code128, Code39, Code93, EAN-13, EAN-8 and UPC-A decoding with no third-party package |
| Barcode 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>Detection and Face</b> (4 items)</summary>
| Capability | What it gives you |
| --- | --- |
| Detection contract | `IObjectDetector` returns boxes, classes and scores; `DetectionPipeline` adds score/class filtering and per-class NMS |
| Session-driven models | `IModelSession` accepts any backend; YOLO/face decoding, seg/pose post-processing, 1:1 face matching plus a built-in pure-managed ONNX subset executor are included |
| Cloud OCR | `ChatVisionRecognizer` posts the image to any OpenAI-compatible endpoint, with no extra client dependency |
</details>
<details>
<summary><b>Frame and Pixel Model</b> (3 items)</summary>
| Capability | What it gives you |
| --- | --- |
| Vision image | `VisionImage` wraps any buffer with offset, stride and five packed pixel formats |
| Imaging interop | `ImageFrame` and `VisionImage` convert both ways inside the core package |
| Zero-copy views | Row and pixel spans expose the underlying buffer without copies |
</details>
## Ecosystem Map
NewLife is a layered ecosystem of independently versioned open-source projects. The map below is shared verbatim by every NewLife repository; each project links to its repository and its primary NuGet package.
| Project | What it does | Downloads |
| --- | --- | --- |
| **Foundation** | | |
| [NewLife.Core](https://github.com/NewLifeX/X) | Logging, configuration, caching, networking, serialization, scheduling and APM tracing. | [](https://www.nuget.org/packages/NewLife.Core) |
| [NewLife.XCode](https://github.com/NewLifeX/NewLife.XCode) | Data middleware: single tables at the tens-of-billions scale, automatic sharding, read-write splitting, 10+ databases. | [](https://www.nuget.org/packages/NewLife.XCode) |
| [NewLife.Net](https://github.com/NewLifeX/NewLife.Net) | High-performance network library: 1.77M pps / 14.5 Gbps on a single machine (TCP 1KB, 2026-10), 4M long-lived TCP connections. | [](https://www.nuget.org/packages/NewLife.Net) |
| [NewLife.Remoting](https://github.com/NewLifeX/NewLife.Remoting) | Protocol communication and RPC framework for client/server applications and IoT devices. | [](https://www.nuget.org/packages/NewLife.Remoting) |
| [NewLife.Agent](https://github.com/NewLifeX/NewLife.Agent) | Installs .NET applications as OS daemons: Windows services and Linux systemd. | [](https://www.nuget.org/packages/NewLife.Agent) |
| [NewLife.Templates](https://github.com/NewLifeX/NewLife.Zero) | `dotnet new` project templates for console, web, API, service, data and IoT projects. | [](https://www.nuget.org/packages/NewLife.Templates) |
| **Data & Messaging** | | |
| [NewLife.Redis](https://github.com/NewLifeX/NewLife.Redis) | Redis client with microsecond latency, millions of ops/s and built-in message queues. | [](https://www.nuget.org/packages/NewLife.Redis) |
| [NewLife.RocketMQ](https://github.com/NewLifeX/NewLife.RocketMQ) | Pure managed RocketMQ client for Apache RocketMQ and Alibaba Cloud Message Queue. | [](https://www.nuget.org/packages/NewLife.RocketMQ) |
| [NewLife.MQTT](https://github.com/NewLifeX/NewLife.MQTT) | MQTT client and server, including Alibaba Cloud IoT connectivity. | [](https://www.nuget.org/packages/NewLife.MQTT) |
| [NewLife.NovaDb](https://github.com/NewLifeX/NewLife.NovaDb) | Hybrid database in C#: embedded or networked, relational, time-series, message queue and KV in one. | [](https://www.nuget.org/packages/NewLife.NovaDb) |
| [NewLife.MySql](https://github.com/NewLifeX/NewLife.MySql) | MySql driver and helper layer built on the NewLife data stack. | [](https://www.nuget.org/packages/NewLife.MySql) |
| [NewLife.TDengine](https://github.com/NewLifeX/NewLife.TDengine) | Pure managed TDengine ADO.NET driver with REST, WebSocket and native RPC transports, no native dependency. | [](https://www.nuget.org/packages/NewLife.TDengine) |
| [NewLife.Presto](https://github.com/NewLifeX/NewLife.Presto) | Pure C# Presto/Trino ADO.NET driver with zero third-party dependencies and XCode ORM integration. | [](https://www.nuget.org/packages/NewLife.Presto) |
| **Web & Distributed** | | |
| [NewLife.Cube](https://github.com/NewLifeX/NewLife.Cube) | Rapid admin-platform framework: permissions, SSO, OAuth server and CRUD scaffolding. | [](https://www.nuget.org/packages/NewLife.Cube) |
| [NewLife.Cube.React](https://github.com/NewLifeX/NewLife.Cube.React) | Decoupled front-end sample for Cube: WebAPI backend with Swagger plus React, Vue and Blazor clients. | [](https://www.nuget.org/packages/NewLife.Cube.React) |
| [Stardust](https://github.com/NewLifeX/Stardust) | Distributed service platform: node management, APM, configuration center, registry and release center. | [](https://www.nuget.org/packages/NewLife.Stardust) |
| [AntJob](https://github.com/NewLifeX/AntJob) | Distributed task and real-time data scheduling platform with sharding, retries and backfill. | [](https://www.nuget.org/packages/NewLife.AntJob) |
| **AI & Vision** | | |
| [NewLife.AI](https://github.com/NewLifeX/NewLife.AI) | Unified client for 46 LLM providers plus ChatAI, a ready-to-run web chat application. | [](https://www.nuget.org/packages/NewLife.AI) |
| [NewLife.Imaging](https://github.com/NewLifeX/NewLife.Imaging) | Pure managed imaging foundation: pixel model, codec contracts, drawing and metadata with zero native dependencies. | — |
| [NewLife.Vision](https://github.com/NewLifeX/NewLife.Vision) | Vision algorithms: OCR, barcodes, object detection and face recognition on top of NewLife.Imaging. | — |
| [NewLife.ML](https://github.com/NewLifeX/NewLife.ML) | Tabular machine learning for .NET: turn database tables and Excel sheets into deployable prediction and classification models. | — |
| **Industrial & IoT** | | |
| [NewLife.IoT](https://github.com/NewLifeX/NewLife.IoT) | IoT standard library defining protocol contracts and device abstractions. | [](https://www.nuget.org/packages/NewLife.IoT) |
| [NewLife.Modbus](https://github.com/NewLifeX/NewLife.Modbus) | Modbus TCP/RTU/ASCII implementation on top of NewLife.IoT. | [](https://www.nuget.org/packages/NewLife.Modbus) |
| [NewLife.Siemens](https://github.com/NewLifeX/NewLife.Siemens) | Siemens PLC protocol on top of NewLife.IoT. | [](https://www.nuget.org/packages/NewLife.Siemens) |
| [NewLife.Omron](https://github.com/NewLifeX/NewLife.Omron) | Omron PLC protocol on top of NewLife.IoT. | [](https://www.nuget.org/packages/NewLife.Omron) |
| [NewLife.Melsec](https://github.com/NewLifeX/NewLife.Melsec) | Mitsubishi Melsec PLC protocol on top of NewLife.IoT. | [](https://www.nuget.org/packages/NewLife.Melsec) |
| [NewLife.Schneider](https://github.com/NewLifeX/NewLife.Schneider) | Schneider PLC communication driver built on Modbus TCP. | [](https://www.nuget.org/packages/NewLife.Schneider) |
| [NewLife.OPC](https://github.com/NewLifeX/NewLife.OPC) | OPC client for industrial data access. | — |
| [NewLife.BACnet](https://github.com/NewLifeX/NewLife.BACnet) | BACnet building-automation protocol stack. | [](https://www.nuget.org/packages/NewLife.BACnet) |
| [NewLife.LoRa](https://github.com/NewLifeX/NewLife.LoRa) | LoRaWAN low-power wide-area protocol for long-range IoT connectivity. | [](https://www.nuget.org/packages/NewLife.LoRa) |
| [ZeroIoT](https://github.com/NewLifeX/ZeroIoT) | Lightweight open-source IoT platform with gateway and device management. | — |
| **Vehicle Telematics** | | |
| [NewLife.JT808](https://github.com/NewLifeX/NewLife.JT808) | JT/T 808 vehicle positioning protocol: 70+ message bodies, 2011/2013/2019. | [](https://www.nuget.org/packages/NewLife.JT808) |
| [NewLife.JT809](https://github.com/NewLifeX/NewLife.JT809) | JT/T 809 platform-to-platform protocol for transport authorities. | [](https://www.nuget.org/packages/NewLife.JT809) |
| [NewLife.JT1078](https://github.com/NewLifeX/NewLife.JT1078) | JT/T 1078 in-vehicle video: RTP parsing, FLV/fMP4 remuxing and live streaming. | [](https://www.nuget.org/packages/NewLife.JT1078) |
| **Domain Components** | | |
| [NewLife.Office](https://github.com/NewLifeX/NewLife.Office) | One package for Excel, Word, PPT, PDF and 15+ document formats. | [](https://www.nuget.org/packages/NewLife.Office) |
| [NewLife.Audio](https://github.com/NewLifeX/NewLife.Audio) | Cross-platform audio: codecs, device I/O, DSP, containers and streaming. | [](https://www.nuget.org/packages/NewLife.Audio) |
| [NewLife.Video](https://github.com/NewLifeX/NewLife.Video) | Video codecs, container formats, frame processing and streaming. | [](https://www.nuget.org/packages/NewLife.Video) |
| [NewLife.Map](https://github.com/NewLifeX/NewLife.Map) | Unified interface over Baidu, AMap, Tencent and Tianditu with geocoding and coordinate conversion. | [](https://www.nuget.org/packages/NewLife.Map) |
| [NewLife.IP](https://github.com/NewLifeX/NewLife.IP) | IPv4 geolocation with an offline memory-mapped database and an online API fallback. | [](https://www.nuget.org/packages/NewLife.IP) |
| [NewLife.Holiday](https://github.com/NewLifeX/NewLife.Holiday) | Chinese holiday and adjusted-workday identification library with built-in annual data and lunar festival support, fully offline. | [](https://www.nuget.org/packages/NewLife.Holiday) |
| **Tools & Products** | | |
| [CrazyCoder](https://github.com/NewLifeX/XCoder) | Developer toolbox: network, serial port, crypto, regex, Modbus and MQTT. | [](https://www.nuget.org/packages/NewLife.XCoder) |
| [NewLife.UnitTest](https://github.com/NewLifeX/NewLife.UnitTest) | Unit test extensions: test base classes, data-driven tests and dependency-injection helpers. | [](https://www.nuget.org/packages/NewLife.UnitTest) |
| [GitCandy](https://github.com/NewLifeX/GitCandy) | Self-hosted Git source code management system. | — |
| [LuckyClover](https://github.com/NewLifeX/LuckyClover) | Installs the matching .NET runtime automatically when launched from an older host. | — |
> Badges show the primary package of each project; theme, extension and satellite packages are listed on their NuGet pages. The 30+ packages not listed here (FTP, Office extensions, protocol drivers and more) are available under the [NewLifeX organization](https://github.com/NewLifeX) and on [newlifex.com](https://newlifex.com).
## Documentation
| Document | Description |
| --- | --- |
| [Requirements](https://github.com/NewLifeX/NewLife.Vision/blob/master/Doc/需求文档.md) | Vision, goals, module scope and non-goals |
| [Feature List](https://github.com/NewLifeX/NewLife.Vision/blob/master/Doc/功能清单.md) | Feature status across implementation, testing and comments |
| [Architecture](https://github.com/NewLifeX/NewLife.Vision/blob/master/Doc/架构设计.md) | Layers, contracts, pipelines and adapter boundaries |
| [Competitive Analysis](https://github.com/NewLifeX/NewLife.Vision/blob/master/Doc/竞品分析.md) | Engine comparison and positioning |
| [Performance Test](https://github.com/NewLifeX/NewLife.Vision/blob/master/Doc/性能测试.md) | Measured latency and allocations of core pipelines |
| [Change Log](https://github.com/NewLifeX/NewLife.Vision/blob/master/Doc/ChangeLog.md) | Release history generated at publish time |
## Contributing
```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.
## License
MIT License
## Team
<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
|