主要依赖包:
numpy
tqdm
Pillow
使用方法:
python exp4.py
q = 2
for i in range(24):
name = str(i+1).zfill(2)
print("正在处理[{}/{}]:".format(name, 24))
img = Image.open("dataset/kodim{}.png".format(name))
encoder = Encoder()
encoder.encode(img, "bin/kodim{}.bin".format(name), q)
decoder = Decoder()
img = decoder.decode("bin/kodim{}.bin".format(name), q)
img.save("res/kodim{}.bmp".format(name))
ratio = 0.
psnr = 0.
for i in range(24):
name = str(i+1).zfill(2)
bmp_
2023-03-13 17:00:12
40.36MB
python
1