Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 a 中的数据cv:Mat放入普通的 C++vector中。我知道我可以cv::Mat用mat.reshape ( 0, 1 )
cv:Mat
vector
cv::Mat
mat.reshape ( 0, 1 )
怎样才能把数据放到一个vector?
cv::Mat具有到 的转换运算符std::vector,前提是该向量具有正确的数据类型。
std::vector
cv::Mat m = cv::Mat::eye(3, 3, CV_8UC1); std::vector<uchar> v = m.reshape(0, 1);