I am processing the frame data in onPreviewFrame() function. I would like to change the left-top 1/4 part of the preview data to gray while keep the other part as colorful image. Because I am a beginner of OpenCV I don't know what is the best method. So I use a workaround: 1. change the data parameter of onPreviewFrame from yuv to rgb, then use matToBitmap() function to convert it to a bitmap. 2. change the ROI data to a gray bitmap (COLOR_GRAY2RGBA, and then matToBitmap()). 3. draw the gray bitmap onto the first bitmap I get 4. draw the bitmap on canvas. Although this method works, I still want to know whether there is a better method: can I directly process the ROI of original data and convert new whole data to a bitmap, and draw the bitmap on canvas. Is there any way I can do it?