cv::Mat dst;
std::vector<float> dst_data;
std::vector<cv::Mat> bgrChannels(3);
cv::split(dst, bgrChannels);
for (auto i = 0; i < bgrChannels.size(); i++)
{
std::vector<float> data = std::vector<float>(bgrChannels[i].reshape(1, 1));
dst_data.insert(dst_data.end(), data.begin(), data.end());
}
opencv 图片HWC格式转CHW格式
最新推荐文章于 2024-07-14 16:40:31 发布