I wrote:
Mat sobel = new Mat();
Imgproc.Sobel(threshold,sobel, sobel.depth(), 1, 0);
Highgui.imwrite("Sobel.jpg", sobel);
sobel.create( sobel.height(),sobel.width(), CvType.CV_8UC(2));
System.out.println(sobel.dump());
//display matrix
Then I tried to get an array from sobel. But I confused how to get value from Mat and put in Array.