import torch
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from PIL import Image
import cv2
import os
from misc import visualize_rgb ,visualize_image, gray_image, process_image,PSNR, fft_relu, findM

import numpy as np
def main():
    l = 0
    for i in range(4):
        for j in range(8):
            l+=1
            # real = f'levin_real/im0{i+1}_ker0{j+1}.png'
            # real = Image.open(real)
            # real = process_image(real) / 255.0
            
            #Subject to change
            # test = f'levin_test/im0{i+1}_ker0{j+1}.png'

            # test = f'results/Levin_chen/{l:04}.png'
            # test = f'results/Levin_pmp/tvmpr_im0{i+1}_ker0{j+1}.png'
            test = f'results/radi/Levin_Radi_{i+1}_{j+1}.png'
            test = Image.open(test)
            test = process_image(test) / 255.0


            gt = f'groundtruths/Levin/im0{i+1}_ker0{j+1}.png'
            gt = Image.open(gt)
            gt = process_image(gt) / 255.0

            print(((gt-test)**2).sum())

            

            
            
    # plt.show()  
            

if __name__ == "__main__":
    main()