0
我正在做的是預處理後的圖像(通過閾值)找到圖像的輪廓。 我希望(使用DFT()函數) 我的代碼如下得到每個輪廓的離散傅里葉描述,如何使用cv :: findcontours和DFT?它導致調試錯誤
vector<Mat> contourLines1;
vector<Mat> contourLines2;
getContourLine(exC1, contourLines1, binThreshold, numOfErosions);
getContourLine(exC2, contourLines2, binThreshold, numOfErosions);
// calculate fourier descriptor
Mat fd1 = makeFD(contourLines1.front());
Mat fd2 = makeFD(contourLines2.front());
/////////////////////////
void getContourLine(Mat& img, vector<Mat>& objList, int thresh, int k){
threshold(img,img,thresh,255,THRESH_BINARY);
erode(img,img,0,cv::Point(-1,-1),k);
cv::findContours(img,objList,CV_RETR_LIST,CV_CHAIN_APPROX_SIMPLE);
}
/////////////////////////
Mat makeFD(Mat& contour){
Mat result;
dft(contour,result,DFT_ROWS);
return result;
}
問題是什麼???我無法找到它..我認爲函數的參數類型(如cv :: finContours或dft)是錯誤的....