From 5a5fe405424f06c3dc33b5ab81f3467c9b02e50f Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Sat, 16 Jul 2011 08:25:05 +0000 Subject: [PATCH] Java API generator: implementation of vector support --- modules/java/src/cpp/utils.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/java/src/cpp/utils.cpp b/modules/java/src/cpp/utils.cpp index 89d4d2ce8b..557bb440b4 100644 --- a/modules/java/src/cpp/utils.cpp +++ b/modules/java/src/cpp/utils.cpp @@ -65,12 +65,23 @@ void vector_Rect_to_Mat(vector& v_rect, Mat& mat) //vector_Point void Mat_to_vector_Point(Mat& mat, vector& v_point) { + v_point.clear(); + + if(mat.type()!= CV_32SC2 || mat.rows!=1) + return; + + for(int i=0; i >(0, i) ) ); + return; } void vector_Point_to_Mat(vector& v_point, Mat& mat) { + mat.create(1, v_point.size(), CV_32SC2); + for(int i=0; i >(0, i) = Vec(v_point[i].x, v_point[i].y); return; }