int img_length = img.total() * img.channels();unsigned char*image_array_ptr = new unsigned char[img_length](); std::memcpy(image_array_ptr, img.ptr<unsigned char>(0), img_length * sizeof(unsigned char)); // 从unsigned char* 再转换为cv::Mat,验证转换是否正确 cv::Mat a = cv::...