Java/Python bindings for computeCorrespondEpilines added.
authorAlexander Smorkalov <alexander.smorkalov@itseez.com>
Thu, 13 Jun 2013 11:38:21 +0000 (15:38 +0400)
committerAlexander Smorkalov <alexander.smorkalov@itseez.com>
Tue, 18 Jun 2013 12:44:23 +0000 (16:44 +0400)
Simle Java test for computeCorrespondEpilines added.

modules/calib3d/include/opencv2/calib3d/calib3d.hpp
modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java

index 0d1cc46..f213a11 100644 (file)
@@ -639,9 +639,9 @@ CV_EXPORTS Mat findFundamentalMat( InputArray points1, InputArray points2,
                                    double param1=3., double param2=0.99);
 
 //! finds coordinates of epipolar lines corresponding the specified points
-CV_EXPORTS void computeCorrespondEpilines( InputArray points,
-                                           int whichImage, InputArray F,
-                                           OutputArray lines );
+CV_EXPORTS_W void computeCorrespondEpilines( InputArray points,
+                                             int whichImage, InputArray F,
+                                             OutputArray lines );
 
 CV_EXPORTS_W void triangulatePoints( InputArray projMatr1, InputArray projMatr2,
                                      InputArray projPoints1, InputArray projPoints2,
index 8bcaf58..db806b6 100644 (file)
@@ -585,4 +585,18 @@ public class Calib3dTest extends OpenCVTestCase {
     public void testValidateDisparityMatMatIntIntInt() {
         fail("Not yet implemented");
     }
+
+    public void testComputeCorrespondEpilines()
+    {
+        Mat fundamental = new Mat(3, 3, CvType.CV_64F);
+        fundamental.put(0, 0, 0, -0.577, 0.288, 0.577, 0, 0.288, -0.288, -0.288, 0);
+        MatOfPoint2f left = new MatOfPoint2f();
+        left.alloc(1);
+        left.put(0, 0, 2, 3); //add(new Point(x, y));
+        Mat lines = new Mat();
+        Mat truth = new Mat(1, 1, CvType.CV_32FC3);
+        truth.put(0, 0, -0.70735186, 0.70686162, -0.70588124);
+        Calib3d.computeCorrespondEpilines(left, 1, fundamental, lines);
+        assertMatEqual(truth, lines, EPS);
+    }
 }