I want to put the data from a cv:Mat
into a normal C++ vector
.
I know that I can reshape the cv::Mat
into a vector with mat.reshape ( 0, 1 )
How can put the data into a vector
?
I want to put the data from a cv:Mat
into a normal C++ vector
.
I know that I can reshape the cv::Mat
into a vector with mat.reshape ( 0, 1 )
How can put the data into a vector
?
cv::Mat
has a conversion operator to std::vector
, provided the vector has the proper data type.
cv::Mat m = cv::Mat::eye(3, 3, CV_8UC1);
std::vector<uchar> v = m.reshape(0, 1);