Hello. How to translate ROI in gray (monochrome) on android?
I try that, but it does not work:
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
Mat image = inputFrame.rgba();
Rect roi = new Rect(300, 50, 50, 10);
Imgproc.cvtColor(image.submat(roi), image.submat(roi), Imgproc.COLOR_RGBA2GRAY);
return image;
}
and
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
Mat image = inputFrame.rgba();
Rect roi = new Rect(300, 50, 50, 10);
Mat sub =image.submat(roi);
Imgproc.cvtColor(sub, sub, Imgproc.COLOR_RGBA2GRAY);
sub.copyTo(image.submat(roi));
return image;
}