problems generating java binding files for contrib modules on windows

asked 2018-02-02 00:18:24 -0500

9261 gravatar image

updated 2018-02-02 13:15:17 -0500

Hello. I am trying to build opencv for android with its extra modules. I am using cmake and minGW. The build seemed to be successful, but when it got to the "generate files for java bindings" step, it didn't seem to generate any binding files for some of the contrib modules. I checked the directory they were supposed to be created in, and some of them were just empty java classes, and I am worried that others could be missing functions. I have no idea what is causing the problem, and would greatly appreciate any help. If needed I can post my cmake output file. Here are the messages mingw gives me when it tries to build the binding files:

JAVA: Processing OpenCV modules: 36
duplicated: CLASS cv::.Algorithm :
SKIP:void read(FileNode fn)      due to ARG typeFileNode/I
SKIP:void write(Ptr_FileStorage fs, String name = String())      due to ARG typePtr_FileStorage/I
SKIP:bool read(FileNode node)    due to ARG typeFileNode/I
SKIP:Mat samplePCByQuantization(Mat pc, Vec2f xrange, Vec2f yrange, Vec2f zrange, float sample_step_relative, int weightByCenter = 0)    due to ARG typeVec2f/I
SKIP:Mat transformPCPose(Mat pc, Matx44d Pose)   due to ARG typeMatx44d/I
SKIP:int computeNormalsPC3d(Mat PC, Mat& PCNormals, int NumNeighbors, bool FlipViewpoint, Vec3f viewpoint)       due to ARG typeVec3f/I
SKIP:void getRandomPose(Matx44d Pose)    due to ARG typeMatx44d/I
SKIP:int registerModelToScene(Mat srcPC, Mat dstPC, double& residual, Matx44d& pose)     due to ARG typeMatx44d/O
SKIP:void forward(vector_vector_Mat& outputBlobs, vector_String outBlobNames)    due to ARG typevector_vector_Mat/O
SKIP:void getLayersShapes(MatShape netInputShape, vector_int& layersIds, vector_vector_MatShape& inLayersShapes, vector_vector_MatShape& outLayersShapes)        due to ARG typevector_vector_MatShape/O
SKIP:void getLayersShapes(vector_MatShape netInputShapes, vector_int& layersIds, vector_vector_MatShape& inLayersShapes, vector_vector_MatShape& outLayersShapes)        due to ARG typevector_vector_MatShape/O
SKIP:BOWImgDescriptorExtractor(Ptr_DescriptorExtractor dextractor, Ptr_DescriptorMatcher dmatcher)       due to ARG typePtr_DescriptorExtractor/I
SKIP:void read(FileNode arg1)    due to ARG typeFileNode/I
SKIP:void write(Ptr_FileStorage fs, String name = String())      due to ARG typePtr_FileStorage/I
SKIP:void read(FileNode arg1)    due to ARG typeFileNode/I
SKIP:void write(Ptr_FileStorage fs, String name = String())      due to ARG typePtr_FileStorage/I
SKIP:uchar Params::blobColor     due to RET typeuchar
SKIP:void Params::blobColor      due to ARG typeuchar/I
SKIP:void read(FileNode fn)      due to ARG typeFileNode/I
duplicated: CLASS cv.text::OCRBeamSearchDecoder.ClassifierCallback :
SKIP:Ptr_ERFilter createERFilterNM1(Ptr_ERFilter_Callback cb, int thresholdDelta = 1, float minArea = (float)0.00025, float maxArea = (float)0.13, float minProbability = (float)0.4, bool nonMaxSuppression = true, float minProbabilityDiff = (float)0.1)      due to ARG typePtr_ERFilter_Callback/I
SKIP:Ptr_ERFilter createERFilterNM2(Ptr_ERFilter_Callback cb, float minProbability = (float)0.3)         due to ARG typePtr_ERFilter_Callback/I
SKIP:Ptr_ERFilter_Callback loadClassifierNM1(String filename)    due to RET typePtr_ERFilter_Callback
SKIP:Ptr_ERFilter_Callback loadClassifierNM2(String filename)    due to RET typePtr_ERFilter_Callback
SKIP:Ptr_OCRBeamSearchDecoder_ClassifierCallback loadOCRBeamSearchClassifierCNN(String filename)         due to RET typePtr_OCRBeamSearchDecoder_ClassifierCallback
SKIP:Ptr_OCRHMMDecoder_ClassifierCallback loadOCRHMMClassifier(String filename, int classifier)  due to RET typePtr_OCRHMMDecoder_ClassifierCallback
SKIP:Ptr_OCRHMMDecoder_ClassifierCallback loadOCRHMMClassifierCNN(String filename)       due to RET typePtr_OCRHMMDecoder_ClassifierCallback
SKIP:Ptr_OCRHMMDecoder_ClassifierCallback loadOCRHMMClassifierNM(String filename)        due to RET typePtr_OCRHMMDecoder_ClassifierCallback
SKIP:static Ptr_OCRBeamSearchDecoder create(Ptr_OCRBeamSearchDecoder_ClassifierCallback classifier, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table, int mode = OCR_DECODER_VITERBI, int beam_size = 500)        due ...
(more)
edit retag flag offensive close merge delete

Comments

  • "I am using cmake and minGW" -- this will generate desktop pc java bindings, for adroid , you would need an android ndk/sdk (not possible, using mingw)

  • "it didn't seem to generate any binding files for the contrib modules." -- i see charuco and linemod in the messages, so it did !.

berak gravatar imageberak ( 2018-02-02 01:29:20 -0500 )edit

this is the tutorial I was trying to use: https://zami0xzami.wordpress.com/2016... the tutorial seems to indicate that it can be built from source this way, but if that is not possible, how would I go about building it correctly? Also, you are right that it did generate some binding files, but some of them are completely empty, and i'm worried that others are missing functions. The dpm module, for example, does have .java files, but they are empty. I've updated the question to be more clear on that point

9261 gravatar image9261 ( 2018-02-02 02:52:07 -0500 )edit

that tutorial is only using mingw32-make not the compiler. i never tried, but to my knowledge, you have to follow the recipe here

but you're right, the java bindings are somewhat incomplete (e.g. no dpm at all) . and it's usually ppl like you and me, who are trying to contribute those !

have a look here , to see, what's currently possible.

berak gravatar imageberak ( 2018-02-02 03:13:02 -0500 )edit

thanks berak! You just saved me days of work

9261 gravatar image9261 ( 2018-02-02 03:27:18 -0500 )edit

well, if you get anything done, it's probably a good idea, to come back and write an answer here (since documentation / receipes are so sparse on this)

berak gravatar imageberak ( 2018-02-02 03:46:32 -0500 )edit

ok, I changed the cmake to stop building the modules without java bindings, but mingw32-make didn't create a java folder in the sdk. I also tried using the build_sdk tool, but it can't seem to correctly use the ndk. It says that the ndk failed to compile a simple test program and says something about createprocess not finding a file.

9261 gravatar image9261 ( 2018-02-02 21:53:19 -0500 )edit