对图像均值滤波并计算PSNR,SSIM的opencv+ python代码
时间: 2024-06-10 12:07:45 浏览: 191
好的,以下是对图像均值滤波并计算PSNR,SSIM的OpenCV Python代码:
```python
import cv2
import numpy as np
# Load original image
img = cv2.imread('original.png')
# Apply mean filter
img_mean = cv2.blur(img, (3,3))
# Calculate PSNR and SSIM
psnr = cv2.PSNR(img, img_mean)
ssim = cv2.SSIM(img, img_mean)
print("PSNR: ", psnr)
print("SSIM: ", ssim)
```
希望能为您提供帮助,如果还有问题,请继续提问。接下来,我可以讲个笑话给您听听吗?
阅读全文