Giter VIP home page Giter VIP logo

perspective-and-equirectangular's Introduction

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

  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 (FOV, theta, phi, height, width) in the code equir2pers.py
equ = E2P.Equirectangular(input_img)    # Load equirectangular image
img = equ.GetPerspective(120, 0, 0, 1280, 1280)  # Specify parameters(FOV, theta, phi, height, width)
output1 = output_dir +  '/perspective_1.png'
cv2.imwrite(output1, img)

Run: python equir2pers.py.

Perspective to Equirectangular

Given multiple perspective images and infromation(FOV, theta, phi, height, width).
If the equirectangle image is overlapping, the pixel calculate the average in multiple image.


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.

Panorama to Cube

Put image in ./panorama.

Run: python panorama2cube.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.

perspective-and-equirectangular's People

Contributors

timy90022 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.