Skip to content

Instantly share code, notes, and snippets.

@lix19937
Created June 11, 2025 06:06
Show Gist options
  • Save lix19937/72d0c80566b18c38866a55e2dadf5614 to your computer and use it in GitHub Desktop.
Save lix19937/72d0c80566b18c38866a55e2dadf5614 to your computer and use it in GitHub Desktop.
print cvmat info
int tnbytes = h * w;
// std::vector<cv::Mat> tchannels;
// cv::split(img_bgr, tchannels);
// std::cout << "宽度: " << tchannels[0].cols << std::endl;
// std::cout << "高度: " << tchannels[0].rows << std::endl;
// std::cout << "通道数: " << tchannels[0].channels() << std::endl;
// std::cout << "数据类型: " << tchannels[0].type() << " ---- " << CV_8UC1 << std::endl;
// std::cout << "深度: " << tchannels[0].depth() << std::endl;
// std::cout << "尺寸: " << tchannels[0].size() << std::endl;
// std::cout << "是否连续存储: " << (tchannels[0].isContinuous() ? "是" : "否") << std::endl;
// for (int i=0; i<3; ++i){
// cudaMemcpy((uint8_t *)d_dst + i*tnbytes, tchannels[i].data, tnbytes, ::cudaMemcpyHostToDevice);
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment