{"id":37178256,"url":"https://github.com/idlabmedia/image-lens-reproject","last_synced_at":"2026-01-14T20:46:38.605Z","repository":{"id":39811534,"uuid":"458227931","full_name":"IDLabMedia/image-lens-reproject","owner":"IDLabMedia","description":"A tool to convert images from one lens type to another.","archived":false,"fork":false,"pushed_at":"2024-02-08T08:48:08.000Z","size":141,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-06-19T03:02:47.472Z","etag":null,"topics":["image-processing","lens"],"latest_commit_sha":null,"homepage":"","language":"C++","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/IDLabMedia.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-11T14:53:21.000Z","updated_at":"2024-04-22T17:33:05.000Z","dependencies_parsed_at":"2023-02-14T21:03:14.692Z","dependency_job_id":"1d7c0706-349c-4e99-9d19-98414aaa0183","html_url":"https://github.com/IDLabMedia/image-lens-reproject","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/IDLabMedia/image-lens-reproject","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDLabMedia%2Fimage-lens-reproject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDLabMedia%2Fimage-lens-reproject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDLabMedia%2Fimage-lens-reproject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDLabMedia%2Fimage-lens-reproject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IDLabMedia","download_url":"https://codeload.github.com/IDLabMedia/image-lens-reproject/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDLabMedia%2Fimage-lens-reproject/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["image-processing","lens"],"created_at":"2026-01-14T20:46:37.703Z","updated_at":"2026-01-14T20:46:38.564Z","avatar_url":"https://github.com/IDLabMedia.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Lens Reprojection Tool\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/IDLabMedia/image-lens-reproject/build.yml)\n[![GitHub license](https://img.shields.io/github/license/IDLabMedia/image-lens-reproject)](https://github.com/IDLabMedia/image-lens-reproject/blob/main/LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/IDLabMedia/image-lens-reproject)](https://github.com/IDLabMedia/image-lens-reproject/stargazers)\n\n## What is lens-reproject?\n\nlens-reproject is a tool to reproject images taken with a known lens to a new\nlens. The process unprojects every pixel coordinate back to the light ray in\nspherical coordinates -- with the origin set to the center of projection --\nafter which it projects the light ray back onto the sensor using the new lens\nparameters. A variety of lenses is supported:\n\n - Rectilinear (The default perspective projection lenses).\n - Equisolid (Fisheye)\n - Equidistant (Fisheye)\n\n## Prerequisites\n\nOn Linux systems, install libjpeg:\n```sh\nsudo apt install libjpeg-turbo8-dev\n```\n\n## Build\nYou will need a C++ compiler and CMake. All other dependencies are included as\nsubmodules.\n\n```sh\ngit clone https://github.com/IDLabMedia/image-lens-reproject.git\ncd image-lens-reproject\ngit submodule update --init --recursive\nmkdir build \u0026\u0026 cd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\ncmake --build . --config Release\n```\n\nYou will find the exectable files with the required library files next to in in a `bin/` subdirectory.\n\n## Updating your local copy from Git\n\n```sh\ngit pull origin main\ngit submodule update\n```\n\n## CLI interface\n\nThis program has two ways of being used:\n - through Blender-style JSON configuration files.\n - by manually specifying the lens characteristics on the command line.\n\nOriginally, this tool was made to convert images generated by Blender, from one\nlens type to another. However, as this tool had potential to be used in other\ncontexts, where no configuration files from Blender were available, simpliy\nspecifying which lens-type the input image has directly on the command-line\nwas very desirable. To specify the input image lens-type directly on the\ncommand-line, use the `--no-configs` argument along with `--i-...` flags under\nthe `Input optics` section. When using `equirectangular` panoraminc input\nimages, the `--rotation` flag might prove useful.\n\n\n```\nUsage:\n  ./bin/reproject [OPTION...]\n\n Color processing options:\n      --exposure EV   Exposure compensation in stops (EV) to brigthen or \n                      darken the pictures. (default: 0.0)\n      --reinhard max  Use reinhard tonemapping with given maximum value \n                      (after exposure processing) on the output images. \n                      (default: 1.0)\n\n Filter files options:\n      --filter-prefix prefix  Only include files starting with (default: \n                              \"\")\n      --filter-suffix suffix  Only include files ending with (default: \"\")\n\n Input optics.\n   These are usually inferred by the config JSONs. When specifying\n   --no-configs, lens information needs to be passed through these\n   command line options options:\n      --i-rectilinear focal_length,sensor_width\n                                Input rectilinear images with given \n                                focal_length,sensor_width tuple.\n      --i-equisolid focal_length,sensor_width,fov\n                                Input equisolid images with given \n                                focal_length,sensor_width,fov tuple.\n      --i-equidistant fov       Input equidistant images with given fov \n                                value.\n      --i-equirectangular long_min,long_max,lat_min,lat_max (radians)\n                                Input equirectangular images with given \n                                longitude min,max and latitude min,max \n                                value or 'full'.\n\n Input/output options:\n      --input-cfg json-file     Input JSON file containing lens and camera \n                                settings of the input images.\n      --output-cfg json-file    Output JSON file containing lens and camera \n                                settings of the output images.\n      --no-configs width,height\n                                Work without reading and writing config \n                                files. Requires you to specify the input \n                                lens through the input-optics flags \n                                (staring with -i-...) and the expected \n                                resolution of the input images here.\n  -i, --input-dir file          Input directory containing images to \n                                reproject.\n      --single file             A single input file to convert.\n  -o, --output-dir file         Output directory to put the reprojected \n                                images.\n      --exr                     Output EXR files. Color and depth.\n      --png                     Output PNG files. Color only.\n\n Output optics options:\n      --no-reproject            Do not reproject at all.\n      --rectilinear focal_length,sensor_width\n                                Output rectilinear images with given \n                                focal_length,sensor_width tuple.\n      --equisolid focal_length,sensor_width,fov\n                                Output equisolid images with given \n                                focal_length,sensor_width,fov tuple.\n      --equidistant fov         Output equidistant images with given fov \n                                value.\n      --equirectangular longitude_min,longitude_max,latitude_min,latitude_max\n                                Output equirectangular images with given \n                                longitude min,max and latitude min,max \n                                value or 'full'.\n      --rotation pan, pitch, roll (degrees)\n                                Specify a rotation (default: 0.0)\n\n Runtime options:\n      --skip-if-exists    Skip if the output file already exists.\n  -j, --parallel threads  Number of parallel images to process. (default: \n                          1)\n      --dry-run           Do not actually reproject images. Only produce \n                          config.\n  -h, --help              Show help\n\n Sampling options:\n  -s, --samples number          Number of samples per dimension for \n                                interpolating (default: 1)\n      --nn                      Nearest neighbor interpolation\n      --bl                      Bilinear interpolation\n      --bc                      Bicubic interpolation (default)\n      --scale percentage        Output scale, as a fraction of the input \n                                size. It is recommended to increase \n                                --samples to prevent aliassing in case you \n                                are downscaling. Eg: --scale 0.5 --samples \n                                2 or --scale 0.33334 --samples 3 or --scale \n                                0.25 --samples 4. Final dimensions are \n                                rounded towards zero. (default: 1.0)\n      --output-resolution width,height\n                                A fixed output resolution. Overwrites the \n                                behavior of the 'scale' parameter.\n\n```\n\n### Configuration JSON\nThe configuration JSON files required in the input of the CLI interface are\nflexible. The application will read in the JSON, extract the lens information\nfrom the `\"camera\"`, `\"resolution\"`, and `\"sensor_size\"` keys in the JSON root\nobject, rewrite the values of those keys  to match the new settings, and\nfinally write out the updated JSON to a new file. This way, all custom\ninformation is left untouched and it is more easy to integrate it in other\npipelines and systems.\n\nThe `\"camera\"` object in the root object follows the Blender camera settings\nstructure. This is not always the clearest, but we chose it as we work a lot\nwith Blender and it was straightforward to export the camera and lens\ninformation straight from Blender. Next we show the different lens\nconfiguration templates for the JSON file:\n\n### `rectilinear`\n```json\n{\n  \"camera\": {\n    \"focal_length\": 36.0,\n    \"lens_unit\": \"MILLIMETERS\",\n    \"projection_matrix\": [\n      [ 2.0, 0.0, 0.0, 0.0 ],\n      [ 0.0, 2.0, 0.0, 0.0 ],\n      [ 0.0, 0.0, 0.0, 0.0 ],\n      [ 0.0, 0.0, 0.0, 1.0 ]\n    ],\n    \"type\": \"PERSP\"\n  },\n  \"resolution\": [ 2048, 2048 ],\n  \"sensor_size\": [ 36.0, 36.0 ]\n}\n```\n(Note that more elements may be present in the root object, as the tool just\nignores them, but will copy them over to the output JSON.)\n\n### `equidistant`\n```json\n{\n  \"camera\": {\n    \"type\": \"PANO\",\n    \"panorama_type\": \"FISHEYE_EQUIDISTANT\",\n    \"fisheye_fov\": 3.1415927410125732\n  },\n  \"resolution\": [ 2048, 2048 ],\n  \"sensor_size\": [ 36.0, 36.0 ]\n}\n```\nNote: This lens is not expressed by a focal length. Instead the lens perfectly\nfits a circle of projection on the sensor. The equidistant lens is only\nspecified by a field of view (fov).\n\n### `equisolid`\n```json\n{\n  \"camera\": {\n    \"type\": \"PANO\",\n    \"panorama_type\": \"FISHEYE_EQUISOLID\",\n    \"lens\": 12.5,\n    \"fisheye_fov\": 3.1415927410125732\n  },\n  \"resolution\": [ 2048, 2048 ],\n  \"sensor_size\": [ 36.0, 36.0 ]\n}\n```\nNote: `lens` is the focal length of the lens, expressed in the same unit as the\n`sensor_size` element (typically millimeters). The naming is taken from Blender.\n\n\n## License\n\nSee the [`LICENSE`](https://github.com/IDLabMedia/image-lens-reproject/blob/main/LICENSE) file.\n\n## Credits\n\nTo cite this paper:\n\n\u003c!-- {% raw %} --\u003e\n```bibtex\n@inproceedings{courteaux2022silvr,\n title = {{SILVR: A Synthetic Immersive Large-Volume Plenoptic Dataset}},\n author = {Courteaux, Martijn and Artois, Julie and De Pauw, Stijn and Lambert, Peter and Van Wallendael, Glenn},\n year = {2022},\n doi = {10.1145/3524273.3532890},\n publisher = {Association for Computing Machinery},\n url = {https://doi.org/10.1145/3524273.3532890},\n address = {New York, NY, USA},\n month = {jun},\n numpages = {6},\n isbn = {978-1-4503-9283-9/22/06},\n booktitle = {13th ACM Multimedia Systems Conference (MMSys '22)},\n location = {Athlone, Ireland}\n}\n```\n\u003c!-- {% endraw %} --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlabmedia%2Fimage-lens-reproject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidlabmedia%2Fimage-lens-reproject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlabmedia%2Fimage-lens-reproject/lists"}