-
Notifications
You must be signed in to change notification settings - Fork 737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for opencv text module #327
Comments
Basically, start by checking line 221, see what Info might missing to get that parsed properly, and add it to the InfoMap. |
Hi Samuel, Line 221 reads like this:
Which is indeed invalid Java because of the std::deque dependency. Do you have any pointers on how I can translate this to Java bindings? b. |
We have to give them a name and define them. There's a lot of examples of that here: In this case, something like this should work: .put(new Info("std::deque<int>").pointerTypes("IntDeque").define()) |
Thanks for the help, I got a lot further. After adding the necessary mappings to the infoMap, the Java side seems to compile well. However, if I try to install the package, I run into this error:
It seems like I'm missing the CPP-side of the newly created Java mappings, is that possible? |
On second thought, no, it seems like line 1940 of the generated jniopencv_text.cpp file has some issues: Line 1940 The VectorAdapter template seems to be generated without type, but I lack some knowledge of the framework to understand where it is generated... |
What does the declaration of that native method looks like in Java? |
It's a bit hard to say because I don't have a clear view on what compiles to what, but I've added the files to this gist The first file is the cpp file that causes problems, see line 1940 The second file is the generated java. The third file is the java preset file. Does that help? |
.put(new Info("std::vector<std::vector<cv::text::ERStat> >").pointerTypes("ERStatVectorVector").define());
.put(new Info("std::vector<std::vector<cv::Vec2i> >").pointerTypes("Vec2iVectorVector").define()); |
Hi Samuel, Got a whole lot further, thanks, I think we're nearly there! Two extra questions:
Some pointers? |
No need to redefine They use .put(new Info("std::vector<std::vector<cv::Vec2i> >").pointerTypes("PointVectorVector").cast()); |
Hi Samuel, Worked on this a little bit today and managed to get it all compiling and running, thanks for your insightful comments! You can find the final working preset here. Just converted the textdetection.cpp sample and it works like a charm. b. |
Awesome! Please send a pull request to have this merged. |
Done, see #333 ! |
As mentioned in #319 , I'm working on support for the opencv text module, but I'm looking for some help because I'm new to creating new presets.
After activating the "-DBUILD_opencv_text=ON" flag in javacpp-presets/opencv/cppbuild.sh,
I added the following code under /javacpp-presets/opencv/src/main/java/org/bytedeco/javacpp/presets/opencv_text.java
https://gist.github.com/beligum/2146b7819612e99af4536be032849bc0
Trying to compile on Linux x64 (Ubuntu Trusty) using:
mvn compile --projects opencv -Djavacpp.platform=linux-x86_64 -Djavacpp.platform.dependency=false
Below is the error that's thrown. Can someone with more insight than me have a look at it?
The text was updated successfully, but these errors were encountered: