{"id":13578832,"url":"https://github.com/priyabagaria/Image-Blur-Detection","last_synced_at":"2025-04-05T19:33:54.720Z","repository":{"id":103215804,"uuid":"138461250","full_name":"priyabagaria/Image-Blur-Detection","owner":"priyabagaria","description":"Classification of Blurred and Non-Blurred Images ","archived":false,"fork":false,"pushed_at":"2021-12-08T07:21:38.000Z","size":25,"stargazers_count":121,"open_issues_count":1,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-05T16:49:20.464Z","etag":null,"topics":["image-processing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/priyabagaria.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}},"created_at":"2018-06-24T07:08:56.000Z","updated_at":"2024-10-18T08:53:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b00c5b9-41e8-4343-8a9c-11e3ea039474","html_url":"https://github.com/priyabagaria/Image-Blur-Detection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyabagaria%2FImage-Blur-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyabagaria%2FImage-Blur-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyabagaria%2FImage-Blur-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyabagaria%2FImage-Blur-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/priyabagaria","download_url":"https://codeload.github.com/priyabagaria/Image-Blur-Detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393095,"owners_count":20931804,"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":["image-processing"],"created_at":"2024-08-01T15:01:34.173Z","updated_at":"2025-04-05T19:33:54.399Z","avatar_url":"https://github.com/priyabagaria.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Image-Blur-Detection\nClassification of Blurred and Non-Blurred Images  \n\n**CERTH Image Blur Dataset**\n\n\n\u003e E. Mavridaki, V. Mezaris, \"No-Reference blur assessment in natural images using Fourier transform and spatial pyramids\", Proc. IEEE International Conference on Image Processing (ICIP 2014), Paris, France, October 2014.\n\n\nThe dataset consists of undistorted, naturally-blurred and artificially-blurred images for image quality\nassessment purposes.\nDownload the dataset from here:\nhttp://mklab.iti.gr/files/imageblur/CERTH_ImageBlurDataset.zip\n\nUnzip and load the files into a directory named **CERTH_ImageBlurDataset**\n\n\n\n---\n\n## Variation of the Laplacian\n**Using OpenCV2**\n\nThis method yielded an accuracy of **87.29%**\n\n`cv2.Laplacian(img, cv2.CV_64F).var()`\n\nThe Laplacian Operator is applied on each of the images. \nThe variation of the result is calculated.\nIf the variation is below the threshold, 400 in this case, the image is classified as blurry.\nOtherwise, it is classified as non-blurry.\n\n\nTo run this model:\n\n`python OpenCV_var.py`\n\n---\n\n## Convolutional Neural Network\n\nTo load and pickle train data and its labels:\n\n`python load_traindata.py`\n\nTo load and pickle test data and its labels:\n\n`python load_testdata.py`\n\nA Convolutional Neural Network is trained which yields an accuracy of **67.70%** on the evaluation dataset.\nThe deep learning model has five layers.\nThis accuracy can further be improved by increasing the input dimensions of the first layer in the model and the number of epochs.\nHowever, due to constraints related to computational power, I was unable to run the model.\n\nTo train the CNN:\n\n`python CNN.py`\n\n\n\n---\n\n\n## Maximum of Laplacian\n**Using OpenCV2**\n\nAn accuracy of **63.72%** is achieved using this method.\n\n`gray = cv2.resize(cv2.imread(imagepath, cv2.IMREAD_GRAYSCALE), input_size)`\n\n`numpy.max(cv2.convertScaleAbs(cv2.Laplacian(gray,3)))`\n\n\nThe result of the Laplacian Operator is converted to an absolute scale (0-255).\nThe max of the values is taken for each image.\nThe threshold is set at 215. Values lower than 215, classify the image as out-of-focus or blurry.\nGreater than 215 is classified as non-blurred.\n\nTo run this model:\n\n`python OpenCV_max.py` \n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpriyabagaria%2FImage-Blur-Detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpriyabagaria%2FImage-Blur-Detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpriyabagaria%2FImage-Blur-Detection/lists"}