opencv中imencode把Mat编码成jpg格式的内存几行代码备份

            std::string str;
            std::vector<unsigned char> buff;
            cv::imencode(".jpg", requestFace, buff);
            str.resize(buff.size());
            memcpy(&str[0], buff.data(), buff.size());

posted @ 2019-08-26 20:18  cumtchw  阅读(1316)  评论(0编辑  收藏  举报