diff --git a/modules/core/misc/java/gen_dict.json b/modules/core/misc/java/gen_dict.json index 44505b6b8d..36b2c58e58 100644 --- a/modules/core/misc/java/gen_dict.json +++ b/modules/core/misc/java/gen_dict.json @@ -765,6 +765,15 @@ "v_type": "Mat", "j_import": "org.opencv.core.MatOfRect2d" }, + "vector_RotatedRect": { + "j_type": "MatOfRotatedRect", + "jn_type": "long", + "jni_type": "jlong", + "jni_var": "std::vector< RotatedRect > %(n)s", + "suffix": "J", + "v_type": "Mat", + "j_import": "org.opencv.core.MatOfRotatedRect" + }, "vector_String": { "j_type": "List", "jn_type": "List", diff --git a/modules/java/generator/src/cpp/converters.cpp b/modules/java/generator/src/cpp/converters.cpp index 11511200e1..9c4caaccca 100644 --- a/modules/java/generator/src/cpp/converters.cpp +++ b/modules/java/generator/src/cpp/converters.cpp @@ -107,6 +107,20 @@ void vector_Rect2d_to_Mat(std::vector& v_rect, Mat& mat) mat = Mat(v_rect, true); } +//vector_RotatedRect + +void Mat_to_vector_RotatedRect(Mat& mat, std::vector& v_rect) +{ + v_rect.clear(); + CHECK_MAT(mat.type()==CV_32FC(5) && mat.cols==1); + v_rect = (std::vector) mat; +} + +void vector_RotatedRect_to_Mat(std::vector& v_rect, Mat& mat) +{ + mat = Mat(v_rect, true); +} + //vector_Point void Mat_to_vector_Point(Mat& mat, std::vector& v_point) { diff --git a/modules/java/generator/src/cpp/converters.h b/modules/java/generator/src/cpp/converters.h index 27c2ded3a8..019d7d698f 100644 --- a/modules/java/generator/src/cpp/converters.h +++ b/modules/java/generator/src/cpp/converters.h @@ -26,6 +26,8 @@ void vector_Rect_to_Mat(std::vector& v_rect, cv::Mat& mat); void Mat_to_vector_Rect2d(cv::Mat& mat, std::vector& v_rect); void vector_Rect2d_to_Mat(std::vector& v_rect, cv::Mat& mat); +void Mat_to_vector_RotatedRect(cv::Mat& mat, std::vector& v_rect); +void vector_RotatedRect_to_Mat(std::vector& v_rect, cv::Mat& mat); void Mat_to_vector_Point(cv::Mat& mat, std::vector& v_point); void Mat_to_vector_Point2f(cv::Mat& mat, std::vector& v_point);