2012-05-04 47 views
1

在開發用於面部認證C++應用程序,我遇到 一個錯誤:錯誤C3861: 'cropImage' *:標識符沒有找到

C3861: 'cropImage'*: identifier not found 

此的cropImage簽名:

IplImage* cropImage(IplImage *img,CvRect region); 

我嘗試在以下函數中調用它:

IplImage *cropFace(IplImage * image, CvPoint eye_left, CvPoint eye_right, double offset_pct[2], CvSize dest_sz) 
{//calculate offsets in original image 
    ... 
    //matrice de rotation 
    cv::Mat affine_matrix; 
    affine_matrix = cv::getRotationMatrix2D(eye_left, rotation, scale); 
    //mtx est la conversion de image IplImage* en matrice mtx 
    cv::Mat mtx = cv::Mat(image, true); 
    cv::Mat mtx2; 
    cv::warpAffine(mtx, mtx2, affine_matrix, mtx.size(), cv::INTER_LINEAR,  cv::BORDER_CONSTANT, cv::Scalar::all(255)); 
    //mtx est la conversion de matrice mtx2 en image IplImage* 
    IplImage image1 = mtx2; 
    //crop the rotated image 
    double crop_x = eye_left.x - scale * offset_h; 
    double crop_y = eye_left.y - scale * offset_v; 
    double crop_size0 = dest_sz.width * scale; 
    double crop_size1 = dest_sz.height * scale; 
    CvRect region; 
    region.x = cvFloor(crop_y); 
    region.y = cvFloor(crop_y); 
    region.width = cvFloor(crop_size0); 
    region.height = cvFloor(crop_size1); 
    //the problem in this ligne,it seems it has not known cropImage !! :(
    IplImage *image2 = cropImage(&image1, region); 
    IplImage *image3 = resizeImage(image2, dest_sz.width, dest_sz.width); 
    return image3; 
}  

I th在IplImage *和Mat之間轉換的墨水會導致此問題。

+0

只是一個提示 - 如果需要迫切解決,也許你應該考慮支付專人爲您解決。 En plus,la langue officiele ici est anglais,所以你應該考慮用英文發佈你的錯誤信息,或者至少翻譯/描述它。 – Tibor

回答

1

這個問題似乎是你指出的。即使image已經是指針類型,您仍然使用&符號對其進行解引用,結果產生了雙指針。你應該儘量簡單:

IplImage *image2 = cropImage(image1, region); 
+0

cropImage需要一個輸入參數,其類型IplImage * ...和我有一個參數是image1參數是IplImage,這就是爲什麼我把&image1。 在所有情況下,我通過編寫糾正它: IplImage image1 = mtx2; // mtx2其類型cv:墊 \t IplImage * im22 =(IplImage *)&image1; – OntoBLW

+0

這個問題已經解決了,當我編寫的時候我的解決方案是 IplImage * cropFace(IplImage * image,CvPoint eye_left,CvPoint eye_right,double offset_pct [2],CvSize dest_sz) 我更正了wplting IplImage * classNoun :: cropFace(IplImage *圖像,CvPoint eye_left,CvPoint eye_right,雙offset_pct [2],CvSize dest_sz) 也爲另一功能disatnce我應該classNoun :: preceed,但現在我有一個新的問題 第一次機會異常的0x100e3cf2丹斯shervinemami.exe :0xC0000094:整數除以零。 – OntoBLW

相關問題