Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV Java API consists of hundreds thin wrappers to native OpenCV functions. Most of these wrappers are generated automatically at build time, and just a small part of them is written manually. (BTW the same approach is used for OpenCV Python API.) Most of OpenCV Java classes (except primitive ones like Point, Rect, Scalar, etc) keep just an address of the corresponding native object and use it for calls to native methods. The Mat class is wrapped manually but it still keeps all the data in native.

Not all the OpenCV classes and functions are ported to Java, just a subset of most important ones and those that have easy-to-port API.

Generally, a program that extensively uses OpenCV should do it in native level that allows access to all the C/C++ library API and eliminates overhead of numerous JNI calls.

So, turning back to the unoriginal question, the answer depends on the functionality to wrap: it might happen that that the function can be ported automatically after some improvements in the wrappers generator script or it may be more sensible adding another manual wrapper like ones stored under opencv/modules/java/generator/src folder.

So please open a feature request at OpenCV tracker and we'll suggest a recommended way to contribute a new warapper(s).