【发布时间】:2021-02-26 21:22:12
【问题描述】:
我有以下图片,它是一本旧书的扫描副本。我想去除由于扫描旧照片而产生的背景噪音(有点偏红)。
更新:
应用opencv 后,按照opencv doc 中的参数设置,我得到以下输出。
请帮助解决这个问题。
我正在使用的代码:
import numpy as np
import cv2
from matplotlib import pyplot as plt
def display_image_in_actual_size(im_data):
dpi = 80
height, width, depth = im_data.shape
# What size does the figure need to be in inches to fit the image?
figsize = width / float(dpi), height / float(dpi)
# Create a figure of the right size with one axes that takes up the full figure
fig = plt.figure(figsize=figsize)
ax = fig.add_axes([0, 0, 1, 1])
# Hide spines, ticks, etc.
ax.axis('off')
# Display the image.
ax.imshow(im_data, cmap='gray')
plt.show()
img = cv2.imread('scan03.jpg')
dst = cv2.fastNlMeansDenoisingColored(img,None,10,10,7,21)
display_image_in_actual_size(img)
display_image_in_actual_size(dst)
【问题讨论】:
-
你也想“美白”红肿吗?如果是这样,您可能需要研究白平衡校正。
标签: python image-processing noise