Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // допустим, картинка хранится в каком-нибудь std::string
- std::string image_source = "...";
- std::vector<unsigned char> bytes(image_source.data(), image_source.data() + image_source.size());
- cv::Mat image = cv::imdecode(bytes, CV_LOAD_IMAGE_COLOR);
- cv::resize(image, image, cv::Size(1280, 720));
- // обратно в буфер
- std::vector<unsigned char> resized;
- cv::imencode(".png", image, resized);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement