{"id":22894804,"url":"https://github.com/mathusanm6/blur-image","last_synced_at":"2026-04-29T17:36:45.136Z","repository":{"id":229433147,"uuid":"776171665","full_name":"mathusanm6/Blur-Image","owner":"mathusanm6","description":"A Python tool for blurring images pixel by pixel using mathematical algorithms and also providing an approximate solution for sharpening the blurred image.","archived":false,"fork":false,"pushed_at":"2024-05-28T10:02:00.000Z","size":104915,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-29T01:13:21.730Z","etag":null,"topics":["blind-richardson-lucy","blur","convolve","image","image-processing","kernel-convolution","richardson-lucy-deconvolution","scipy","sharpen","sharpen-image"],"latest_commit_sha":null,"homepage":"","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/mathusanm6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-03-22T20:34:06.000Z","updated_at":"2024-06-04T19:13:17.187Z","dependencies_parsed_at":"2024-04-21T11:22:40.281Z","dependency_job_id":"fa66b3a4-96e2-4e57-b0c3-00031a523c8a","html_url":"https://github.com/mathusanm6/Blur-Image","commit_stats":null,"previous_names":["mathusanme/blur-image","mathusanm6/blur-image"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathusanm6%2FBlur-Image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathusanm6%2FBlur-Image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathusanm6%2FBlur-Image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathusanm6%2FBlur-Image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathusanm6","download_url":"https://codeload.github.com/mathusanm6/Blur-Image/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246552966,"owners_count":20795835,"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":["blind-richardson-lucy","blur","convolve","image","image-processing","kernel-convolution","richardson-lucy-deconvolution","scipy","sharpen","sharpen-image"],"created_at":"2024-12-13T23:19:52.474Z","updated_at":"2026-04-29T17:36:40.101Z","avatar_url":"https://github.com/mathusanm6.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blur-Image\n\n## Overview\n\n**Blur-Image** is a compact image processing toolkit developed in Python, designed to improve image sharpness through advanced blurring techniques. Based on the Richardson-Lucy deconvolution algorithm, this toolkit allows users to apply different blur kernels and iterative enhancements to improve image quality.\n\n## Features\n\n- **Blurring and sharpening**: Implement Richardson-Lucy deconvolution for image blurring, as well as standard blurring techniques using different kernels.\n- **Batch image processing**: Process entire directories of images for bulk blurring and sharpening.\n- **Quality measurements**: Calculate and report the Peak Signal-to-Noise Ratio (PSNR) to measure the quality of processed images.\n- **Visual logging**: Color-coded console for easy monitoring of processing steps.\n\n## Installation\n\nClone the repository to your local machine:\n\n```bash\ngit clone https://github.com/mathusanm6/Blur-Image.git\ncd Blur-Image\n```\n\n### Prerequisites\n\nEnsure you have Python installed along with the following packages:\n\n- numpy\n- scipy\n- pillow (PIL)\n\nYou can install the required packages via pip:\n\n```bash\npip install numpy scipy pillow\n```\n\n## Usage\n\nAfter tuning the parameters in the `core.py` and `blind_core.py` files, you can run the toolkit using the following command:\n\n```bash\npython ./run.sh\n```\n\n## Richardson-Lucy Deconvolution\n\nBelow are some examples of images processed by the Blur-Image toolkit, showing the original images, the blurred versions, and the deblurred outputs after applying various kernels and iteration counts.\n\n#### Process\n\nBlurring are done using the following kernels:\n\n- Average 3x3\n- Average 5x5\n- Average 11x11\n- Gaussian 3x3, sigma: 1.0\n- Gaussian 3x3, sigma: 2.0\n- Gaussian 5x5, sigma: 1.0\n- Gaussian 5x5, sigma: 2.0\n\nSharpening are done knowing the kernel used for blurring and the number of iterations using the Richardson-Lucy deconvolution algorithm as follows:\n\n## Richardson-Lucy Deconvolution Algorithm\n\n**Input:** Blurred image `I`, PSF `P`, number of iterations `n_it`  \n**Output:** Restored image `J`\n\n```python\n# Initialize\nJ0 = I\n\n# Iterative deconvolution\nfor n in range(1, n_it + 1):\n    # Convolve Jn with P to obtain a blurred estimation I_estimated\n    I_estimated = convolve(Jn, P)\n\n    # Calculate the relative blur ratio\n    Ratio = I / (I_estimated + epsilon)\n\n    # Convolve this ratio with the mirror of the PSF\n    Correction = convolve(Ratio, P_mirror)\n\n    # Update the estimation\n    Jn = Jn * Correction\n\n# Return the final restored image\nreturn Jn_it\n```\n\n#### Original Image\n\n\u003cdiv align=\"center\" style=\"display: flex; justify-content: center; align-items: center;\"\u003e\n  \u003cp style=\"margin-right: 20px; display: flex; flex-direction: column; align-items: center;\"\u003e\n    \u003cimg src=\"images/originals/flower.jpg\" alt=\"grayscale flower\" width=\"200\"\u003e\n    \u003cbr\u003e\n    \u003cp style=\"margin-top: auto;\"\u003e(1) Grayscale Flower\u003c/p\u003e\n  \u003c/p\u003e\n  \u003cp style=\"margin-left: 20px; display: flex; flex-direction: column; align-items: center;\"\u003e\n    \u003cimg src=\"images/originals/tiger.jpeg\" alt=\"tiger\" width=\"200\"\u003e\n    \u003cbr\u003e\n    \u003cp style=\"margin-top: auto;\"\u003e(2) Tiger\u003c/p\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n#### Processed Images\n\n##### (1) Grayscale Flower\n\n\u003ctable style=\"width: 100%; border-collapse: collapse;\"\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eAverage 3x3\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eAverage 5x5\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eAverage 11x11\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 3x3, sigma: 1.0\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 3x3, sigma: 2.0\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 5x5, sigma: 1.0\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 5x5, sigma: 2.0\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" align=\"center\" style=\"text-align: center;\"\u003e\u003cstrong\u003eBlurred Images\u003c/strong\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_3x3/blurred.png\" alt=\"blurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_5x5/blurred.png\" alt=\"blurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_11x11/blurred.png\" alt=\"blurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_3x3_sigma1.0/blurred.png\" alt=\"blurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_3x3_sigma2.0/blurred.png\" alt=\"blurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_5x5_sigma1.0/blurred.png\" alt=\"blurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_5x5_sigma2.0/blurred.png\" alt=\"blurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" align=\"center\" style=\"text-align: center;\"\u003e\u003cstrong\u003eUnblurred Images\u003c/strong\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_3x3/unblurred_5-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_5x5/unblurred_5-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_11x11/unblurred_5-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_3x3_sigma1.0/unblurred_5-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_3x3_sigma2.0/unblurred_5-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_5x5_sigma1.0/unblurred_5-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_5x5_sigma2.0/unblurred_5-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" style=\"text-align: center;\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_3x3/unblurred_10-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_5x5/unblurred_10-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_11x11/unblurred_10-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_3x3_sigma1.0/unblurred_10-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_3x3_sigma2.0/unblurred_10-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_5x5_sigma1.0/unblurred_10-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_5x5_sigma2.0/unblurred_10-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" style=\"text-align: center;\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_3x3/unblurred_15-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_5x5/unblurred_15-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/average_11x11/unblurred_15-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_3x3_sigma1.0/unblurred_15-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_3x3_sigma2.0/unblurred_15-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_5x5_sigma1.0/unblurred_15-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/flower/gaussian_5x5_sigma2.0/unblurred_15-iter.png\" alt=\"unblurred flower\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n##### (2) Tiger\n\n\u003ctable style=\"width: 100%; border-collapse: collapse;\"\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eAverage 3x3\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eAverage 5x5\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eAverage 11x11\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 3x3, sigma: 1.0\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 3x3, sigma: 2.0\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 5x5, sigma: 1.0\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 5x5, sigma: 2.0\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" align=\"center\" style=\"text-align: center;\"\u003e\u003cstrong\u003eBlurred Images\u003c/strong\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_3x3/blurred.png\" alt=\"blurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_5x5/blurred.png\" alt=\"blurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_11x11/blurred.png\" alt=\"blurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_3x3_sigma1.0/blurred.png\" alt=\"blurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_3x3_sigma2.0/blurred.png\" alt=\"blurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_5x5_sigma1.0/blurred.png\" alt=\"blurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_5x5_sigma2.0/blurred.png\" alt=\"blurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" align=\"center\" style=\"text-align: center;\"\u003e\u003cstrong\u003eUnblurred Images\u003c/strong\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_3x3/unblurred_5-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_5x5/unblurred_5-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_11x11/unblurred_5-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_3x3_sigma1.0/unblurred_5-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_3x3_sigma2.0/unblurred_5-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_5x5_sigma1.0/unblurred_5-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_5x5_sigma2.0/unblurred_5-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e5 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" style=\"text-align: center;\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_3x3/unblurred_10-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_5x5/unblurred_10-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_11x11/unblurred_10-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_3x3_sigma1.0/unblurred_10-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_3x3_sigma2.0/unblurred_10-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_5x5_sigma1.0/unblurred_10-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_5x5_sigma2.0/unblurred_10-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e10 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" style=\"text-align: center;\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_3x3/unblurred_15-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_5x5/unblurred_15-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/average_11x11/unblurred_15-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_3x3_sigma1.0/unblurred_15-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_3x3_sigma2.0/unblurred_15-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_5x5_sigma1.0/unblurred_15-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/processed/tiger/gaussian_5x5_sigma2.0/unblurred_15-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Blind Richardson-Lucy Deconvolution\n\n### Process\n\nSharpening are done not knowing the kernel used for blurring and the number of iterations using the Blind Richardson-Lucy deconvolution algorithm as follows:\n\n## Blind Richardson-Lucy Deconvolution Algorithm\n\n**Input:** Blurred image `I`, initial PSF `P`, number of iterations for image `n_it`, number of iterations for PSF `psf_it`  \n**Output:** Restored image `J`, refined PSF `P`\n\n```python\n# Initialize\nJ0 = I\n\n# Iterative deconvolution\nfor n in range(1, n_it + 1):\n    # Convolve Jn with P to obtain a blurred estimation I_estimated\n    I_estimated = convolve(Jn, P)\n\n    # Calculate the relative blur ratio\n    Ratio = I / (I_estimated + epsilon)\n\n    # Convolve this ratio with the mirror of the PSF\n    Correction = convolve(Ratio, P_mirror)\n\n    # Update the estimation\n    Jn = Jn * Correction\n\n    # PSF refinement\n    for m in range(1, psf_it + 1):\n        # Convolve Jn+1 with P to obtain a new blurred estimation I_estimated\n        I_estimated = convolve(Jn, P)\n\n        # Calculate the error ratio\n        E = I / (I_estimated + epsilon)\n\n        # Convolve this ratio with the mirror of the restored image Jn+1\n        PSF_Update = convolve(E, Jn_mirror)\n\n        # Update the PSF\n        P = P * PSF_Update\n\n        # Normalize the PSF\n        P = P / sum(P)\n\n# Return the final restored image and refined PSF\nreturn Jn_it, P\n```\n\n### Original Image\n\n\u003cdiv align=\"center\" style=\"display: flex; justify-content: center; align-items: center;\"\u003e\n  \u003cp style=\"margin-right: 20px; display: flex; flex-direction: column; align-items: center;\"\u003e\n    \u003cimg src=\"images/blind_originals/tiger.png\" alt=\"blurred tiger\" width=\"200\"\u003e\n    \u003cbr\u003e\n    \u003cp align=\"center\" style=\"margin-top: auto;\"\u003e(A) Blurred tiger (Unknown Kernel)\u003c/p\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n### Processed Images\n\n#### (A) Blurred Tiger (Unknown Kernel)\n\n\u003ctable style=\"width: 100%; border-collapse: collapse;\"\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eAverage 3x3\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eAverage 5x5\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eAverage 11x11\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 5x5, sigma: 1.0\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cp align=\"center\" style=\"font-weight: bold;\"\u003eGaussian 5x5, sigma: 2.0\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" style=\"text-align: center;\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_5x5/tiger_unblurred_15-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_5x5/tiger_unblurred_15-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_11x11/tiger_unblurred_15-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/gaussian_5x5_sigma1.0/tiger_unblurred_15-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/gaussian_5x5_sigma2.0/tiger_unblurred_15-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e15 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" style=\"text-align: center;\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_5x5/tiger_unblurred_30-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e30 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_5x5/tiger_unblurred_30-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e30 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_11x11/tiger_unblurred_30-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e30 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/gaussian_5x5_sigma1.0/tiger_unblurred_30-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e30 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/gaussian_5x5_sigma2.0/tiger_unblurred_30-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e30 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" style=\"text-align: center;\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_5x5/tiger_unblurred_60-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e60 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_5x5/tiger_unblurred_60-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e60 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_11x11/tiger_unblurred_60-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e60 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/gaussian_5x5_sigma1.0/tiger_unblurred_60-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e60 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/gaussian_5x5_sigma2.0/tiger_unblurred_60-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e60 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"7\" style=\"text-align: center;\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_5x5/tiger_unblurred_120-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e120 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_5x5/tiger_unblurred_120-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e120 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/average_11x11/tiger_unblurred_120-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e120 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/gaussian_5x5_sigma1.0/tiger_unblurred_120-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e120 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n        \u003ctd style=\"text-align: center;\"\u003e\n            \u003cimg src=\"images/blind_processed/tiger/gaussian_5x5_sigma2.0/tiger_unblurred_120-iter_25-psf-iter.png\" alt=\"unblurred tiger\" width=\"200\"\u003e\n            \u003cbr\u003e\n            \u003cp align=\"center\"\u003e120 Iterations, 25 PSF Iterations\u003c/p\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathusanm6%2Fblur-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathusanm6%2Fblur-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathusanm6%2Fblur-image/lists"}