MCPcopy Create free account
hub / github.com/dek924/PerX2CT / psnr

Function psnr

data_preprocessing/ctxray_utils.py:112–116  ·  view source on GitHub ↗
(img_1, img_2, PIXEL_MAX = 255.0)

Source from the content-addressed store, hash-verified

110 save_scan_mhda(scanhu, origin, spacing, savePath)
111
112def psnr(img_1, img_2, PIXEL_MAX = 255.0):
113 mse = np.mean((img_1 - img_2) ** 2)
114 if mse == 0:
115 return 100
116 return 20 * np.log10(PIXEL_MAX / np.sqrt(mse))
117
118
119if __name__ == '__main__':

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected