{"id":23694867,"url":"https://github.com/Badawy403/EnhanceIQ","last_synced_at":"2026-01-20T14:30:22.331Z","repository":{"id":214682991,"uuid":"737101987","full_name":"0xBadawy/EnhanceIQ","owner":"0xBadawy","description":"Image processing employs filters like Histogram Equalization and Gaussian for enhancement, with metrics like PSNR and SSIM evaluating image quality and similarity.","archived":false,"fork":false,"pushed_at":"2024-03-23T09:41:46.000Z","size":29875,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T04:32:13.468Z","etag":null,"topics":["gaussian","histogram-equalization","image-processing","psnr","ssim"],"latest_commit_sha":null,"homepage":"","language":null,"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/0xBadawy.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}},"created_at":"2023-12-29T20:30:47.000Z","updated_at":"2024-02-13T13:32:32.000Z","dependencies_parsed_at":"2023-12-29T22:41:26.366Z","dependency_job_id":"c4ccd6dd-956e-49a7-8826-a23cb1b8b9f5","html_url":"https://github.com/0xBadawy/EnhanceIQ","commit_stats":null,"previous_names":["mohamed-badawy-sayed/image_processing_filters","0xbadawy/enhanceiq"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xBadawy%2FEnhanceIQ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xBadawy%2FEnhanceIQ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xBadawy%2FEnhanceIQ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xBadawy%2FEnhanceIQ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xBadawy","download_url":"https://codeload.github.com/0xBadawy/EnhanceIQ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239763668,"owners_count":19692802,"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":["gaussian","histogram-equalization","image-processing","psnr","ssim"],"created_at":"2024-12-30T04:30:17.838Z","updated_at":"2026-01-20T14:30:22.237Z","avatar_url":"https://github.com/0xBadawy.png","language":null,"readme":"\n \u003ch1 style=\"text-align: center;\"\u003eImage Processing Filters\u003c/h1\u003e\n\n\n## Histogram Equalization\n\nHistogram equalization is a method in image proccessing  baesd on histogram of an image. it is used especially when the image is represented by a narrow range of intensity values.\nits main functionality is to make the image's pixels have better  distributed on the histogram.\n \n\n\n\n## difference of gaussian (DOG) \n\nIn order to explain the DOG filter, we should first explain gaussian filter.\n\nGassian filter is based on the mathematical concept of the Gaussian function, which is a bell-shaped curve.\n\n\n\n●π is the mathematical constant Pi (approximately 3.14159).\n\n●σ is the standard deviation of the Gaussian distribution, controlling the spread of the curve.\n\n●e is the mathematical constant Euler's number (approximately 2.71828).\n\n●G(x,y) is the value of the 2D Gaussian function at position (x,y)\n\nThe primary purpose of applying a Gaussian filter to an image is to reduce noise by smoothing the image \n\nNow let us explain GOG filter:\n\nThe Difference of Gaussians (DoG) filter is used in image processing to enhance edges and identify features at different scales.\nIt is obtained by subtracting one blurred version of an image from another, where each version is created using a Gaussian filter with a different standard deviation.\n\n##  MSR Filter \nThe Multiscale Retinex algorithm is an image enhancement technique that aims \nto improve the contrast of an image by normalizing pixel values across different scales. \nThe algorithm operates by applying a series of operations at multiple scales.\n\n1- define some parameters for applying the algorithm \n\n\tsigma: the standard deviation for the Gaussian filter.\n \n\tscales: the scales at which the MSR algorithm operates.\n \n\tfilt_size: the size of the Gaussian filter.\n \n\tenhanced: a matrix filled with zeros which will accumulates the Retinex components of the image.\n\n2- iterate through each scale specified in scales and do the following:\n\n\t- apply the Gaussian Filter to the image at the current scale (Which was explained in the DOG filter).\n \n\t- calculate the Retinex component for the current scale.\n \n\t- accumulate the Retinex component to %enhanced%\n\n3- Normalize the enhanced image to the range [0, 255] and convert it back to uint8\n\n\n\n## PSNR\nThe PSNR block computes the peak signal-to-noise ratio, in decibels, between two images. This ratio is used as a quality measurement between the original and a compressed image. The higher the PSNR, the better the quality of the compressed, or reconstructed image.\n\nPSNR = 10log10((L-1)^2/MSE\n\nHere, L is the number of maximum possible intensity levels (minimum intensity level suppose to be 0) in an image.\n\nMSE = 1/m*n ΣΣ(O(i,j)-D(i,j))^2\nWhere, O represents the matrix data of original image. D represents the matrix data of degraded image. m represents the numbers of rows of pixels and i represents the index of that row of the image. n represents the number of columns of pixels and j represents the index of that column of the image.\n\n\n\n## SSIM \nStructural Similarity Index is a metric used to measure the similarity between two images. SSIM takes into account luminance, contrast, and structure, which are important aspects of human perception. The index produces a value between -1 and 1, where 1 indicates perfect similarity, -1 indicates perfect dissimilarity, and 0 means no similarity.\nSSIM is widely used in image processing and computer vision to evaluate the quality of compressed images, assess the impact of image processing algorithms, or compare the similarity between an original image and a processed one. It provides a more comprehensive assessment than traditional metrics like Mean Squared Error (MSE), as it considers both global and local variations in image structure.\n\n## Code to use \n```matlab\ninput=datastore(\"dataset\");\ngaussian1 = fspecial('Gaussian', 10, 1.07);\ngaussian2 = fspecial('Gaussian', 10, 1);\ndog = gaussian1 - gaussian2;\nsigma = 5;\nscales = [15, 80, 250];\nfilt_size = 2 * ceil(3 * sigma) + 1;\nPsnr_histo=0;\nPsnr_MSR=0;\nPsnr_DoG=0;\nSSIM_histo=0;\nSSIM_MSR=0;\nSSIM_DoG=0;\n\nfor i=1:length(input.Files)\n    img=input.read();\n    img=rgb2ycbcr(img);\n    img2=img;\n    GrayLevel=img(:,:,1);\n    disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');\n    \n    \n    %%%%%%%%%%%%% apply histogram%%%%%%%%%%%%%%%%%\n    HistImage=histeq(GrayLevel);\n    img(:,:,1)=HistImage;\n    imwrite(ycbcr2rgb(img),['Histogram/img' int2str(i) '.jpg']);\n    Psnr_histo=Psnr_histo+psnr(img,img2);\n    SSIM_histo=SSIM_histo+ssim(img,img2);\n    disp (['psnr for image ' int2str(i) ' after apply Histogram equalization equals to '  num2str(psnr(img,img2))]);\n    disp (['ssim for image ' int2str(i) ' after apply Histogram equalization equals to '  num2str(ssim(img,img2))]);\n    \n\n\n    %%%%%%%%%%%%% apply DoG %%%%%%%%%%%%%%%%%%%%%%\n    DoGImage=conv2(double(GrayLevel), dog, 'same');\n    DoGImage=uint8(255*DoGImage);\n    img(:,:,1)=DoGImage;\n    imwrite(ycbcr2rgb(img),['DOG/img' int2str(i) '.jpg']);\n    Psnr_DoG=Psnr_DoG+psnr(img,img2);\n    SSIM_DoG=SSIM_DoG+ssim(img,img2);\n    disp (['psnr for image ' int2str(i) ' after apply DoG equals to '  num2str(psnr(img,img2))]);\n    disp (['ssim for image ' int2str(i) ' after apply DoG equals to '  num2str(ssim(img,img2))]);\n    \n\n\n    %%%%%%%%%%%%% apply MSR %%%%%%%%%%%%%%%%%%%%%%\n    Img = double(GrayLevel);\n    enhanced = zeros(size(Img));\n    for j = 1:length(scales)\n        gaussian_filter = fspecial('gaussian', [filt_size, filt_size], sigma * scales(j));\n        blurred_image = imfilter(Img, gaussian_filter, 'conv');\n     \n        retinex_component = log(Img + 1) - log(blurred_image + 1);\n     \n        enhanced = enhanced + retinex_component;\n    end\n    enhanced = uint8( (enhanced - min(enhanced(:))) / (max(enhanced(:)) - min(enhanced(:))) * 255 );\n    img(:,:,1)=enhanced;\n    imwrite(ycbcr2rgb(img),['MSR/img' int2str(i) '.jpg']);\n    Psnr_MSR=Psnr_MSR+psnr(img,img2);\n    SSIM_MSR=SSIM_MSR+ssim(img,img2);\n    disp (['psnr for image ' int2str(i) ' after apply MSR equals to '  num2str(psnr(img,img2))]);\n    disp (['ssim for image ' int2str(i) ' after apply MSR equals to '  num2str(ssim(img,img2))]);\n    \n    \n    disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');\n    \n    \nend\nPsnr_MSR=Psnr_MSR/length(input.Files);\nPsnr_DoG=Psnr_DoG/length(input.Files);\nPsnr_histo=Psnr_histo/length(input.Files);\nSSIM_MSR=SSIM_MSR/length(input.Files);\nSSIM_DoG=SSIM_DoG/length(input.Files);\nSSIM_histo=SSIM_histo/length(input.Files);\ndisp(['average Psnr for histogram equalization is ' num2str(Psnr_histo)]);\ndisp(['average Psnrfor MSR is ' num2str(Psnr_MSR)]);\ndisp(['average Psnr for DoG is ' num2str(Psnr_DoG)]);\ndisp(['average ssim for histogram equalization is ' num2str(SSIM_histo)]);\ndisp(['average ssim for MSR is ' num2str(SSIM_MSR)]);\ndisp(['average ssim for DoG is ' num2str(SSIM_DoG)]);\n\n```\n\n## Filter on color\n[![](https://github.com/Mohamed-badawy-sayed/image_processing_Filters/blob/3675e6f05ed44220d019cced422d64c779c3d86b/repo/Image%20num%20(8).png)]()\n\n\n## Filter on grayscale\n[![](https://github.com/Mohamed-badawy-sayed/image_processing_Filters/blob/3675e6f05ed44220d019cced422d64c779c3d86b/repo/Image%20num%20(5).png)]()\n\n## PSNR Measurements\n\n| [![](https://github.com/Mohamed-badawy-sayed/image_processing_Filters/blob/3675e6f05ed44220d019cced422d64c779c3d86b/repo/Image%20num%20(6).png)]() |\n|----------------------------------------------------------------------------------------------------------------------------------------------------|\n\n| MSR     | Hist    | DOG  |\n|---------|---------|------|\n| 11.6054 | 16.6246 | 5.97 |\n\n## SSIM Measurements\n\n| [![](https://github.com/Mohamed-badawy-sayed/image_processing_Filters/blob/3675e6f05ed44220d019cced422d64c779c3d86b/repo/Image%20num%20(7).png)]() |\n|----------------------------------------------------------------------------------------------------------------------------------------------------|\n\n| MSR   | Hist   | DOG     |\n|-------|--------|---------|\n| 0.713 | 0.7583 | -0.0811 |\n\n\n\n## contributors\n\n\u003ctable style=\"margin: auto;\"\u003e\n        \u003ctr\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/0xBadawy\"\u003e\u003cimg src=\"https://github.com/Mohamed-badawy-sayed/info/blob/baf974551d6a6ccc8b8429f99c7f656b9529ec78/repo/images/file/profile%20(1).png\" alt=\"Image 1\" width=\"100px\"\u003e\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/Mostafa-El-gelany\"\u003e\u003cimg src=\"https://github.com/Mohamed-badawy-sayed/info/blob/baf974551d6a6ccc8b8429f99c7f656b9529ec78/repo/images/file/profile%20(2).png\" alt=\"Image 1\" width=\"100px\"\u003e\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/Ahmed-Nageh-Abbas\"\u003e\u003cimg src=\"https://github.com/Mohamed-badawy-sayed/info/blob/baf974551d6a6ccc8b8429f99c7f656b9529ec78/repo/images/file/profile%20(3).png\" alt=\"Image 1\" width=\"100px\"\u003e\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/Mahmoud-Khalell\"\u003e\u003cimg src=\"https://github.com/Mohamed-badawy-sayed/info/blob/baf974551d6a6ccc8b8429f99c7f656b9529ec78/repo/images/file/profile%20(4).png\" alt=\"Image 1\" width=\"100px\"\u003e\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/nadamaaman55\"\u003e\u003cimg src=\"https://github.com/Mohamed-badawy-sayed/info/blob/baf974551d6a6ccc8b8429f99c7f656b9529ec78/repo/images/file/profile%20(6).png\" alt=\"Image 1\" width=\"100px\"\u003e\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/Basant-Benyamen\"\u003e\u003cimg src=\"https://github.com/Mohamed-badawy-sayed/info/blob/baf974551d6a6ccc8b8429f99c7f656b9529ec78/repo/images/file/profile%20(5).png\" alt=\"Image 1\" width=\"100px\"\u003e\u003c/a\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/0xBadawy\"\u003e Mohamed badawy\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/Mostafa-El-gelany\"\u003eMostafa El-gelany\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/Ahmed-Nageh-Abbas\"\u003eAhmed Nageh\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/Mahmoud-Khalell\"\u003eMahmoud Khalell\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/nadamaaman55\"\u003eNada Maaman\u003c/a\u003e\u003c/td\u003e\n            \u003ctd style=\"text-align: center;\"\u003e\u003ca href=\"https://github.com/Basant-Benyamen\"\u003eBasant Benyamen\u003c/a\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/table\u003e\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBadawy403%2FEnhanceIQ","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBadawy403%2FEnhanceIQ","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBadawy403%2FEnhanceIQ/lists"}