"""
The signal-to-noise ratio (SNR) is measure of the sensitivity of
imaging. Industry standards measure SNR in decibels (dB) of power and therefore apply the 10 log rule to the "pure" SNR ratio
Peak signal-to-noise ratio, often abbreviated PSNR, is the ratio between the maximum possible
power of a signal and the power of corrupting noise that affects the fidelity of its representation.
"""
from Catalano.Imaging.Tools import ObjectiveFidelity
from Catalano.Imaging import FastBitmap
from jhplot import *
print Web.get("https://datamelt.org/examples/data/logo_jhepwork.png")
print Web.get("https://jdatamelt.org/examples/data/logo_jhepwork_noisy.png")
original=FastBitmap("logo_jhepwork.png")
original.toGrayscale()
reconstructed=FastBitmap("logo_jhepwork_noisy.png")
reconstructed.toGrayscale()
#print original.getGrayData()
#print original.getSize()
img=ObjectiveFidelity(original,reconstructed)
print "Mean square signal-to-noise ratio (SNR)",img.getSNR()
# Reference: A New Objective Fidelity Criterion For Image Processing: Derivative SNR - Hakki Tarkan Yalazan, and Melek D. Yucel.
print "Derivative Signal noise ratio=",img.getDSNR()
print "Peak signal-to-noise ratio (PSNR)=",img.getPSNR()
# References: Wang, Zhou, and Alan C. Bovik. "A universal image quality index." Signal Processing Letters, IEEE 9.3 (2002): 81-84.
print "Universal Quality Index",img.getUniversalQualityIndex()
Ads help maintain this website.