# Revision history [back]

### How to perform changes in both sub-image and original image ?

I have limited a region of interest in a binary image with a rectangle . I have convert this rectangle to a new matrix . now whenever I perform an operation in this matrix there is no change in the original image , but what I want is to have a change in the original image .

     // region of interest
Rect roi(maxloc.x,maxloc.y, m2.cols,m2.rows);
//new matrix
Mat image_roi = m1(roi);
//perform operations
bitwise_not(image_roi,image_roi);
image_roi=choice(image_roi);
imshow("image",m1);//there is no change in m2


### How to perform changes in both sub-image and original image ?

I have limited a region of interest in a binary image with a rectangle . I have convert this rectangle to a new matrix . now whenever I perform an operation in this matrix there is no change in the original image , but what I want is to have a change in the original image .

     // region of interest
Rect roi(maxloc.x,maxloc.y, m2.cols,m2.rows);
//new matrix
Mat image_roi = m1(roi);
//perform operations
bitwise_not(image_roi,image_roi);
image_roi=choice(image_roi);
imshow("image",m1);//there is no change in m2
m1

 3 retagged sturkmen 6772 ●3 ●48 ●79 https://github.com/stu...

### How to perform changes in both sub-image and original image ?

I have limited a region of interest in a binary image with a rectangle . I have convert this rectangle to a new matrix . now whenever I perform an operation in this matrix there is no change in the original image , but what I want is to have a change in the original image .

     // region of interest
Rect roi(maxloc.x,maxloc.y, m2.cols,m2.rows);
//new matrix
Mat image_roi = m1(roi);
//perform operations
bitwise_not(image_roi,image_roi);
image_roi=choice(image_roi);
imshow("image",m1);//there is no change in m1