{"id":49416646,"url":"https://github.com/nsevent/defisheye","last_synced_at":"2026-04-29T03:10:58.143Z","repository":{"id":37681722,"uuid":"282124849","full_name":"NSEvent/defisheye","owner":"NSEvent","description":"Python scripts for unwarping the images produced by a fisheye lens","archived":false,"fork":false,"pushed_at":"2022-06-22T03:59:32.000Z","size":20618,"stargazers_count":6,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-09-29T12:57:07.551Z","etag":null,"topics":["fisheye","opencv","opencv-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NSEvent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-24T04:43:52.000Z","updated_at":"2023-07-07T13:11:38.000Z","dependencies_parsed_at":"2022-09-15T09:04:14.506Z","dependency_job_id":null,"html_url":"https://github.com/NSEvent/defisheye","commit_stats":null,"previous_names":["nsevent/defisheye"],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/NSEvent/defisheye","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fdefisheye","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fdefisheye/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fdefisheye/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fdefisheye/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NSEvent","download_url":"https://codeload.github.com/NSEvent/defisheye/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fdefisheye/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32408555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T02:37:21.628Z","status":"ssl_error","status_checked_at":"2026-04-29T02:36:50.947Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["fisheye","opencv","opencv-python"],"created_at":"2026-04-29T03:10:57.249Z","updated_at":"2026-04-29T03:10:58.133Z","avatar_url":"https://github.com/NSEvent.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# defisheye\r\nPython scripts for unwarping the images produced by a fisheye lens.\r\n\r\nCode is adapted from Kenneth Jiang from [this Medium article](https://medium.com/@kennethjiang/calibrate-fisheye-lens-using-opencv-333b05afa0b0), \r\nwhich can be referenced for a more in-depth explanation.\r\n\r\n## Example\r\n### Input\r\n\u003cimg src=\"input.jpg\" width=\"600\"/\u003e\r\n\r\n### Output\r\n\u003cimg src=\"output.jpg\" width=\"600\"/\u003e\r\n\r\n## Setup\r\n### Install pip packages\r\n```\r\npython3 -m venv env; source env/bin/activate\r\npip install -r requirements.txt\r\n```\r\n\r\n### Calibrate to your specific fisheye lens\r\nEvery lens is different so we must calibrate our program to our lens. \r\n\r\nTo obtain the proper calibration settings for our lens, we must:\r\n* Print [this checkerboard image](https://github.com/kvntng17/defisheye/blob/master/calibration_pattern.png) on regular sized printer paper.\r\n* Stick the checkerboard image we just printed onto a *flat* surface. A clipboard, or in my case, a shoebox works fine. The key here is the checkerboard *must be flat.*\r\n* Capture photos of the printed checkerboard from multiple angles using our fisheye lens. We should take photos from as many angles as possible. 30+ photos from different angles will suffice.\r\n* Replace the photos in the ```photos``` directory with the photos captured in the previous step. These should be png or jpg format.\r\n\r\nThen to obtain our calibration settings (saved to ```calibrate_config.py```):\r\n```\r\npython calibrate.py\r\n```\r\n\r\n### Remove fisheye distortion\r\n```\r\n# Remove fisheye and resize image to fit original image size (black around edge is cropped)\r\npython defisheye.py input.jpg\r\n\r\n# Remove fisheye and keep entire image\r\npython defisheye_retain_all.py input.jpg\r\n```\r\nThe ```balance``` value [0, 1.0] used in ```defisheye_retain_all.py``` can be modified to crop more or less of the black around the edge of the undistorted image. \r\nFor example ```balance=0.0``` will produce cropped output with no black edges while ```balance=1.0``` will produce uncropped output.\r\nBy default, ```balance``` is set to 1.0.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsevent%2Fdefisheye","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsevent%2Fdefisheye","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsevent%2Fdefisheye/lists"}