对于二维图像,Log-Polar表示从笛卡尔坐标到极坐标的变换。
OpenCV中对于数极坐标转换的函数是cvLogPolar():
void cvLogPolar(const CvArr * src , CvArr * det , CvPoint2D32f center , double n , int flags = CV_INTER_LINEAR | CV_WARP_FILL_OUTLIERS)
src 和 dst是单通道或三通道的彩色或灰度图像。
center是对数极坐标变换的中心点;
m是缩放比例;
下面以《学习OpenCV》课后题10为例子进行练习
10.进行LogPolar转换
a:如果logPolar的中心点在正方形的一角,画出log-polar的结果;
b:如果中心点在圆里边靠近边缘,那么log-polar变换中的圆的外观?
c:如果中心点在圆的外边,画出圆的外观
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;
int main(int argc, const char * argv[]) {
/*1、生成一个图像*/
IplImage * Src1 = cvCreateImage(cv