Here is my code below:
System.loadLibrary( Core.NATIVE_LIBRARY_NAME );
Imgcodecs imageCodecs = new Imgcodecs();
String file ="File path";
Mat matrix = imageCodecs.imread(file, Imgcodecs.IMREAD_GRAYSCALE);
System.out.println("Image Loaded");
Now I want to see the pixel values of mat object "matrix" as an 2D array. I want it to convert or copy as int[][] format. How to do this please suggest.