2016-04-18 02:48:01 -0600 | received badge | ● Scholar (source) |
2016-04-18 02:47:50 -0600 | answered a question | minMaxIdx missing in the JNI interface? If someone has the same problem than me, my solution was to edit the Python script which generates the C++ and Java code of the JNI binding: modules/java/generator/gen_java.py. I added the following code after the declaration of minMaxLoc: line 413, after }, # minMaxLoc This code could be greatly improved by merging the structures MinMaxLocResult and MinMaxIdxResult, but I didn't want to change the code of minMaxLoc. |
2016-04-14 08:11:43 -0600 | commented answer | minMaxIdx missing in the JNI interface? I did not found a solution to convert my 3d X.Y.Z map into a 2d X.(Y.Z) map, except by copying each value (which is slow through the JNI binding). My solution was to add the minMaxIdx to the JNI binding, using the same workaround as minMaxLoc. As you said, this is quite kludgy but it works. Probably someone forgot to add it when minMaxIdx was introduced, do you think I should write a bug report for this issue? |
2016-04-14 02:59:53 -0600 | commented answer | minMaxIdx missing in the JNI interface? That's ok :) I will let you know if I find a solution. |
2016-04-14 02:51:19 -0600 | commented answer | minMaxIdx missing in the JNI interface? Actually, this code would crash if img.dims > 2 (http://code.opencv.org/issues/703). I cannot use split or mixChannels to change my matrix, given that I have only one channel (img.channels = 1) but n dimensions (img.dims = n). This is similar to http://answers.opencv.org/question/26... A solution would be to map my nd matrix to a 2d one and then infer the index for the additional dimensions. I am a beginner with OpenCV and I will look in the documentation to see if there is an efficient way to do that. |
2016-04-14 02:05:24 -0600 | commented answer | minMaxIdx missing in the JNI interface? Hi berak, thanks for your response.
I am not sure this would solve my problem. Basically, I need to get the maximum value of a n-dimensional array. I could do it in Java directly, but it would be far less efficient given that each call to Mat.get is translated into a native call (inducing type wrapping and so on). Is there any chance that the minMaxLoc workaround will be applied to minMaxIdx in the future? |
2016-04-14 01:33:33 -0600 | asked a question | minMaxIdx missing in the JNI interface? Hi, I have downloaded the 3.1.0 version of OpenCV and I use the JNI bindings in one of my project. My problem is that I don't find minMaxIdx in Core. Only minMaxLoc is available, but this function is limited to 2-dimensionnal arrays. Is there any technical reason for minMaxIdx to be excluded of the JNI interface? Thanks. |