Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // допустим, картинка хранится в каком-нибудь std::string
  2. std::string image_source = "...";
  3.  
  4. std::vector<unsigned char> bytes(image_source.data(), image_source.data() + image_source.size());
  5. cv::Mat image = cv::imdecode(bytes, CV_LOAD_IMAGE_COLOR);
  6. cv::resize(image, image, cv::Size(1280, 720));
  7.  
  8. // обратно в буфер
  9. std::vector<unsigned char> resized;
  10. cv::imencode(".png", image, resized);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement