mirror of
https://github.com/opencv/opencv.git
synced 2026-07-28 23:03:03 +04:00
Add Java wrapper support for List<List<Mat>>
- Added vector_vector_Mat to gen_dict.json - Implemented Mat_to_vector_vector_Mat and vector_vector_Mat_to_Mat conversion functions in converters.h/cpp and Converters.java - Added DnnForwardAndRetrieve.java test to verify List<List<Mat>> conversion : Reference: C++ test in modules/dnn/test/test_misc.cpp - TEST(Net, forwardAndRetrieve)
This commit is contained in:
@@ -232,6 +232,32 @@ void vector_Mat_to_Mat(std::vector<cv::Mat>& v_mat, cv::Mat& mat)
|
||||
}
|
||||
}
|
||||
|
||||
void Mat_to_vector_vector_Mat(Mat& mat, std::vector< std::vector< Mat > >& vv_mat)
|
||||
{
|
||||
std::vector<Mat> vm;
|
||||
vm.reserve( mat.rows );
|
||||
Mat_to_vector_Mat(mat, vm);
|
||||
for(size_t i=0; i<vm.size(); i++)
|
||||
{
|
||||
std::vector<Mat> vmat;
|
||||
Mat_to_vector_Mat(vm[i], vmat);
|
||||
vv_mat.push_back(vmat);
|
||||
}
|
||||
}
|
||||
|
||||
void vector_vector_Mat_to_Mat(std::vector< std::vector< Mat > >& vv_mat, Mat& mat)
|
||||
{
|
||||
std::vector<Mat> vm;
|
||||
vm.reserve( vv_mat.size() );
|
||||
for(size_t i=0; i<vv_mat.size(); i++)
|
||||
{
|
||||
Mat m;
|
||||
vector_Mat_to_Mat(vv_mat[i], m);
|
||||
vm.push_back(m);
|
||||
}
|
||||
vector_Mat_to_Mat(vm, mat);
|
||||
}
|
||||
|
||||
void Mat_to_vector_vector_Point(Mat& mat, std::vector< std::vector< Point > >& vv_pt)
|
||||
{
|
||||
std::vector<Mat> vm;
|
||||
|
||||
@@ -50,6 +50,9 @@ void vector_Vec6f_to_Mat(std::vector<cv::Vec6f>& v_vec, cv::Mat& mat);
|
||||
void Mat_to_vector_Mat(cv::Mat& mat, std::vector<cv::Mat>& v_mat);
|
||||
void vector_Mat_to_Mat(std::vector<cv::Mat>& v_mat, cv::Mat& mat);
|
||||
|
||||
void Mat_to_vector_vector_Mat(cv::Mat& mat, std::vector< std::vector< cv::Mat > >& vv_mat);
|
||||
void vector_vector_Mat_to_Mat(std::vector< std::vector< cv::Mat > >& vv_mat, cv::Mat& mat);
|
||||
|
||||
void Mat_to_vector_vector_char(cv::Mat& mat, std::vector< std::vector< char > >& vv_ch);
|
||||
void vector_vector_char_to_Mat(std::vector< std::vector< char > >& vv_ch, cv::Mat& mat);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user