2014-05-30 06:13:45 -0600 | commented answer | Not able to create Mat object with float data Thanks for the answer. But it still didn't solve my purpose. My underlying Mat object still has uchar data. I need a mat object with float data. Mat kernelxx = Mat::ones( HEIGHT, WIDTH, CV_32FC1 )/HEIGHT*WIDTH; //this creates data with zeros This is weird, as Mat consturctor supports creation of float data. Mat src=imread("variance8inv.png"); Mat dst(imageHeight, imageWidth, CV_32FC1); filter2D(src, dst, -1 , kernelxx, Point( -1, -1 ), 0, BORDER_DEFAULT ); |
2014-05-30 05:04:15 -0600 | received badge | ● Editor (source) |
2014-05-30 05:03:50 -0600 | asked a question | Not able to create Mat object with float data I am trying to create a Mat object with a float type data. Mat kernelxx = Mat( HEIGHT, WIDTH, CV_32FC1 ); But what I receive is unsigned char data of type *uchar::Mat::data. Can any one please help me. I also tried using create constructor as well as convertTo() method to make a float data. But all of them create only *uchar data. |