(img_1, img_2, PIXEL_MAX = 255.0)
| 110 | save_scan_mhda(scanhu, origin, spacing, savePath) |
| 111 | |
| 112 | def 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 | |
| 119 | if __name__ == '__main__': |
nothing calls this directly
no outgoing calls
no test coverage detected