# Perspective-and-Equirectangular **Repository Path**: zhjc1124/Perspective-and-Equirectangular ## Basic Information - **Project Name**: Perspective-and-Equirectangular - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-15 - **Last Updated**: 2022-01-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Perspective and Equirectangular ## Introduction Perspective and Equirectangular is a python code to help you transfer image between equirectangular and perspective. Four transfer is in the list. This code is modify by [fuenwang/Equirec2Perspec](https://github.com/fuenwang/Equirec2Perspec) 1. equirectangular to perspective. 2. perspective to equirectangular. 3. equirectangular to cube. 4. cube to equirectangular. ## Equirectangular to Perspective Given an input of 360 degree panorama


Setting the image information (FOV, theta, phi) in the code pers2equir.py.
```
input1 = input_dir + '/perspective_1.png'
input2 = input_dir + '/perspective_2.png'
equ = m_P2E.Perspective([input1,input2],
[[120, 0, 0],[120, 0, 90]]) #[FOV,theta,phi]
img = equ.GetEquirec(height,width)
```
**Run:** ```python pers2equir.py```.


## Cube to Panorama
Put image in `./in_path`.
If you do not want to change code, remeber to set the image name (front,right,black,left,top,bottom).png.
**Run:** ```python panorama2cube.py --mode cube --input ./in_path --output ./out_path```.
