1 | initial version |
Fastest way I know is this:
cv::Mat res(100, 100, CV_8UC1);
std::vector<uchar>vec(res.begin<uchar>(), res.end<uchar>());
2 | No.2 Revision |
Fastest way I know is this:
cv::Mat res(100, 100, CV_8UC1);
std::vector<uchar>vec(res.begin<uchar>(), res.end<uchar>());
CV_32FC1);
std::vector<float>vec(res.begin<float>(), res.end<float>());
3 | No.3 Revision |
Fastest way I know is this:
cv::Mat res(100, 100, CV_32FC1);
std::vector<float>vec(res.begin<float>(), res.end<float>());
or if you declare your vec before:
std::vector<float> vec;
cv::Mat res(100, 100, CV_32FC1);
vec.assign(res.begin<float>(), res.end<float>());
4 | No.4 Revision |
Fastest way I know is this:
cv::Mat res(100, 100, res(m, n, CV_32FC1);
std::vector<float>vec(res.begin<float>(), res.end<float>());
or if you declare your vec before:
std::vector<float> vec;
cv::Mat res(100, 100, res(m, n, CV_32FC1);
vec.assign(res.begin<float>(), res.end<float>());