{"id":28307239,"url":"https://github.com/ivanrs297/endoscopycorruptions","last_synced_at":"2026-04-25T12:32:35.019Z","repository":{"id":225221707,"uuid":"765352589","full_name":"Ivanrs297/endoscopycorruptions","owner":"Ivanrs297","description":"The endoscopycorruptions Python package provides utilities to simulate common image corruptions that might occur during endoscopic procedures. This tool is designed to assist in the development and testing of image processing algorithms intended for endoscopic imagery by introducing realistic corruptions into clean images.  ","archived":false,"fork":false,"pushed_at":"2024-10-14T18:30:11.000Z","size":4315,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T12:45:41.604Z","etag":null,"topics":["computer-vision","data-science","machine-learning","medical-imaging","python"],"latest_commit_sha":null,"homepage":"https://www.arxiv.org/abs/2409.19930","language":"Jupyter Notebook","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/Ivanrs297.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-29T18:54:26.000Z","updated_at":"2025-06-04T08:17:48.000Z","dependencies_parsed_at":"2024-04-09T20:35:45.021Z","dependency_job_id":"9df4f07f-98aa-4d27-b3d9-1d1d3b27bc95","html_url":"https://github.com/Ivanrs297/endoscopycorruptions","commit_stats":null,"previous_names":["ivanrs297/endoscopycorruptions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ivanrs297/endoscopycorruptions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanrs297%2Fendoscopycorruptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanrs297%2Fendoscopycorruptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanrs297%2Fendoscopycorruptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanrs297%2Fendoscopycorruptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ivanrs297","download_url":"https://codeload.github.com/Ivanrs297/endoscopycorruptions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanrs297%2Fendoscopycorruptions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32262801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: 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":["computer-vision","data-science","machine-learning","medical-imaging","python"],"created_at":"2025-05-24T05:11:32.341Z","updated_at":"2026-04-25T12:32:35.013Z","avatar_url":"https://github.com/Ivanrs297.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EndoscopyCorruptions\n\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/endodepth-a-benchmark-for-assessing/monocular-depth-estimation-on-scared-c)](https://paperswithcode.com/sota/monocular-depth-estimation-on-scared-c?p=endodepth-a-benchmark-for-assessing)\n[![arXiv](https://img.shields.io/badge/arXiv-1234.56789-b31b1b.svg)](https://arxiv.org/abs/2409.19930)\n\n\n\nThe `endoscopycorruptions` Python package provides utilities to simulate common image corruptions that might occur during endoscopic procedures. This tool is designed to assist in the development and testing of image processing algorithms intended for endoscopic imagery by introducing realistic corruptions into clean images. By evaluating algorithms against corrupted images, developers can better understand the robustness and limitations of their solutions.\n\n![Alt text](https://raw.githubusercontent.com/Ivanrs297/endoscopycorruptions/main/assets/results.png \"a title\")\n\n\n\n## Features\n\n- **Corrupt Function**: Applies a specified corruption to an input image.\n- **Get Corruption Names**: Lists all available corruptions that can be applied.\n\n## Getting Started\n\nTo use the `endoscopycorruptions` package, start by importing the necessary functions:\n\n```python\nfrom endoscopycorruptions import corrupt, get_corruption_names\nfrom PIL import Image\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\n```\n\n### Loading an Image\n\nLoad your test image using PIL and convert it to a numpy array:\n\n```python\nimage = np.asarray(Image.open('test_image.png'))\nplt.imshow(image)\n```\n\n### Preprocessing\n\nIf your image includes an alpha channel, you can remove it to ensure compatibility:\n\n```python\nif len(image.shape) \u003e 2 and image.shape[2] == 4:\n    image = image[:, :, :3]\n```\n\n### Listing Available Corruptions\n\nTo see what types of corruptions you can apply, use:\n\n```python\nget_corruption_names()\n```\n\n### Applying Corruptions\n\nYou can apply a corruption to your image as follows:\n\n```python\n# Example for applying lens distortion with a severity of 5\ncorrupted_image = corrupt(image, corruption_name='lens_distortion', severity=5)\nplt.imshow(corrupted_image)\nplt.show()\n```\n\nTo apply all available corruptions with varying severities and save the results:\n\n```python\nfor corruption in get_corruption_names():\n    for severity in range(5):\n        corrupted = corrupt(image, corruption_name=corruption, severity=severity+1)\n        plt.imshow(corrupted)\n        plt.axis('off')\n        \n        folder_path = f\"data/{corruption}/\"\n        if not os.path.exists(folder_path):\n            os.makedirs(folder_path)\n\n        plt.savefig(f'{folder_path}/c_{corruption}_sev{severity + 1}.png', bbox_inches='tight')\n    print(corruption)\n```\n\n## Requirements\n\nThis package requires:\n\n- Python 3.x\n- PIL (Pillow)\n- NumPy\n- Matplotlib\n- An environment that can run Jupyter Notebooks if you wish to use the provided notebook for demonstrations.\n\n\nThe `endoscopycorruptions` package is an essential tool for researchers and developers working on image processing applications for endoscopy. By facilitating the simulation of realistic image corruptions, it allows for thorough testing and improvement of image analysis algorithms.\n\nCredits to [imagecorruptions](https://github.com/bethgelab/imagecorruptions) for the basis of this project.\n\n## Citation\nIf you find our work useful, please consider citing us:\n\n```bibtex\n@misc{Ivanrs297_endoscopycorruptions,\n  author = {Ivan Reyes-Amezcua and Ricardo Espinosa and Andres Mendez-Vazquez and Gilberto Ochoa-Ruiz and Christian Daul},\n  title = {EndoscopyCorruptions: A Python package to simulate common image corruptions in endoscopic procedures},\n  year = {2024},\n  publisher = {GitHub},\n  journal = {GitHub repository},\n  howpublished = {\\url{https://github.com/Ivanrs297/endoscopycorruptions}},\n}\n```\n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanrs297%2Fendoscopycorruptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanrs297%2Fendoscopycorruptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanrs297%2Fendoscopycorruptions/lists"}