Advertisement
jack06215

[OpenCV] save ROI image

Jul 7th, 2020
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. void cvSaveROIMat(string filename, Mat &src, Rect ROI)
  2. {
  3.     Mat croppedImage;
  4.     //string filename = "StageType.jpg";
  5.     //Rect myROI(405, 136, 41, 30);
  6.     Mat(src, ROI).copyTo(croppedImage);
  7.     //return croppedImage;
  8.     imwrite(filename, croppedImage);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement