KeunwooPark / fisheye_mesh_generator

A simple python script to generate mesh objects for a virtual fisheye camera.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fisheye Mesh Generator

This is a fisheye projection mesh generator. It generates mesh files (.obj) and you can use theses files to create a virtual fisheye camera in a Unity virtual environment.

This script is only for 180 degree camera. You can update the code change the FOV.

How to Use

Install dependent packages first.

$ pip install -r requirements.txt

Then run the script.

$ python run.py --model_type equidistance --res 64

Model Types

This generator supports four fisheye projection model types.

  • equidistance
  • orthogonal
  • stereographic
  • equisolid

Resolution

The higher number generates more fine mesh. Default value is 64. What it actually means is a number of grids that splits a side of a virtual cube.

Output

The script will create two folders for square objects (square_objs) and fisheye objects (fish_objs). What you will use is the fisheye objects. It also creates fisheye.png, which visualizes the created fisheye meshes.

More Resources

If you want to understand more about this code, please check this document.

If you want to create a fisheye camera using the mesh outputs, please check out this repository.

References

Here are some great articles about fisheye camera for Unity.

About

A simple python script to generate mesh objects for a virtual fisheye camera.

License:MIT License


Languages

Language:Python 100.0%