doubt about ROIs in android
HI,
I have a doubt about how ROIs work on java. My way to create a ROI of an image is this:
Rect r1 = new Rect(x,y,sizex,sizey);
Mat roi1 = new Mat(A,r1);
where A is the source image. If i modify roi1 i also modify A? I want to do this to modify a concrete area of A but i do not get. What i'm doing wrong?
yes, you modify the original image. a ROI does not make a copy of the pixels in opencv (no matter what language)
try:
Mat roi_copy = new Mat(A,r1).clone();
, again, i'm not sure, what you wanted, please report back.And this is a good way to create a ROI or is necessary to use submat?
both are equivalent. same output, same problem.
Thank you!