Java API: new types and converters are added, jni suffixes changed
This commit is contained in:
@@ -67,6 +67,13 @@ void Mat_to_vector_uchar(Mat& mat, vector<uchar>& v_uchar)
|
||||
v_uchar = (vector<uchar>) mat;
|
||||
}
|
||||
|
||||
void Mat_to_vector_char(Mat& mat, vector<char>& v_char)
|
||||
{
|
||||
v_char.clear();
|
||||
CHECK_MAT(mat.type()==CV_8SC1 && mat.cols==1);
|
||||
v_char = (vector<char>) mat;
|
||||
}
|
||||
|
||||
|
||||
//vector_Rect
|
||||
|
||||
@@ -220,3 +227,29 @@ void vector_Mat_to_Mat(std::vector<cv::Mat>& v_mat, cv::Mat& mat)
|
||||
mat.at< Vec<int, 2> >(i, 0) = Vec<int, 2>(addr>>32, addr&0xffffffff);
|
||||
}
|
||||
}
|
||||
|
||||
//vector_DMatch
|
||||
void Mat_to_vector_DMatch(Mat& mat, vector<DMatch>& v_dm)
|
||||
{
|
||||
v_dm.clear();
|
||||
CHECK_MAT(mat.type()==CV_64FC4 && mat.cols==1);
|
||||
for(int i=0; i<mat.rows; i++)
|
||||
{
|
||||
Vec<double, 4> v = mat.at< Vec<double, 4> >(i, 0);
|
||||
DMatch dm((int)v[0], (int)v[1], (int)v[2], (float)v[3]);
|
||||
v_dm.push_back(dm);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void vector_DMatch_to_Mat(vector<DMatch>& v_dm, Mat& mat)
|
||||
{
|
||||
int count = v_dm.size();
|
||||
mat.create(count, 1, CV_64FC4);
|
||||
for(int i=0; i<count; i++)
|
||||
{
|
||||
DMatch dm = v_dm[i];
|
||||
mat.at< Vec<double, 4> >(i, 0) = Vec<double, 4>(dm.queryIdx, dm.trainIdx, dm.imgIdx, dm.distance);
|
||||
}
|
||||
}
|
||||
|
@@ -6,25 +6,18 @@
|
||||
|
||||
|
||||
void Mat_to_vector_int(cv::Mat& mat, std::vector<int>& v_int);
|
||||
|
||||
void vector_int_to_Mat(std::vector<int>& v_int, cv::Mat& mat);
|
||||
|
||||
|
||||
void Mat_to_vector_double(cv::Mat& mat, std::vector<double>& v_double);
|
||||
|
||||
void vector_double_to_Mat(std::vector<double>& v_double, cv::Mat& mat);
|
||||
|
||||
|
||||
void Mat_to_vector_float(cv::Mat& mat, std::vector<float>& v_float);
|
||||
|
||||
void vector_float_to_Mat(std::vector<float>& v_float, cv::Mat& mat);
|
||||
|
||||
|
||||
void Mat_to_vector_uchar(cv::Mat& mat, std::vector<uchar>& v_uchar);
|
||||
|
||||
void Mat_to_vector_char(cv::Mat& mat, std::vector<char>& v_char);
|
||||
|
||||
void Mat_to_vector_Rect(cv::Mat& mat, std::vector<cv::Rect>& v_rect);
|
||||
|
||||
void vector_Rect_to_Mat(std::vector<cv::Rect>& v_rect, cv::Mat& mat);
|
||||
|
||||
|
||||
@@ -42,12 +35,11 @@ void vector_Point3i_to_Mat(std::vector<cv::Point3i>& v_point, cv::Mat& mat);
|
||||
void vector_Point3f_to_Mat(std::vector<cv::Point3f>& v_point, cv::Mat& mat);
|
||||
void vector_Point3d_to_Mat(std::vector<cv::Point3d>& v_point, cv::Mat& mat);
|
||||
|
||||
|
||||
void Mat_to_vector_KeyPoint(cv::Mat& mat, std::vector<cv::KeyPoint>& v_kp);
|
||||
|
||||
void vector_KeyPoint_to_Mat(std::vector<cv::KeyPoint>& v_kp, 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_DMatch(cv::Mat& mat, std::vector<cv::DMatch>& v_dm);
|
||||
void vector_DMatch_to_Mat(std::vector<cv::DMatch>& v_dm, cv::Mat& mat);
|
||||
|
Reference in New Issue
Block a user