Comments (3)
That's a good idea, but there are some concerns.
- To support extension methods, .NET 2.0 compatibility must be abandoned.
- I do not think your example (CvtColor) is so effective.
Cv2.BoundingRect is one of the method that is suitable for extension method.
Rect rect1 = Cv2.BoundingRect(mat);
Rect rect2 = mat.BoundingRect();
For CvtColor, I think supporting method chaining is more effective. (This requires very great care...)
public static void CvtColor(InputArray src, OutputArray dst, ColorConversion code, int dstCn = 0);
to
class Mat{
public Mat CvtColor(ColorConversion code, int dstCn = 0);
}
Usage:
int nonZeroPixels = new Mat("test.bmp")
.CvtColor(ColorConversion.RgbToGray)
.Threshold(128, 255, ThrehsoldType.Binary)
.CountNonZero();
from opencvsharp.
Thats a great idea. Currently it's difficult to discover the methods applicable to various types (for example Mat). Perhaps this could be put into a separate dll so the main one can be still compiled for .net 2.0.
from opencvsharp.
Mat method chaining is supported in the latest version.
from opencvsharp.
Related Issues (20)
- Linux ARM64 (Native bindings for Linux ARM64) HOT 6
- Unable to find an entry point named 'videoio_VideoWriter_fourcc' in shared library 'OpenCvSharpExtern'. HOT 15
- Feature Request EstimateAffine3D
- opencvsharp4 is missing NuGet package README file
- opencvsharp4.runtime.win is missing NuGet package README file
- opencvsharp4.extensions is missing NuGet package README file
- opencvsharp4.windows is missing NuGet package README file
- opencvsharp4.wpfextensions is missing NuGet package README file
- Setup HOT 1
- how to split r,g,b channel image from Mat data pointer HOT 1
- License boiler plate still not filled in
- Where is Rect.Empty
- opencvshap4 no Extensions
- OpenCVSharp does not seem to work with Raspberry PI Camera Module 3
- opencvsharp4.9 + ubuntu 20.04 + NET6.0 + Docker Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies HOT 1
- Convert Python code to C#
- Please add cv::dnn::imagesFromBlob() function
- How to build OpencvSharp for Windows with Gstreamer
- Different open cameras depending on the videoCaptureApi used
- Unable to load DLL 'OpenCvSharpExtern' or one of its dependencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencvsharp.