Ask Your Question

Revision history [back]

CV_EXPORTS_W, namespaces and java

Hello,

having functions with indentical signature in different namespaces is no problem in C++. If taged with CV_EXPORTS_W this works in python to, but not in java (at least not here).It gives a name-collision.

Is there a way to make this work? For example by mapping namespaces to packages? (org.opencv.aruco and org.opencv.aruco.fisheye?)

CV_EXPORTS_W, namespaces and java

Hello,

having functions with indentical signature in different namespaces is no problem in C++. If taged with CV_EXPORTS_W this works in python to, but not in java (at least not here).It gives a name-collision.

Is there a way to make this work? For example by mapping namespaces to packages? (org.opencv.aruco and org.opencv.aruco.fisheye?)

Edit:

For example: I added (cloned) a function into an namespace:

cv::fisheye::getOptimalNewCameraMatrix (InputArray cameraMatrix, InputArray distCoeffs, Size imgSize, double alpha, Size newImgSize=Size(), Rect *validPixROI=0, bool centerPrincipalPoint=false)

which already exists with same signature in namespace cv:: The automatic generated python bindings get cv2.getOptimalNewCameraMatrix() and cv2.fisheye.getOptimalNewCameraMatrix(), but the automatic generated java binding got a name collision when I build opencv+contrib for android.

CV_EXPORTS_W, namespaces and java

Hello,

having functions with indentical signature in different namespaces is no problem in C++. If taged with CV_EXPORTS_W this works in python to, but not in java (at least not here).It gives a name-collision.

Is there a way to make this work? For example by mapping namespaces to packages? (org.opencv.aruco and org.opencv.aruco.fisheye?)

Edit:

For example: I added (cloned) a function into an namespace:

cv::fisheye::getOptimalNewCameraMatrix (InputArray cameraMatrix, InputArray distCoeffs, Size imgSize, double alpha, Size newImgSize=Size(), Rect *validPixROI=0, bool centerPrincipalPoint=false)

which already exists with same signature in namespace cv:: The automatic generated python bindings get cv2.getOptimalNewCameraMatrix() and cv2.fisheye.getOptimalNewCameraMatrix(), but the automatic generated java binding got a name collision when I build opencv+contrib for android.

Edit2:

Error messages:

FAILED: cd /home/mabe7492/software/opencv/test/o4a/android_sdk && /usr/bin/ant -q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6 && /usr/bin/cmake -E touch /home/mabe7492/software/opencv/test/o4a/CMakeFiles/dephelper/opencv_java_android
   [subant] No sub-builds to iterate on
    …
    [javac] …/test/o4a/android_sdk/src/org/opencv/calib3d/Calib3d.java:314: error: method getOptimalNewCameraMatrix(Mat,Mat,Size,double,Size,Rect,boolean) is already defined in class Calib3d
    [javac]     public static Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imgSize, double alpha, Size newImgSize, Rect validPixROI, boolean centerPrincipalPoint)
    [javac]                       ^
    [javac] …/o4a/android_sdk/src/org/opencv/calib3d/Calib3d.java:323: error: method getOptimalNewCameraMatrix(Mat,Mat,Size,double) is already defined in class Calib3d
    [javac]     public static Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imgSize, double alpha)
    [javac]                       ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.