私がやっていることは、画像を(しきい値処理によって)前処理した後、画像の輪郭を見つけることです。そして、各輪郭の離散フーリエ記述子を取得したい (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 など)が間違っていると思います....