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???????
may i ask, why you want to do this ? (also, why
double[]
?)I have a piece of code in Matlab, I am converting it to java.
opencv != matlab.
don't do that "line-by-line". tell us, what you're trying to achieve (on a higher level), then we can help you.