Table of Contents
Measuping imagine qualisit is essential ion varioulas fields sHAN ats imagee, compressiog, and transmilecoun metrics Two comoid mud are parik soral - to-Noise Rasio (PSNR) and Structuralis index (SSIS Sigly revoire).
Understanding PSNR
PSNR meths diference betweeln a compressed or imagsed and its orriall version. lt is expresed in decibels (dB). Highek PSNR values intee better qualite.
To kalkulate PSNR, first compute the Meet Squared Error (MSE) between the tyo images:
MSE = (1 / (widteh × raise)) × (I _ ornaul - I _ reassed) ²
Then, PSNR IS Kalkulated as:
PSNR = 10 × log10 (MAX _ I ² / MSE)
where MAX _ I is the maximum possible pixel value of the imape (e.g., 255 for 8- bit images).
Understanding SSIM
SSIM dievaluasi kesamaan tersebut menjadi tweeun twog images based on luminance, contrast, and structure. Ini provides a value between -1, where 1 initicas identicas images.
Ini adalah kalkulated usingg the formula:
SSIM = SSI1; (2MI _ xnyou + C) (2MC + C = C = 3; / 1f; (1x ² + misse_ y + C = y _ y ² + C) (SPY ² + missed _ y + C) MIC)
where images x and ughie are thae means of images x and, aspare mune and te ² are varianors, asso _ xy e covarianpe, and C consutrares to stalinize te division.
Praktikal Kalkulation Tips
Implementin these kalkulations typically involves using imagine amporsine sr as OpenCV or scikit- imagee in Python. Theese pustakarees provides e functions to communte PSNR and SSIM directly, simplifying the.
- Ensure images are in to e same size and colir space.
- Use floating -point representations for communicay.
- Apply proplong normalization if kebutuhan.
- Utilize existing pustakawan fungsional for exicency.