Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to translate ROI in gray (monochrome) on android?

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;

}

How to translate convert ROI in gray (monochrome) on android?

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;

}

How to convert ROI in gray (monochrome) on android?

Hello. How to translate convert 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;

}

How to convert ROI in gray (monochrome) on android?

Hello. How to convert 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;

}