Hello, the code is here
cv::Mat src = cv::imread("1.bmp", CV_LOAD_IMAGE_UNCHANGED);
cv::Mat mask = cv::Mat::ones(src.size(), CV_8UC1);
mask.row(10).setTo(255);
mask.col(20).setTo(255); // arbitary shape
cv::Mat roi;
src.copyTo(roi, mask); // get the roi
This is 1.bmp
This is mask
This is roi
If I excute roi = roi + 10
, the black parts of roi will also add 10, it's not what I want.
How to get a roi without the black parts?
Thanks!