Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

No SelectROI in OpenCV jar?

I'm writing a small utility program that should crop images based on a rectangular shape that i want to input dinamically with the mouse, (as seen in this tutorial).
Unlike the tutorial, i'd like to implement this application in Java, as i'm more comfortable with it: I'm using BetBeans 10 and i've added the OpenCV 4.0.1 library (and the .dll in the root of the project, as I'm under Win10).

So far, when i invoked Imgcodecs and Imgproc methods or declared Mat type objects I've never had issues, but when i tried HighGui.selectROI() the IDE was not able to resolve its depencency: so i checked the JavaDOC for OpenCV 4, and indeed it's lacking the SelectROI method, while inside the cpp source that came alongside the library it's actually there, as well as reported by the C++/Python docs.

Here's what I came up with so far:
- either the SelectROI function was not ported to Java because there's a simple way of getting to the same result with minimal effort and I just need to read more stuff, in which case I'd like to be pointed to the right docs;
- or i need to rebuild the OpenCV jar, and export something to make it available to may other application, in which case i would need some basic guide as i couldn't make head or tail of the sources and the folder structure;
- or mabybe it's just a matter of doing some JNI wizardry, wich i know nothing about at the present time.

No SelectROI in OpenCV jar?

I'm writing a small utility program that should crop images based on a rectangular shape that i want to input dinamically with the mouse, (as seen in this tutorial).
Unlike the tutorial, i'd like to implement this application in Java, as i'm more comfortable with it: I'm using BetBeans NetBeans 10 and i've added the OpenCV 4.0.1 library (and the .dll in the root of the project, as I'm under Win10).

So far, when i invoked Imgcodecs and Imgproc methods or declared Mat type objects I've never had issues, but when i tried HighGui.selectROI() the IDE was not able to resolve its depencency: so i checked the JavaDOC for OpenCV 4, and indeed it's lacking the SelectROI method, while inside the cpp source that came alongside the library it's actually there, as well as reported by the C++/Python docs.

Here's what I came up with so far:
- either the SelectROI function was not ported to Java because there's a simple way of getting to the same result with minimal effort and I just need to read more stuff, in which case I'd like to be pointed to the right docs;
- or i need to rebuild the OpenCV jar, and export something to make it available to may my other application, in which case i would need some basic guide as i couldn't make head or tail of the sources and the folder structure;
- or mabybe it's just a matter of doing some JNI wizardry, wich i know nothing about at the present time.

edit: typos