极坐标通常用于校正图像中的圆形物体或者包含在圆环中的物体。 如上图所示 : 设原图变换的中心坐标(即圆心坐标)为 (Mr,Mc),图像上一点(r,c)极坐标变换后为(d,theta) 则 d = sqrt( (r - Mr) * (r - Mr) + (c - Mc ) * (c -Mc) ) theta = atan2( - (r - Mr) / (c - Mc)) 其反变换形式为 r = Mr - d sin(theta) c= Mc + d cos(theta) 本程序基于opencv2.3 // polar.cpp : 定义控制台应用程序的入口点。 // # include "stdafx.h" # include "highgui.h" # include "cv.h" # include "cxcore.h" # ifdef DEBUG # pragma comment(lib, " opencv_core231d.lib" ) # pragma comment(lib, "opencv_features2d231d.lib" ) # pragma comment(lib, "opencv_flann231d.lib" ) # pragma comment(lib, "opencv_gpu231d.lib" ) # pragma comment(lib, "opencv