You can also checkout JavaCV that give you Java Objects with bindings to opencv lib.
This way you wouldn't need to do any c/c++ coding, you can do all directly in Java and access functions from opencv.
Google code Project
Answer to your followup question:
For example, take a cylindrical projection: Take a look at the image -

(sorry I'm not allowed to post pictures)
this is taken from Szeliskis book (http://szeliski.org/Book/).
The relation you have here in the end is
x'=s*tan⁻¹(x/f)
and
y'=s*(y/sqrt(x²+f²))
where f is the focal lenght of a camera and s the radius of the cylinder, you can use f=s.
Now to get this into loops, here is some pseudocode:
%% xMitte , yMitte are the coordinates for the point in the middle
for yNeu =1: height
for xNeu =1: width
dx = xNeu - xMitte ; %% X relativ to origin
dy = yNeu - yMitte ; %% Y relativ to origin
theta = atan(dx / f);
h = dy / sqrt(dx ^2+f^2);
x = (f * theta) + xMitte ;
y = (f * h) + yMitte ;
BildNeu (xNeu ,yNeu) = BildAlt (x, y);
end
end
BildNeu is the new picture, this array has the same size as BildAlt (the original picture).
The Line with BildNeu and BildAlt at the end of the inner loop could be like:
/** returns the color value of that pixel **/
CvScalar pixel = cvGet2D(originalImage, i, j);
/** writes the new color value of that pixel **/
cvSet2D(destinationImage, y, x, pixel);