OpenCvSharp Documentation
These guides explain how to select, install, and use OpenCvSharp. They complement the API reference, which is generated from the OpenCvSharp source code and XML documentation comments.
New users
Start with these pages in order:
- Choose a version and package.
- Install OpenCvSharp.
- Build your first application.
- Learn the fundamentals of Mat.
- Learn how to manage native resources.
- Understand array proxies and in-place processing, then learn how to control copies and native memory.
Already familiar with OpenCV C++ or OpenCV-Python? Start with the API comparison and translation guide.
OpenCvSharp and .NET guides
- Browse the OpenCvSharp and .NET guides
- Learn the Mat data model
- Manage native resources
- Use InputArray, OutputArray, and in-place processing safely
- Control copies, native memory, and hot-loop allocations
- Access and modify pixels
- Encode images and convert UI image types
- Store matrices and parameters in YAML, XML, or JSON
- Process uploaded images and streams in ASP.NET Core
- Display images in .NET UI frameworks
- Read and write video
OpenCV examples
These examples demonstrate OpenCV features through their OpenCvSharp APIs. Use the official OpenCV references linked from each page for algorithm theory and parameter definitions.
- Browse the OpenCV examples
- Build an image processing pipeline
- Analyze histograms and improve contrast
- Resize, crop, rotate, and rectify images
- Create and refine masks
- Measure contours and connected components
- Detect and match local features
Existing applications
OpenCvSharp5 is recommended for new applications targeting .NET 8 or later. Applications that use OpenCvSharp4 can follow the OpenCvSharp4 to OpenCvSharp5 migration guide.
Get help
Start with Common Errors and Diagnostics when an operation fails or produces unexpected output. Check Native Library Loading when an application builds successfully but cannot load OpenCvSharpExtern at run time. For problems not covered here, search or open an issue in the OpenCvSharp issue tracker.