Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to convet mat to a double array in java????

Mat im= Imgcodecs.imread(d); Mat inp=new Mat(); Mat newinp=new Mat(); inp.convertTo(newinp, CvType.CV_64F); java.util.List<mat> rgb=null; Core.split(newinp, rgb); Mat r1=rgb.get(0); Mat g1=rgb.get(1); Mat b1=rgb.get(2); double[] r = null; double[] b=null; double[] g=null;

Now I want to convert Mat r1 to double[] r, Mat g1 to double[] g and Mat b1 to double[] b. What should I do???????

click to hide/show revision 2
No.2 Revision

updated 2016-12-23 00:54:45 -0600

berak gravatar image

How to convet mat to a double array in java????

Mat im= Imgcodecs.imread(d);
Mat inp=new Mat();
Mat newinp=new Mat();
inp.convertTo(newinp, CvType.CV_64F);
java.util.List<mat> java.util.List<Mat> rgb=null;
Core.split(newinp, rgb);
Mat r1=rgb.get(0);
Mat g1=rgb.get(1);
Mat b1=rgb.get(2);
double[] r = null;
double[] b=null;
double[] g=null;

g=null;

Now I want to convert Mat r1 to double[] r, Mat g1 to double[] g and Mat b1 to double[] b. What should I do???????