I am trying to convolve an image with a filter and storing it to a matrix of type CV_64F with the help of filter2D function in opencv. but the type of the destination matrix get changed and i try to change it back to CV_64F with the help of assignTo 0r ConvertTo function but i am not able to do so. Can someone help? This is lines of my code
cv::Mat op = cv::Mat(25,25,a.type(),Arr1); // a is the image matrix and op is the filter.
cv::Point anchor = Point(-1,-1);
cv::Mat b = cv::Mat(a.size(),CV_64F);
cv::Mat l = cv::Mat(a.size(),CV_64F);
cv::Mat m = cv::Mat(a.size(),CV_64F);
//prnmt(a);
filter2D(a,b,-1,op,anchor,0,BORDER_DEFAULT);
b.assignTo(l,CV_64F);
I tried running the following similar code with OpenCV 2.3 and it worked i.e.
b‘s type wasCV_64Fafter the call tofilter2D:Are you sure
aisCV_64Fin your code?To what type is
bgetting converted to byfilter2D?Which version of OpenCV are you using?