Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to make a deep copy of a rectangular region of a cv::Mat?
- // select a ROI
- Mat roi(img, Rect(10,10,100,100));
- Mat deepRoiExplorer=roi.clone();
- Mat source...; // your source image
- Rect sourceRect(...); // your ROI
- // using clone
- Mat target = source(sourceRect).clone();
- // using copyTo
- Mat target(sourceRect.size(), source.type());
- source(sourceRect).copyTo(target);
Add Comment
Please, Sign In to add comment