Java API generator: implementation of vector<Point> support
This commit is contained in:
parent
ecba099754
commit
5a5fe40542
@ -65,12 +65,23 @@ void vector_Rect_to_Mat(vector<Rect>& v_rect, Mat& mat)
|
|||||||
//vector_Point
|
//vector_Point
|
||||||
void Mat_to_vector_Point(Mat& mat, vector<Point>& v_point)
|
void Mat_to_vector_Point(Mat& mat, vector<Point>& v_point)
|
||||||
{
|
{
|
||||||
|
v_point.clear();
|
||||||
|
|
||||||
|
if(mat.type()!= CV_32SC2 || mat.rows!=1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for(int i=0; i<mat.cols; i++)
|
||||||
|
v_point.push_back( Point( mat.at< Vec<int, 2> >(0, i) ) );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void vector_Point_to_Mat(vector<Point>& v_point, Mat& mat)
|
void vector_Point_to_Mat(vector<Point>& v_point, Mat& mat)
|
||||||
{
|
{
|
||||||
|
mat.create(1, v_point.size(), CV_32SC2);
|
||||||
|
for(int i=0; i<v_point.size(); i++)
|
||||||
|
mat.at< Vec<int, 2> >(0, i) = Vec<int, 2>(v_point[i].x, v_point[i].y);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user