diff --git a/modules/java/src/cpp/utils.cpp b/modules/java/src/cpp/utils.cpp index 62ebdf9dcf..a4af44752e 100644 --- a/modules/java/src/cpp/utils.cpp +++ b/modules/java/src/cpp/utils.cpp @@ -150,12 +150,28 @@ void vector_KeyPoint_to_Mat(vector& v_kp, Mat& mat) //vector_Mat void Mat_to_vector_Mat(cv::Mat& mat, std::vector& v_mat) { - return; + v_mat.clear(); + if(mat.type() == CV_32SC2 && mat.rows == 1) + { + for(int i=0; i a = mat.at< Vec >(0, i); + long long addr = (((long long)a[0])<<32) | a[1]; + Mat& m = *( (Mat*) addr ); + v_mat.push_back(m); + } + } } void vector_Mat_to_Mat(std::vector& v_mat, cv::Mat& mat) { + int count = v_mat.size(); + mat.create(1, count, CV_32SC2); + for(int i=0; i >(0, i) = Vec(addr>>32, addr&0xffffffff); + } return; } -