Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to copy a mat object to a integer 2D matrix in opencv java ?

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.

How to copy a mat object to a integer 2D matrix in opencv java ?

Here is my code below: 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. suggest.

How to copy a mat object to a integer 2D matrix in opencv java ?

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.

How to copy a mat object to a integer 2D matrix in opencv java ?

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");

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.

click to hide/show revision 5
retagged

updated 2019-11-12 02:39:52 -0600

berak gravatar image

How to copy a mat object to a integer 2D matrix in opencv java ?

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.