Hi,
I am trying to convert Bitmap as Mat and trying to save it in local. But Imwrite always returns false though Mat values seems to be valid. Below is my code snippet.
View view =MainActivityProvider.getTestActivity().getWindow().getDecorView().getRootView();
Display display = view.getDisplay();
String displayName = display.getName();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_4444);
Mat mat = new Mat();
Utils.bitmapToMat(bitmap, mat);
boolean success = Imgcodecs.imwrite("/Users/xxxx/test.png", mat);
Imread also not working as it stores null values in Mat with valid picture. Tried other option of converting Bitmap to Byte array and create Mat out of it. Then save it. No luck.
Using Opencv 4.0.1.
Also want to know equivalent for Highgui.imshow since I don’t find Highgui module for android