OpenCV and C#


Go to content

Features

Features

The most important header files of the OpenCv library v2.3 were 'wrapped' - including the new cv - namespace:

•   opencv2\core\types_c.h
•   opencv2\core\core_c.h
•   opencv2\core\core.hpp
•   opencv2\imgproc\types_c.h
•   opencv2\imgproc\imgproc_c.h
•   opencv2\imgproc\imgproc.hpp
•   opencv2\video\tracking.hpp
•   opencv2\video\background_segm.hpp
•   opencv2\features2d\features2d.hpp
•   opencv2\objdetect\objdetect.hpp
•   opencv2\calib3d\calib3d.hpp
•   opencv2\ml\ml.hpp
•   opencv2\highgui\highgui_c.h
•   opencv2\highgui\highgui.hpp
•   opencv2\contrib\contrib.hpp
•   opencv2\legacy\legacy.hpp
•   opencv2\flann\flann.hpp

"Wrapping" means for me - USABILITY - coding as close as possible on "C/C++" but with all advantages of the powerfull C# - Language. Code easily from scratch or copy & paste C/C++ code, do some small modifications - and GO.

How your code will look like:


Mat bigmat = new Mat((int)rvecs.Count, 6, rvecs[0].type());
  for (int i = 0; i < (int)rvecs.Count; i++)
  {
    Mat r = bigmat.operator_get_SubMat1(new Range(i, i + 1), new Range(0, 3));
...
Size textSize = cvlib.getTextSize(msg, 1, 1.0, 1, out baseLine);

Debug (cvlibd.dll) and Release (cvlib.dll) versions of the wrapper available.

All exported methods, the most important macros, constructors, constants and callbacks are accessible directly by using only one prefix: cvlib(d).functionname(...), cvlib(d).CONSTANT... Same for the new cv - namespace of the opencv library.

All structure definitions are usable in a familiar way (e.g. IplImage img , Mat mat...).

All methods that have default arguments are overloaded.

Access to structure fields like image.fl is supported by getter/setter which accept/return managed arrays.

Most of operators are available by methods that starts with operator (e.g.: bigmat.operator_get_SubMat1(..)

The conversion to and from drawing types like Bitmap has been integrated. Casting operator (Bitmap)myIplImage and casting functions in both directions are available.

For error handling, the provided mechanisms of the OpenCV Library can be used. Exceptions are supported.

A lot of generic classes have predefined typed, like Matx_double, Complex...

Callbacks are handled by predefined delegates. Use trackbars in a child window, mouse callbacks, error handlers and camera callbacks in a familiar way.

Most of complex method aregument's like pointers/double pointers that are arrays are wrapped to c# arrays.

std::vector<> or std:vector<std::vector<>> available as c# List class.

No worries about CvArr, InputArray, OutputArray Types. Pass your arguments like in C++.

A set of samples available.

 

And many more..


Back to content | Back to main menu