簡體   English   中英

無法編譯此圖像旋轉代碼

[英]Can not compile this Image Rotation code

// rotate the image
frame = cvQueryFrame(capture);
int dx,dy,s; 
double thetaDegree;
double thetaRadian;

//for rotation
IplImage *Rotation;
Rotation = cvCloneImage(frame);
Rotation->origin = frame->origin;
CvZero(Rotation);

//get the rotation degree

thetaRadian = atan(s);      // **the s I have algorithm to do the calculation **
thetaDegree = thetaRadian *(180 / PI);

CvMat *rot = cvgetRotationMatrix2D(center, thetaDegree, 1.0);
cvWarpAffine(frame, Rotation, rot,sizeof(frame));

cvNameWindow("Rotation",1);
cvShowImage("Rotation",Rotation);
cvReleaseImage(&Rotation);
cvReleaseMat(&rot);

現在的錯誤是函數cvWarpAffine參數cvWarpAffine ,我真的不知道為什么,因為我經歷了很多例子並向他們學習。 拜托,有人可以幫我嗎?

如果是正確的參考,那么看起來您正在混合使用C和C ++接口。

該文檔提供了以下類似C的接口:

C: void cvWarpAffine(const CvArr* src, CvArr* dst, const CvMat* map_matrix,
                     int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS,
                     CvScalar fillval=cvScalarAll(0) )

在這種情況下,您不需要大小,但是我不明白為什么大小不會轉換為標志。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM