Giter VIP home page Giter VIP logo

Comments (3)

shimat avatar shimat commented on May 16, 2024

That's a good idea, but there are some concerns.

  1. To support extension methods, .NET 2.0 compatibility must be abandoned.
  2. 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.

kobush avatar kobush commented on May 16, 2024

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.

shimat avatar shimat commented on May 16, 2024

Mat method chaining is supported in the latest version.

from opencvsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.