This a simple implementation of Polar to Cartesian transformation applied to the image case. It is useful to unroll an omni image to convert it to panoramic image.
imgPol = cvCreateImage(cvSize(2*CV_PI*RadiusMax,RadiusMax-RadiusMin),IPL_DEPTH_8U,1);
cvSet(imgPol,CV_WHITE,NULL);
int x0,y0;
double Radius;
double Angle;
for(int x=1; x < imgPol->width; x++)
{
for(int y=1; y < imgPol->height; y++)
{
Radius = RadiusMin + y;
Angle = 2 * CV_PI * x / imgPol->width;
x0 = cvRound(CenterX + Radius * cos(Angle));
y0 = cvRound(CenterY + Radius * sin(Angle));
cvSet2D(imgPol, y, x, cvGet2D(imgBase,y0,x0));
}
}
cvSaveImage("imgPol.bmp",imgPol);

