Mat data type is not compatible: 0

asked 2014-03-06 23:01:18 -0600

lingyun gravatar image

updated 2014-03-07 01:48:52 -0600

berak gravatar image
float gaborMR[] = new float[gabor_height*gabor_width];
Mat gaborMatR = new Mat(gabor_height, gabor_width, CvType.CV_32FC1);
gaborMatR.put(0,0,gaborMR);
Mat GdstlenaR = new Mat(src.rows(),src.cols(), CvType.CV_32FC1);
Imgproc.filter2D(grayMat, GdstlenaR, src.depth(), gaborMatR);  
float gR[] = new float[src.rows()*src.cols()];
GdstlenaR.get(0, 0,gR); // here, it tells me:Mat data type is not compatible: 0

Hi! I don't know why this happend. Could you answer me? Thanks in advance!

edit retag flag offensive close merge delete

Comments

1

if you want the output-image to be float, try :

Imgproc.filter2D(grayMat, GdstlenaR, CvType.CV_32FC1, gaborMatR);
berak gravatar imageberak ( 2014-03-07 03:09:40 -0600 )edit

Thank you very much !

lingyun gravatar imagelingyun ( 2014-03-08 18:32:53 -0600 )edit