opencv android java matrix submatrix (ROI Region of Interest)
问题 I've mRgba Matrix and a Rect r (something recognized in the frame) I want a sub-matrix of this part of the frame which is defined by the Rect r. when I use it like this: sub = mRgba.submat(r); I get the right sub-matrix, but I've a problem with the next steps, I want to change this part of the frame and then copy it back to the original. For example: Imgproc.cvtColor(sub, sub, Imgproc.COLOR_RGBA2GRAY, 1); //make it gray Imgproc.cvtColor(sub, sub, Imgproc.COLOR_GRAY2RGBA, 4); //change to rgb