diff --git a/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java b/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java index 826f2bfa55..4fdaf731f9 100644 --- a/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java +++ b/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java @@ -3,9 +3,9 @@ package org.opencv.test.calib3d; import org.opencv.calib3d.Calib3d; import org.opencv.core.Core; import org.opencv.core.CvType; -import org.opencv.core.CvVectorPoint2f; -import org.opencv.core.CvVectorPoint3f; import org.opencv.core.Mat; +import org.opencv.core.MatOfPoint2f; +import org.opencv.core.MatOfPoint3f; import org.opencv.core.Point; import org.opencv.core.Scalar; import org.opencv.core.Size; @@ -235,14 +235,14 @@ public class Calib3dTest extends OpenCVTestCase { public void testFindFundamentalMatListOfPointListOfPoint() { int minFundamentalMatPoints = 8; - CvVectorPoint2f pts1 = new CvVectorPoint2f(); - CvVectorPoint2f pts2 = new CvVectorPoint2f(); + MatOfPoint2f pts1 = new MatOfPoint2f(); + MatOfPoint2f pts2 = new MatOfPoint2f(); pts2.alloc(minFundamentalMatPoints); for (int i = 0; i < minFundamentalMatPoints; i++) { double x = Math.random() * 100 - 50; double y = Math.random() * 100 - 50; - pts1.push_back(new CvVectorPoint2f(new Point(x, y))); //add(new Point(x, y)); + pts1.push_back(new MatOfPoint2f(new Point(x, y))); //add(new Point(x, y)); pts2.put(i, 0, x, y); //add(new Point(x, y)); } @@ -272,9 +272,9 @@ public class Calib3dTest extends OpenCVTestCase { public void testFindHomographyListOfPointListOfPoint() { final int NUM = 20; - CvVectorPoint2f originalPoints = new CvVectorPoint2f(); + MatOfPoint2f originalPoints = new MatOfPoint2f(); originalPoints.alloc(NUM); - CvVectorPoint2f transformedPoints = new CvVectorPoint2f(); + MatOfPoint2f transformedPoints = new MatOfPoint2f(); transformedPoints.alloc(NUM); for (int i = 0; i < NUM; i++) { @@ -503,9 +503,9 @@ public class Calib3dTest extends OpenCVTestCase { final int minPnpPointsNum = 4; - CvVectorPoint3f points3d = new CvVectorPoint3f(); + MatOfPoint3f points3d = new MatOfPoint3f(); points3d.alloc(minPnpPointsNum); - CvVectorPoint2f points2d = new CvVectorPoint2f(); + MatOfPoint2f points2d = new MatOfPoint2f(); points2d.alloc(minPnpPointsNum); for (int i = 0; i < minPnpPointsNum; i++) { diff --git a/modules/java/android_test/src/org/opencv/test/core/CoreTest.java b/modules/java/android_test/src/org/opencv/test/core/CoreTest.java index 67ace46476..6c8b137252 100644 --- a/modules/java/android_test/src/org/opencv/test/core/CoreTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/CoreTest.java @@ -1,13 +1,17 @@ package org.opencv.test.core; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import org.opencv.core.Core; import org.opencv.core.Core.MinMaxLocResult; import org.opencv.core.CvException; import org.opencv.core.CvType; -import org.opencv.core.CvVectorDouble; -import org.opencv.core.CvVectorInt; -import org.opencv.core.CvVectorPoint; import org.opencv.core.Mat; +import org.opencv.core.MatOfDouble; +import org.opencv.core.MatOfInt; +import org.opencv.core.MatOfPoint; import org.opencv.core.Point; import org.opencv.core.Rect; import org.opencv.core.RotatedRect; @@ -16,10 +20,6 @@ import org.opencv.core.Size; import org.opencv.core.TermCriteria; import org.opencv.test.OpenCVTestCase; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - public class CoreTest extends OpenCVTestCase { public void testAbsdiff() { @@ -485,7 +485,7 @@ public class CoreTest extends OpenCVTestCase { int arcStart = 30; int arcEnd = 60; int delta = 2; - CvVectorPoint pts = new CvVectorPoint(); + MatOfPoint pts = new MatOfPoint(); Core.ellipse2Poly(center, axes, angle, arcStart, arcEnd, delta, pts); @@ -507,7 +507,7 @@ public class CoreTest extends OpenCVTestCase { new Point(4, 6), new Point(4, 6) }; - assertArrayPointsEquals(truth, pts.toArray(null), EPS); + assertArrayPointsEquals(truth, pts.toArray(), EPS); } public void testEllipseMatPointSizeDoubleDoubleDoubleScalar() { @@ -621,7 +621,7 @@ public class CoreTest extends OpenCVTestCase { } public void testFillConvexPolyMatListOfPointScalar() { - CvVectorPoint polyline = new CvVectorPoint(new Point[]{new Point(1, 1), new Point(5, 0), new Point(6, 8), new Point(0, 9)}); + MatOfPoint polyline = new MatOfPoint(new Point[]{new Point(1, 1), new Point(5, 0), new Point(6, 8), new Point(0, 9)}); Core.fillConvexPoly(gray0, polyline, new Scalar(150)); @@ -630,8 +630,8 @@ public class CoreTest extends OpenCVTestCase { } public void testFillConvexPolyMatListOfPointScalarIntInt() { - CvVectorPoint polyline1 = new CvVectorPoint(new Point(2, 1), new Point(5, 1), new Point(5, 7), new Point(2, 7)); - CvVectorPoint polyline2 = new CvVectorPoint(new Point(4, 2), new Point(10, 2), new Point(10, 14), new Point(4, 14)); + MatOfPoint polyline1 = new MatOfPoint(new Point(2, 1), new Point(5, 1), new Point(5, 7), new Point(2, 7)); + MatOfPoint polyline2 = new MatOfPoint(new Point(4, 2), new Point(10, 2), new Point(10, 14), new Point(4, 14)); // current implementation of fixed-point version of fillConvexPoly // requires image to be at least 2-pixel wider in each direction than @@ -649,8 +649,8 @@ public class CoreTest extends OpenCVTestCase { public void testFillPolyMatListOfListOfPointScalar() { int matSize = 10; Mat gray0 = Mat.zeros(matSize, matSize, CvType.CV_8U); - CvVectorPoint polyline = new CvVectorPoint(new Point(1, 4), new Point(1, 8), new Point(4, 1), new Point(7, 8), new Point(7, 4)); - List polylines = new ArrayList(); + MatOfPoint polyline = new MatOfPoint(new Point(1, 4), new Point(1, 8), new Point(4, 1), new Point(7, 8), new Point(7, 4)); + List polylines = new ArrayList(); polylines.add(polyline); Core.fillPoly(gray0, polylines, new Scalar(1)); @@ -675,13 +675,13 @@ public class CoreTest extends OpenCVTestCase { } public void testFillPolyMatListOfListOfPointScalarIntIntPoint() { - CvVectorPoint polyline1 = new CvVectorPoint(new Point(1, 4), new Point(1, 8), new Point(4, 1), new Point(7, 8), new Point(7, 4)); - CvVectorPoint polyline2 = new CvVectorPoint(new Point(0, 3), new Point(0, 7), new Point(3, 0), new Point(6, 7), new Point(6, 3)); + MatOfPoint polyline1 = new MatOfPoint(new Point(1, 4), new Point(1, 8), new Point(4, 1), new Point(7, 8), new Point(7, 4)); + MatOfPoint polyline2 = new MatOfPoint(new Point(0, 3), new Point(0, 7), new Point(3, 0), new Point(6, 7), new Point(6, 3)); - List polylines1 = new ArrayList(); + List polylines1 = new ArrayList(); polylines1.add(polyline1); - List polylines2 = new ArrayList(); + List polylines2 = new ArrayList(); polylines2.add(polyline2); Core.fillPoly(gray0, polylines1, new Scalar(1), Core.LINE_8, 0, new Point(0, 0)); @@ -1194,8 +1194,8 @@ public class CoreTest extends OpenCVTestCase { } public void testMeanStdDevMatMatMat() { - CvVectorDouble mean = new CvVectorDouble(); - CvVectorDouble stddev = new CvVectorDouble(); + MatOfDouble mean = new MatOfDouble(); + MatOfDouble stddev = new MatOfDouble(); Core.meanStdDev(rgbLena, mean, stddev); @@ -1204,8 +1204,8 @@ public class CoreTest extends OpenCVTestCase { double expectedDev[] = new double[] {33.74205485167219, 52.8734582803278, 49.01569488056406}; - assertArrayEquals(expectedMean, mean.toPrimitiveArray(null), EPS); - assertArrayEquals(expectedDev, stddev.toPrimitiveArray(null), EPS); + assertArrayEquals(expectedMean, mean.toArray(), EPS); + assertArrayEquals(expectedDev, stddev.toArray(), EPS); } public void testMeanStdDevMatMatMatMat() { @@ -1214,16 +1214,16 @@ public class CoreTest extends OpenCVTestCase { Mat mask = gray0.clone(); submat = mask.submat(0, mask.rows() / 2, 0, mask.cols() / 2); submat.setTo(new Scalar(1)); - CvVectorDouble mean = new CvVectorDouble(); - CvVectorDouble stddev = new CvVectorDouble(); + MatOfDouble mean = new MatOfDouble(); + MatOfDouble stddev = new MatOfDouble(); Core.meanStdDev(grayRnd, mean, stddev, mask); double expectedMean[] = new double[] {33d}; double expectedDev[] = new double[] {0d}; - assertArrayEquals(expectedMean, mean.toPrimitiveArray(null), EPS); - assertArrayEquals(expectedDev, stddev.toPrimitiveArray(null), EPS); + assertArrayEquals(expectedMean, mean.toArray(), EPS); + assertArrayEquals(expectedDev, stddev.toArray(), EPS); } public void testMerge() { @@ -1284,7 +1284,7 @@ public class CoreTest extends OpenCVTestCase { rgba0.setTo(new Scalar(10, 20, 30, 40)); List src = Arrays.asList(rgba0); List dst = Arrays.asList(gray3, gray2, gray1, gray0, getMat(CvType.CV_8UC3, 0, 0, 0)); - CvVectorInt fromTo = new CvVectorInt(1, new int[] + MatOfInt fromTo = new MatOfInt(1, new int[] { 3, 0, 3, 1, 2, 2, @@ -1745,8 +1745,8 @@ public class CoreTest extends OpenCVTestCase { public void testPolylinesMatListOfListOfPointBooleanScalar() { Mat img = gray0; - List polyline = new ArrayList(); - polyline.add(new CvVectorPoint(new Point(1, 1), new Point(7, 1), new Point(7, 6), new Point(1, 6))); + List polyline = new ArrayList(); + polyline.add(new MatOfPoint(new Point(1, 1), new Point(7, 1), new Point(7, 6), new Point(1, 6))); Core.polylines(img, polyline, true, new Scalar(100)); @@ -1759,8 +1759,8 @@ public class CoreTest extends OpenCVTestCase { public void testPolylinesMatListOfListOfPointBooleanScalarInt() { Mat img = gray0; - List polyline = new ArrayList(); - polyline.add(new CvVectorPoint(new Point(1, 1), new Point(7, 1), new Point(7, 6), new Point(1, 6))); + List polyline = new ArrayList(); + polyline.add(new MatOfPoint(new Point(1, 1), new Point(7, 1), new Point(7, 6), new Point(1, 6))); Core.polylines(img, polyline, true, new Scalar(100), 2); @@ -1769,10 +1769,10 @@ public class CoreTest extends OpenCVTestCase { public void testPolylinesMatListOfListOfPointBooleanScalarIntIntInt() { Mat img = gray0; - List polyline1 = new ArrayList(); - polyline1.add(new CvVectorPoint(new Point(1, 1), new Point(7, 1), new Point(7, 6), new Point(1, 6))); - List polyline2 = new ArrayList(); - polyline2.add(new CvVectorPoint(new Point(2, 2), new Point(14, 2), new Point(14, 12), new Point(2, 12))); + List polyline1 = new ArrayList(); + polyline1.add(new MatOfPoint(new Point(1, 1), new Point(7, 1), new Point(7, 6), new Point(1, 6))); + List polyline2 = new ArrayList(); + polyline2.add(new MatOfPoint(new Point(2, 2), new Point(14, 2), new Point(14, 12), new Point(2, 12))); Core.polylines(img, polyline1, true, new Scalar(100), 2, Core.LINE_8, 0); diff --git a/modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java b/modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java index d22745b79e..15457e2af8 100644 --- a/modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java +++ b/modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java @@ -1,6 +1,6 @@ package org.opencv.test.highgui; -import org.opencv.core.CvVectorByte; +import org.opencv.core.MatOfByte; import org.opencv.highgui.Highgui; import org.opencv.test.OpenCVTestCase; import org.opencv.test.OpenCVTestRunner; @@ -12,7 +12,7 @@ public class HighguiTest extends OpenCVTestCase { } public void testImencodeStringMatListOfByte() { - CvVectorByte buff = new CvVectorByte(); + MatOfByte buff = new MatOfByte(); assertEquals(0, buff.size()); assertTrue( Highgui.imencode(".jpg", gray127, buff) ); assertFalse(0 == buff.total()); diff --git a/modules/java/android_test/src/org/opencv/test/objdetect/CascadeClassifierTest.java b/modules/java/android_test/src/org/opencv/test/objdetect/CascadeClassifierTest.java index f514945e29..5304fac21e 100644 --- a/modules/java/android_test/src/org/opencv/test/objdetect/CascadeClassifierTest.java +++ b/modules/java/android_test/src/org/opencv/test/objdetect/CascadeClassifierTest.java @@ -1,7 +1,7 @@ package org.opencv.test.objdetect; -import org.opencv.core.CvVectorRect; import org.opencv.core.Mat; +import org.opencv.core.MatOfRect; import org.opencv.core.Size; import org.opencv.imgproc.Imgproc; import org.opencv.objdetect.CascadeClassifier; @@ -32,7 +32,7 @@ public class CascadeClassifierTest extends OpenCVTestCase { public void testDetectMultiScaleMatListOfRect() { CascadeClassifier cc = new CascadeClassifier(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH); - CvVectorRect faces = new CvVectorRect(); + MatOfRect faces = new MatOfRect(); Mat greyLena = new Mat(); Imgproc.cvtColor(rgbLena, greyLena, Imgproc.COLOR_RGB2GRAY); diff --git a/modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java b/modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java index 28d25a8098..5dba1b062a 100644 --- a/modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java +++ b/modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java @@ -1,6 +1,6 @@ package org.opencv.test.objdetect; -import org.opencv.core.CvVectorRect; +import org.opencv.core.MatOfRect; import org.opencv.objdetect.Objdetect; import org.opencv.test.OpenCVTestCase; @@ -9,7 +9,8 @@ public class ObjdetectTest extends OpenCVTestCase { public void testGroupRectanglesListOfRectListOfIntegerInt() { fail("Not yet implemented"); final int NUM = 10; - CvVectorRect rects = new CvVectorRect(NUM); + MatOfRect rects = new MatOfRect(); + rects.alloc(NUM); for (int i = 0; i < NUM; i++) rects.put(i, 0, 10, 10, 20, 20); @@ -22,7 +23,8 @@ public class ObjdetectTest extends OpenCVTestCase { public void testGroupRectanglesListOfRectListOfIntegerIntDouble() { fail("Not yet implemented"); final int NUM = 10; - CvVectorRect rects = new CvVectorRect(NUM); + MatOfRect rects = new MatOfRect(); + rects.alloc(NUM); for (int i = 0; i < NUM; i++) rects.put(i, 0, 10, 10, 20, 20); diff --git a/modules/java/android_test/src/org/opencv/test/video/VideoTest.java b/modules/java/android_test/src/org/opencv/test/video/VideoTest.java index f9945047ae..cb549bb0d8 100644 --- a/modules/java/android_test/src/org/opencv/test/video/VideoTest.java +++ b/modules/java/android_test/src/org/opencv/test/video/VideoTest.java @@ -1,10 +1,10 @@ package org.opencv.test.video; import org.opencv.core.Core; -import org.opencv.core.CvVectorByte; -import org.opencv.core.CvVectorFloat; -import org.opencv.core.CvVectorPoint2f; import org.opencv.core.Mat; +import org.opencv.core.MatOfByte; +import org.opencv.core.MatOfFloat; +import org.opencv.core.MatOfPoint2f; import org.opencv.core.Point; import org.opencv.core.Size; import org.opencv.test.OpenCVTestCase; @@ -12,15 +12,15 @@ import org.opencv.video.Video; public class VideoTest extends OpenCVTestCase { - private CvVectorFloat err = null; + private MatOfFloat err = null; private int h; - private CvVectorPoint2f nextPts = null; - private CvVectorPoint2f prevPts = null; + private MatOfPoint2f nextPts = null; + private MatOfPoint2f prevPts = null; private int shift1; private int shift2; - private CvVectorByte status = null; + private MatOfByte status = null; private Mat subLena1 = null; private Mat subLena2 = null; private int w; @@ -37,11 +37,11 @@ public class VideoTest extends OpenCVTestCase { subLena1 = rgbLena.submat(shift1, h + shift1, shift1, w + shift1); subLena2 = rgbLena.submat(shift2, h + shift2, shift2, w + shift2); - prevPts = new CvVectorPoint2f(new Point(11d, 8d), new Point(5d, 5d), new Point(10d, 10d)); + prevPts = new MatOfPoint2f(new Point(11d, 8d), new Point(5d, 5d), new Point(10d, 10d)); - nextPts = new CvVectorPoint2f(); - status = new CvVectorByte(); - err = new CvVectorFloat(); + nextPts = new MatOfPoint2f(); + status = new MatOfByte(); + err = new MatOfFloat(); } public void testCalcGlobalOrientation() { diff --git a/modules/java/gen_java.py b/modules/java/gen_java.py index 79688aae05..fce6edce51 100644 --- a/modules/java/gen_java.py +++ b/modules/java/gen_java.py @@ -193,30 +193,30 @@ type_dict = { # "complex" : { j_type : "?", jn_args : (("", ""),), jn_name : "", jni_var : "", jni_name : "", "suffix" : "?" }, - "vector_Point" : { "j_type" : "CvVectorPoint", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_Point2f" : { "j_type" : "CvVectorPoint2f", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_Point2d" : { "j_type" : "CvVectorPoint2f", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_Point3i" : { "j_type" : "CvVectorPoint3", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_Point3f" : { "j_type" : "CvVectorPoint3f", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_Point3d" : { "j_type" : "CvVectorPoint3f", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_KeyPoint" : { "j_type" : "CvVectorKeyPoint", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_DMatch" : { "j_type" : "CvVectorDMatch", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_Rect" : { "j_type" : "CvVectorRect", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_uchar" : { "j_type" : "CvVectorByte", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_char" : { "j_type" : "CvVectorByte", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_int" : { "j_type" : "CvVectorInt", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_float" : { "j_type" : "CvVectorFloat", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_double" : { "j_type" : "CvVectorDouble", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_Vec4f" : { "j_type" : "CvVectorFloat4", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_Vec6f" : { "j_type" : "CvVectorFloat6", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_Point" : { "j_type" : "MatOfPoint", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_Point2f" : { "j_type" : "MatOfPoint2f", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_Point2d" : { "j_type" : "MatOfPoint2f", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_Point3i" : { "j_type" : "MatOfPoint3", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_Point3f" : { "j_type" : "MatOfPoint3f", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_Point3d" : { "j_type" : "MatOfPoint3f", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_KeyPoint" : { "j_type" : "MatOfKeyPoint", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_DMatch" : { "j_type" : "MatOfDMatch", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_Rect" : { "j_type" : "MatOfRect", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_uchar" : { "j_type" : "MatOfByte", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_char" : { "j_type" : "MatOfByte", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_int" : { "j_type" : "MatOfInt", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_float" : { "j_type" : "MatOfFloat", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_double" : { "j_type" : "MatOfDouble", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_Vec4f" : { "j_type" : "MatOfFloat", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, + "vector_Vec6f" : { "j_type" : "MatOfFloat", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, "vector_Mat" : { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector %(n)s", "suffix" : "J" }, - "vector_vector_KeyPoint": { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, - "vector_vector_DMatch" : { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, - "vector_vector_char" : { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, - "vector_vector_Point" : { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, - "vector_vector_Point2f" : { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, + "vector_vector_KeyPoint": { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, + "vector_vector_DMatch" : { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, + "vector_vector_char" : { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, + "vector_vector_Point" : { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, + "vector_vector_Point2f" : { "j_type" : "List", "jn_type" : "long", "jni_type" : "jlong", "jni_var" : "vector< vector > %(n)s" }, "Mat" : { "j_type" : "Mat", "jn_type" : "long", "jn_args" : (("__int64", ".nativeObj"),), "jni_var" : "Mat& %(n)s = *((Mat*)%(n)s_nativeObj)", @@ -897,7 +897,7 @@ extern "C" { imports = self.classes[scope_classname or self.Module].imports if ctype.startswith('vector'): imports.add("org.opencv.core.Mat") - if type_dict[ctype]['j_type'].startswith('CvVector'): + if type_dict[ctype]['j_type'].startswith('MatOf'): imports.add("org.opencv.core." + type_dict[ctype]['j_type']) return #TMP else: @@ -1001,18 +1001,18 @@ extern "C" { j_prologue.append( "List %(n)s_tmplm = new ArrayList((%(n)s != null) ? %(n)s.size() : 0);" % {"n" : a.name } ) j_prologue.append( "Mat %(n)s_mat = Converters.%(t)s_to_Mat(%(n)s, %(n)s_tmplm);" % {"n" : a.name, "t" : a.ctype} ) else: - if not type_dict[a.ctype]["j_type"].startswith("CvVector"): + if not type_dict[a.ctype]["j_type"].startswith("MatOf"): j_prologue.append( "Mat %(n)s_mat = Converters.%(t)s_to_Mat(%(n)s);" % {"n" : a.name, "t" : a.ctype} ) else: j_prologue.append( "Mat %s_mat = %s;" % (a.name, a.name) ) c_prologue.append( "Mat_to_%(t)s( %(n)s_mat, %(n)s );" % {"n" : a.name, "t" : a.ctype} ) else: - if not type_dict[a.ctype]["j_type"].startswith("CvVector"): + if not type_dict[a.ctype]["j_type"].startswith("MatOf"): j_prologue.append( "Mat %s_mat = new Mat();" % a.name ) else: j_prologue.append( "Mat %s_mat = %s;" % (a.name, a.name) ) if "O" in a.out: - if not type_dict[a.ctype]["j_type"].startswith("CvVector"): + if not type_dict[a.ctype]["j_type"].startswith("MatOf"): j_epilogue.append("Converters.Mat_to_%(t)s(%(n)s_mat, %(n)s);" % {"t" : a.ctype, "n" : a.name}) c_epilogue.append( "%(t)s_to_Mat( %(n)s, %(n)s_mat );" % {"n" : a.name, "t" : a.ctype} ) else: @@ -1074,8 +1074,14 @@ extern "C" { if ret_type.startswith('vector'): tail = ")" j_type = type_dict[ret_type]["j_type"] - if j_type.startswith('CvVector'): + if j_type.startswith('MatOf'): ret_val += "new " + j_type + "(" + m_t = re.match('vector_(\w+)', ret_type) + m_ch = re.match('vector_Vec(\d+)', ret_type) + if m_ch: + ret_val += m_ch.group(1) + ', ' + elif m_t.group(1) in ('char', 'uchar', 'int', 'float', 'double'): + ret_val += '1, ' else: ret_val = "Mat retValMat = new Mat(" j_prologue.append( j_type + ' retVal = new Array' + j_type+'();') diff --git a/modules/java/src/java/core+CvVector.java b/modules/java/src/java/core+CvVector.java deleted file mode 100644 index 11fafca62a..0000000000 --- a/modules/java/src/java/core+CvVector.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.opencv.core; - -public class CvVector extends Mat { - protected int depth; - protected int channels; - - protected CvVector(int d, int ch) { - super(); - depth = d; - channels = ch; - } - - protected CvVector(int d, int ch, long addr) { - super(addr); - depth = d; - channels = ch; - if( !empty() && checkVector(channels, depth) < 0 ) - throw new IllegalArgumentException("Incomatible Mat"); - //FIXME: do we need release() here? - } - - protected CvVector(int d, int ch, Mat m) { - super(m, Range.all()); - depth = d; - channels = ch; - if( !empty() && checkVector(channels, depth) < 0 ) - throw new IllegalArgumentException("Incomatible Mat"); - //FIXME: do we need release() here? - } - - protected void create(int cnt) { - if(cnt>0) - super.create(cnt, 1, CvType.makeType(depth, channels)); - } -} diff --git a/modules/java/src/java/core+CvVectorByte.java b/modules/java/src/java/core+CvVectorByte.java deleted file mode 100644 index 9f8fb94291..0000000000 --- a/modules/java/src/java/core+CvVectorByte.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.opencv.core; - -public class CvVectorByte extends CvVector { - private static final int _d = CvType.CV_8U; - - public CvVectorByte(int ch) { - super(_d, ch); - } - - public CvVectorByte() { - this(1); - } - - public CvVectorByte(int ch, long addr) { - super(_d, ch, addr); - } - - public CvVectorByte(long addr) { - super(_d, 1, addr); - } - - public CvVectorByte(int ch, Mat m) { - super(_d, ch, m); - } - - public CvVectorByte(int ch, byte[] a) { - super(_d, ch); - if(a!=null) { - int cnt = a.length / ch; - create(cnt); - put(0, 0, a); - } - } - - public byte[] toPrimitiveArray(byte[] a) { - int cnt = (int) total() * channels; - if(cnt == 0) - return new byte[0];//null; - byte[] res = a; - if(res==null || res.length0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(byte...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public byte[] toArray() { + int num = (int) total(); + byte[] a = new byte[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Byte ab[] = lb.toArray(null); + byte a[] = new byte[ab.length]; + for(int i=0; i toList() { + byte[] a = toArray(); + Byte ab[] = new Byte[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + + public void fromArray(DMatch...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + float buff[] = new float[num * _channels]; + for(int i=0; i ldm) { + DMatch adm[] = ldm.toArray(null); + fromArray(adm); + } + + public List toList() { + DMatch[] adm = toArray(); + return Arrays.asList(adm); + } +} diff --git a/modules/java/src/java/core+MatOfDouble.java b/modules/java/src/java/core+MatOfDouble.java new file mode 100644 index 0000000000..165b9dbdef --- /dev/null +++ b/modules/java/src/java/core+MatOfDouble.java @@ -0,0 +1,81 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfDouble extends Mat { + // 64FC(x) + private static final int _depth = CvType.CV_64F; + private final int _channels; + + public MatOfDouble(int channels) { + super(); + _channels = channels; + } + + public MatOfDouble() { + this(1); + } + + public MatOfDouble(int channels, long addr) { + super(addr); + _channels = channels; + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfDouble(int channels, Mat m) { + super(m, Range.all()); + _channels = channels; + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfDouble(int channels, double...a) { + super(); + _channels = channels; + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(double...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public double[] toArray() { + int num = (int) total(); + double[] a = new double[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Double ab[] = lb.toArray(null); + double a[] = new double[ab.length]; + for(int i=0; i toList() { + double[] a = toArray(); + Double ab[] = new Double[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(float...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public float[] toArray() { + int num = (int) total(); + float[] a = new float[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Float ab[] = lb.toArray(null); + float a[] = new float[ab.length]; + for(int i=0; i toList() { + float[] a = toArray(); + Float ab[] = new Float[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(int...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public int[] toArray() { + int num = (int) total(); + int[] a = new int[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Integer ab[] = lb.toArray(null); + int a[] = new int[ab.length]; + for(int i=0; i toList() { + int[] a = toArray(); + Integer ab[] = new Integer[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(KeyPoint...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + float buff[] = new float[num * _channels]; + for(int i=0; i lkp) { + KeyPoint akp[] = lkp.toArray(null); + fromArray(akp); + } + + public List toList() { + KeyPoint[] akp = toArray(); + return Arrays.asList(akp); + } +} diff --git a/modules/java/src/java/core+MatOfPoint.java b/modules/java/src/java/core+MatOfPoint.java new file mode 100644 index 0000000000..b0dc449987 --- /dev/null +++ b/modules/java/src/java/core+MatOfPoint.java @@ -0,0 +1,74 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfPoint extends Mat { + // 32SC2 + private static final int _depth = CvType.CV_32S; + private static final int _channels = 2; + + public MatOfPoint() { + super(); + } + + public MatOfPoint(long addr) { + super(addr); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint(Mat m) { + super(m, Range.all()); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint(Point...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Point...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + int buff[] = new int[num * _channels]; + for(int i=0; i lp) { + Point ap[] = lp.toArray(null); + fromArray(ap); + } + + public List toList() { + Point[] ap = toArray(); + return Arrays.asList(ap); + } +} diff --git a/modules/java/src/java/core+MatOfPoint2f.java b/modules/java/src/java/core+MatOfPoint2f.java new file mode 100644 index 0000000000..d8667695e2 --- /dev/null +++ b/modules/java/src/java/core+MatOfPoint2f.java @@ -0,0 +1,74 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfPoint2f extends Mat { + // 32FC2 + private static final int _depth = CvType.CV_32F; + private static final int _channels = 2; + + public MatOfPoint2f() { + super(); + } + + public MatOfPoint2f(long addr) { + super(addr); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint2f(Mat m) { + super(m, Range.all()); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint2f(Point...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Point...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + float buff[] = new float[num * _channels]; + for(int i=0; i lp) { + Point ap[] = lp.toArray(null); + fromArray(ap); + } + + public List toList() { + Point[] ap = toArray(); + return Arrays.asList(ap); + } +} diff --git a/modules/java/src/java/core+MatOfPoint3.java b/modules/java/src/java/core+MatOfPoint3.java new file mode 100644 index 0000000000..71a60829d8 --- /dev/null +++ b/modules/java/src/java/core+MatOfPoint3.java @@ -0,0 +1,75 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfPoint3 extends Mat { + // 32SC3 + private static final int _depth = CvType.CV_32S; + private static final int _channels = 3; + + public MatOfPoint3() { + super(); + } + + public MatOfPoint3(long addr) { + super(addr); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint3(Mat m) { + super(m, Range.all()); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint3(Point3...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Point3...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + int buff[] = new int[num * _channels]; + for(int i=0; i lp) { + Point3 ap[] = lp.toArray(null); + fromArray(ap); + } + + public List toList() { + Point3[] ap = toArray(); + return Arrays.asList(ap); + } +} diff --git a/modules/java/src/java/core+MatOfPoint3f.java b/modules/java/src/java/core+MatOfPoint3f.java new file mode 100644 index 0000000000..76e180bc3f --- /dev/null +++ b/modules/java/src/java/core+MatOfPoint3f.java @@ -0,0 +1,75 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfPoint3f extends Mat { + // 32FC3 + private static final int _depth = CvType.CV_32F; + private static final int _channels = 3; + + public MatOfPoint3f() { + super(); + } + + public MatOfPoint3f(long addr) { + super(addr); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint3f(Mat m) { + super(m, Range.all()); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint3f(Point3...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Point3...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + float buff[] = new float[num * _channels]; + for(int i=0; i lp) { + Point3 ap[] = lp.toArray(null); + fromArray(ap); + } + + public List toList() { + Point3[] ap = toArray(); + return Arrays.asList(ap); + } +} diff --git a/modules/java/src/java/core+MatOfRect.java b/modules/java/src/java/core+MatOfRect.java new file mode 100644 index 0000000000..2688b56235 --- /dev/null +++ b/modules/java/src/java/core+MatOfRect.java @@ -0,0 +1,77 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + + +public class MatOfRect extends Mat { + // 32SC4 + private static final int _depth = CvType.CV_32S; + private static final int _channels = 4; + + public MatOfRect() { + super(); + } + + public MatOfRect(long addr) { + super(addr); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfRect(Mat m) { + super(m, Range.all()); + if(checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfRect(Rect...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Rect...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + int buff[] = new int[num * _channels]; + for(int i=0; i lr) { + Rect ap[] = lr.toArray(null); + fromArray(ap); + } + + public List toList() { + Rect[] ar = toArray(); + return Arrays.asList(ar); + } +} diff --git a/modules/java/src/java/utils+Converters.java b/modules/java/src/java/utils+Converters.java index 1b5555a87c..20c8a711ac 100644 --- a/modules/java/src/java/utils+Converters.java +++ b/modules/java/src/java/utils+Converters.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; import org.opencv.core.CvType; -import org.opencv.core.CvVectorPoint2f; import org.opencv.core.Mat; +import org.opencv.core.MatOfByte; +import org.opencv.core.MatOfDMatch; +import org.opencv.core.MatOfKeyPoint; +import org.opencv.core.MatOfPoint; +import org.opencv.core.MatOfPoint2f; import org.opencv.core.Point; import org.opencv.core.Point3; import org.opencv.core.Rect; -import org.opencv.core.CvVectorByte; -import org.opencv.core.CvVectorDMatch; -import org.opencv.core.CvVectorKeyPoint; -import org.opencv.core.CvVectorPoint; import org.opencv.features2d.DMatch; import org.opencv.features2d.KeyPoint; @@ -475,11 +475,11 @@ public class Converters { } // vector_vector_Point - public static Mat vector_vector_Point_to_Mat(List pts, List mats) { + public static Mat vector_vector_Point_to_Mat(List pts, List mats) { Mat res; int lCount = (pts != null) ? pts.size() : 0; if (lCount > 0) { - for (CvVectorPoint vpt : pts) + for (MatOfPoint vpt : pts) mats.add(vpt); res = vector_Mat_to_Mat(mats); } else { @@ -488,7 +488,7 @@ public class Converters { return res; } - public static void Mat_to_vector_vector_Point(Mat m, List pts) { + public static void Mat_to_vector_vector_Point(Mat m, List pts) { if (pts == null) throw new java.lang.IllegalArgumentException("Output List can't be null"); @@ -498,13 +498,13 @@ public class Converters { List mats = new ArrayList(m.rows()); Mat_to_vector_Mat(m, mats); for (Mat mi : mats) { - CvVectorPoint pt = new CvVectorPoint(mi); + MatOfPoint pt = new MatOfPoint(mi); pts.add(pt); } } // vector_vector_Point2f - public static void Mat_to_vector_vector_Point2f(Mat m, List pts) { + public static void Mat_to_vector_vector_Point2f(Mat m, List pts) { if (pts == null) throw new java.lang.IllegalArgumentException("Output List can't be null"); @@ -514,17 +514,17 @@ public class Converters { List mats = new ArrayList(m.rows()); Mat_to_vector_Mat(m, mats); for (Mat mi : mats) { - CvVectorPoint2f pt = new CvVectorPoint2f(mi); + MatOfPoint2f pt = new MatOfPoint2f(mi); pts.add(pt); } } // vector_vector_KeyPoint - public static Mat vector_vector_KeyPoint_to_Mat(List kps, List mats) { + public static Mat vector_vector_KeyPoint_to_Mat(List kps, List mats) { Mat res; int lCount = (kps != null) ? kps.size() : 0; if (lCount > 0) { - for (CvVectorKeyPoint vkp : kps) + for (MatOfKeyPoint vkp : kps) mats.add(vkp); res = vector_Mat_to_Mat(mats); } else { @@ -533,7 +533,7 @@ public class Converters { return res; } - public static void Mat_to_vector_vector_KeyPoint(Mat m, List kps) { + public static void Mat_to_vector_vector_KeyPoint(Mat m, List kps) { if (kps == null) throw new java.lang.IllegalArgumentException("Output List can't be null"); @@ -543,7 +543,7 @@ public class Converters { List mats = new ArrayList(m.rows()); Mat_to_vector_Mat(m, mats); for (Mat mi : mats) { - CvVectorKeyPoint vkp = new CvVectorKeyPoint(mi); + MatOfKeyPoint vkp = new MatOfKeyPoint(mi); kps.add(vkp); } } @@ -618,11 +618,11 @@ public class Converters { } // vector_vector_DMatch - public static Mat vector_vector_DMatch_to_Mat(List lvdm, List mats) { + public static Mat vector_vector_DMatch_to_Mat(List lvdm, List mats) { Mat res; int lCount = (lvdm != null) ? lvdm.size() : 0; if (lCount > 0) { - for (CvVectorDMatch vdm : lvdm) + for (MatOfDMatch vdm : lvdm) mats.add(vdm); res = vector_Mat_to_Mat(mats); } else { @@ -631,7 +631,7 @@ public class Converters { return res; } - public static void Mat_to_vector_vector_DMatch(Mat m, List lvdm) { + public static void Mat_to_vector_vector_DMatch(Mat m, List lvdm) { if (lvdm == null) throw new java.lang.IllegalArgumentException("Output List can't be null"); @@ -642,17 +642,17 @@ public class Converters { Mat_to_vector_Mat(m, mats); lvdm.clear(); for (Mat mi : mats) { - CvVectorDMatch vdm = new CvVectorDMatch(mi); + MatOfDMatch vdm = new MatOfDMatch(mi); lvdm.add(vdm); } } // vector_vector_char - public static Mat vector_vector_char_to_Mat(List lvb, List mats) { + public static Mat vector_vector_char_to_Mat(List lvb, List mats) { Mat res; int lCount = (lvb != null) ? lvb.size() : 0; if (lCount > 0) { - for (CvVectorByte vb : lvb) + for (MatOfByte vb : lvb) mats.add(vb); res = vector_Mat_to_Mat(mats); } else {