{"id":14977705,"url":"https://github.com/natlee/fisheye-warping","last_synced_at":"2025-10-28T05:30:55.981Z","repository":{"id":190882329,"uuid":"636589977","full_name":"NatLee/fisheye-warping","owner":"NatLee","description":"Dewarp top-down fisheye image to panorama and rewarp panorama to fisheye image.","archived":false,"fork":false,"pushed_at":"2023-05-07T13:59:13.000Z","size":2338,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T12:04:01.190Z","etag":null,"topics":["cli","fisheye","image-processing","image-warping","opencv","opencv-python","panorama","python3","tools","warping"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/FisheyeWarping/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NatLee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-05T07:38:26.000Z","updated_at":"2024-12-02T14:38:03.000Z","dependencies_parsed_at":"2023-08-26T22:07:00.135Z","dependency_job_id":null,"html_url":"https://github.com/NatLee/fisheye-warping","commit_stats":null,"previous_names":["natlee/fisheye-warping"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLee%2Ffisheye-warping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLee%2Ffisheye-warping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLee%2Ffisheye-warping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLee%2Ffisheye-warping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NatLee","download_url":"https://codeload.github.com/NatLee/fisheye-warping/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238603665,"owners_count":19499488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","fisheye","image-processing","image-warping","opencv","opencv-python","panorama","python3","tools","warping"],"created_at":"2024-09-24T13:56:10.486Z","updated_at":"2025-10-28T05:30:55.506Z","avatar_url":"https://github.com/NatLee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" style=\"text-align: center\"\u003e\n\n# **Fisheye Warping**\n\n\u003cp style=\"text-align: center\"\u003e\n  \u003cimg align=\"center\" src=\"https://github.com/NatLee/fisheye-warping/raw/main/doc/101-panorama.jpg\" alt=\"Panorama\" width=\"70%\" height=\"100%\"\u003e\n  \u003cdiv\u003e\u003c/div\u003e\n  \u003cimg align=\"center\" src=\"https://github.com/NatLee/fisheye-warping/raw/main/doc/101-fisheye.jpg\" alt=\"Fisheye\" width=\"40%\" height=\"40%\"\u003e\n\u003c/p\u003e\n\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/FisheyeWarping.svg)](https://pypi.python.org/pypi/FisheyeWarping/) [![PyPI implementation](https://img.shields.io/pypi/implementation/FisheyeWarping.svg)](https://pypi.python.org/pypi/FisheyeWarping/)\n\n[![Test](https://github.com/NatLee/fisheye-warping/actions/workflows/test.yml/badge.svg)](https://github.com/NatLee/Eagle-Wrappger/actions/workflows/test.yml) [![Release](https://github.com/NatLee/fisheye-warping/actions/workflows/release.yml/badge.svg)](https://github.com/NatLee/fisheye-warping/actions/workflows/release.yml)\n\n[![PyPI status](https://img.shields.io/pypi/status/FisheyeWarping.svg)](https://pypi.python.org/pypi/FisheyeWarping/) [![PyPI license](https://img.shields.io/pypi/l/FisheyeWarping.svg)](https://pypi.python.org/pypi/FisheyeWarping/)\n\n[![PyPI version fury.io](https://badge.fury.io/py/FisheyeWarping.svg)](https://pypi.python.org/pypi/FisheyeWarping/)\n\n[![PyPI download month](https://img.shields.io/pypi/dm/FisheyeWarping.svg)](https://pypi.python.org/pypi/FisheyeWarping/) [![PyPI download week](https://img.shields.io/pypi/dw/FisheyeWarping.svg)](https://pypi.python.org/pypi/FisheyeWarping/) [![PyPI download day](https://img.shields.io/pypi/dd/FisheyeWarping.svg)](https://pypi.python.org/pypi/FisheyeWarping/)\n\n[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)\n\n\u003c/div\u003e\n\nA tool for dewarping and rewarping on a top-down fisheye image by using OpenCV on Python.\n\n## Installation\n\n```bash\npip install FisheyeWarping\n```\n\nCheck it in [Pypi](https://pypi.org/project/FisheyeWarping/)\n\n## Usage\n\n```bash\nfisheyewarping --help\n```\n\n```\nusage: fisheyewarping [-h] [--panorama_output PANORAMA_OUTPUT] [--fisheye_output FISHEYE_OUTPUT] [--save_dewarp_mesh_path SAVE_DEWARP_MESH_PATH] [--save_rewarp_mesh_path SAVE_REWARP_MESH_PATH] [--load_dewarp_mesh_path LOAD_DEWARP_MESH_PATH]\n                      [--load_rewarp_mesh_path LOAD_REWARP_MESH_PATH] [--fisheye_img_path FISHEYE_IMG_PATH] [--panorama_img_path PANORAMA_IMG_PATH] [--use_multiprocessing USE_MULTIPROCESSING]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --panorama_output PANORAMA_OUTPUT\n                        Specific path for `output`. Default is `./dewarp-output.png`.\n  --fisheye_output FISHEYE_OUTPUT\n                        Specific path for `output`. Default is `./rewarp-output.png`.\n  --save_dewarp_mesh_path SAVE_DEWARP_MESH_PATH\n                        Specific path for saving mesh data for `dewarping`. Default is `None`.\n  --save_rewarp_mesh_path SAVE_REWARP_MESH_PATH\n                        Specific path for saving mesh data for `rewarping`. Default is `None`.\n  --load_dewarp_mesh_path LOAD_DEWARP_MESH_PATH\n                        Specific path for loading mesh data for `dewarping`. Default is `None`.\n  --load_rewarp_mesh_path LOAD_REWARP_MESH_PATH\n                        Specific path for loading mesh data for `rewarping`. Default is `None`.\n  --fisheye_img_path FISHEYE_IMG_PATH\n                        Specific path of your fisheye image for dewarping to a panorama.\n  --panorama_img_path PANORAMA_IMG_PATH\n                        Specific path of your panorama image for rewarping to a fisheye image.\n  --use_multiprocessing USE_MULTIPROCESSING\n                        Use multiprocessing to get mesh. Default is `True`.\n```\n\n## Example\n\n### Dewarp a fisheye image to panorama\n\n- In the first time, you will need to build a mesh file for dewarping.\n\n    ```bash\n    fisheyewarping \\\n    --save_dewarp_mesh_path ./dewarp-mesh.pkl \\\n    --fisheye_img_path ./test-fisheye.jpg\n    ```\n\n    ```python\n    import cv2\n    from fisheyewarping import FisheyeWarping\n    fisheye_img = cv2.imread('./test-fisheye.jpg')\n    frd = FisheyeWarping(fisheye_img, use_multiprocessing=True)\n    frd.build_dewarp_mesh(save_path='./dewarp-mesh.pkl')\n    frd.run_dewarp(save_path='./dewarp-output.png')\n    ```\n\n- In the next time, you just load the mesh and feel free to go.\n\n    ```bash\n    fisheyewarping \\\n    --load_dewarp_mesh_path ./dewarp-mesh.pkl \\\n    --fisheye_img_path ./test-fisheye.jpg\n    ```\n\n    ```python\n    import cv2\n    from fisheyewarping import FisheyeWarping\n    fisheye_img = cv2.imread('./test-fisheye.jpg'.)\n    frd = FisheyeWarping(fisheye_img, use_multiprocessing=True)\n    frd.load_dewarp_mesh(save_path='./dewarp-mesh.pkl')\n    frd.run_dewarp(save_path='./dewarp-output.png')\n    ```\n\n### Rewarp any panorama image to fisheye\n\n- In the first time, you will need to build 2 mesh files for dewarping and rewarping by using one fisheye image.\n\n    ```bash\n    fisheyewarping \\\n    --save_dewarp_mesh_path ./dewarp-mesh.pkl \\\n    --save_rewarp_mesh_path ./rewarp-mesh.pkl \\\n    --fisheye_img_path ./test-fisheye.jpg\n    ```\n\n    ```python\n    import cv2\n    from fisheyewarping import FisheyeWarping\n    fisheye_img = cv2.imread('./test-fisheye.jpg'.)\n    frd = FisheyeWarping(fisheye_img, use_multiprocessing=True)\n    frd.build_dewarp_mesh(save_path='./dewarp-mesh.pkl')\n    frd.build_rewarp_mesh(save_path='./rewarp-mesh.pkl')\n    panorama_img = cv2.imread('./test-panorama.jpg'.)\n    frd.run_rewarp_with_mesh(panorama_img, save_path='./rewarp-output.png')\n    ```\n\n- In the next time, you just load the meshes and feel free to go.\n\n    ```bash\n    fisheyewarping \\\n    --load_dewarp_mesh_path ./dewarp-mesh.pkl \\\n    --load_rewarp_mesh_path ./rewarp-mesh.pkl \\\n    --panorame_img_path ./test-panorama.jpg\n    ```\n\n    ```python\n    import cv2\n    from fisheyewarping import FisheyeWarping\n    frd = FisheyeWarping(None, use_multiprocessing=True)\n    frd.load_dewarp_mesh(save_path='./dewarp-mesh.pkl')\n    frd.load_rewarp_mesh(save_path='./rewarp-mesh.pkl')\n    panorama_img = cv2.imread('./test-panorama.jpg'.)\n    frd.run_rewarp_with_mesh(panorama_img, save_path='./rewarp-output.png')\n    ```\n\n\n## Mesh\n\n\u003e The source of mesh image is from (http://paulbourke.net/dome/fish2/).\n\nHere is the mesh image for this tool, it shows the transformation from the original fisheye image to the panorama image.\n\n- Before - **Fisheye**\n\n\u003cdiv align=\"center\" style=\"text-align: center\"\u003e\n\u003cimg align=\"center\" src=\"https://github.com/NatLee/fisheye-warping/raw/main/doc/mesh-fisheye.jpg\" alt=\"Fisheye\" width=\"40%\" height=\"40%\"\u003e\n\u003c/div\u003e\n\n- After - **Panorama**\n\n\u003cdiv align=\"center\" style=\"text-align: center\"\u003e\n\u003cimg align=\"center\" src=\"https://github.com/NatLee/fisheye-warping/raw/main/doc/mesh-panorama.jpg\" alt=\"Panorama\" width=\"70%\" height=\"100%\"\u003e\n\u003c/div\u003e\n\n\n## Contributor\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/NatLee\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/10178964?v=3?s=100\" width=\"100px;\" alt=\"Nat Lee\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNat Lee\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## LICENSE\n\n[MIT](LICENSE)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatlee%2Ffisheye-warping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatlee%2Ffisheye-warping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatlee%2Ffisheye-warping/lists"}