Hi,
I'm retrieving a ROI of mat, want to manipulate its values and put the manipulated matrix back into the original matrix but it's not working, though.. I googled that result together as it seems to be the best documentation, but I'm stuck and don't know why the original matrix won't hold the new values. The code is as follows.
for (int i = 0; i < objectArray.length; i++) {
Imgproc.rectangle(frame, objectArray[i].tl(), objectArray[i].br(), scalar, 3);
Mat A = frame.submat(objectArray[i]);
A.convertTo(A, CvType.CV_64FC3);
int size = (int) (A.total() * A.channels());
double[] temp = new double[size];
A.get(0, 0, temp);
for (int j = 0; j < size; j++)
temp[j] = (temp[j] / 2);
A.put(0, 0, temp);
A.copyTo(frame.submat(objectArray[i]));
}
where objectArray contains Rectangles, my ROIs and frame is my original Matrix, which is, of cource, bigger than A. Can someone help me?