2011-09-28 7 views
0

나는 극좌표 변환을하고 싶다. 그러나 OpenCV 2.0에서는 cvLogPolar 함수의 C++ 버전이 아닌 것으로 보입니다. cv :: Mat와 함께 사용하려면 어떻게해야합니까?OpenCV 1.0과 OpenCV 2.0의 혼합 방법

오류 :

VideoCapture cap(1); 
try { 
    if(!cap.isOpened()) { 
     throw "Could not open capture device"; 
    } 
} catch(char* e) { 
    cerr << "Error: " << e << endl; 
} 

for(;;) { 
    Mat frame; 
    cap >> frame; 
    cvLogPolar(frame, frame, Point(frame.size().width/2, frame.size().height/2), 
     1.0f, CV_INTER_LINEAR|CV_WARP_INVERSE_MAP); 
    imshow("Preview", frame); 
    if(waitKey(30) >= 0) break; 
} 

가 어쨌든 뭔가를 배울 필요가 떨어져 눈물 : 'cvLogPolar' : cannot convert parameter 1 from 'cv::Mat' to 'const CvArr *'

가 여기 내 코드입니다.

Mat frame; 
cap >> frame; 

Mat dst(frame.size(), frame.type()); 
CvMat cvframe = frame; 
CvMat cvdst = dst; 
cvLogPolar(&cvframe, &cvdst, Point(frame.size().width/2, frame.size().height/2), 
    1.0f, CV_INTER_LINEAR|CV_WARP_INVERSE_MAP); 
imshow("Preview", dst); 

같은

답변

1

시도 뭔가 나는이 기능은 현재 위치에서 작동 할 수 없기 때문에 cvLogPolar의 결과를 저장하는 새로운 매트를 만들었습니다.