2
我想用過濾器將圖像進行卷積並在opencv中使用filter2D函數將其存儲到CV_64F類型的矩陣中。但目標矩陣的類型會發生變化,我嘗試使用assignTo 0r ConvertTo函數將其更改回CV_64F,但我無法這樣做。有人可以幫忙嗎?這是我的代碼在opencv中的矩陣類型轉換
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);