[英]removing black dots from image using OpenCV and Python
我正在嘗試比較兩個圖像,並且需要在與數字副本進行比較之前對它們進行預處理/清理,這是掃描副本。 掃描副本 / 數碼副本
我在掃描的圖像上運行此代碼,並獲得了包含許多黑點的輸出。 不確定如何清理這些內容,以便可以與數字副本進行比較
img = cv2.multiply(img, 1.2)
kernel = np.ones((1, 1), np.uint8)
img = cv2.erode(img, kernel, iterations=1)
kernel1 = np.zeros( (9,9), np.float32)
kernel1[4,4] = 2.0
boxFilter = np.ones( (9,9), np.float32) / 81.0
kernel1 = kernel1 - boxFilter
img = cv2.filter2D(img, -1, kernel1)
以下是我得到的輸出
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.