I need to convert and reassign an equiangular image to another equiangular image with a 90 ° roll.
I did it with Pano2VR .
The problem is that I have to do this programmatically from the server side . Therefore, I cannot use the GUI for this.
First, I focused my research on imagemagick. I tried the Fred ImageMagick scripts but couldn't find anyone to do what I want to do. Moreover, the image processing time looks very long compared to Pano2VR.
I directed my research to OpenCV and libgnomonic . This is currently the most interesting way. This library allows the user to convert projections (equilateral to rectilinear and vice versa) or to make an equal transformation of the mapping . I played with Norama-suite , which contains some scripts for working with the library. For example, I would like to convert a rectilinear image to equirectangular, but the output was only a black background (why? I did not find the answer).
However, this second link may solve my problem. I have this image:

and I want to convert it to this image

Well, I'm not comfortable with C. at all. I think I should use these two files:
But I do not know how to do this. And first of all, I want to understand.
Am I on the right track? What conversion applies to the first image? Is there a way to do this with a python or bash script?
Ok, thanks for your help.
** CHANGE Transpose C in python ** The following code did not work and did not return, but IndexError. However, I tried to catch and pass the exception, and the first right side of the image did not change.
import math from PIL import Image img = Image.open("img1.jpg") img = img.convert('RGB') pixel = img.load() width, height = img.size img2 = img.copy() for y in xrange(height): for x in xrange(width): xx = 2*(y+0.5) / width - 1.0 yy = 2*(y+0.5)/ height - 1.0 lng = math.pi * xx lat = 0.5 * math.pi * yy