python:实现腐蚀膨胀
下面是 Python 实现腐蚀膨胀的代码:
import cv2
import numpy as np
# 读取图片,转为二值化灰度图
img = cv2.imread('image.png', cv2.IMREAD_GRAYSCALE)
ret, binary = cv2.threshold(img
import cv2
import numpy as np
# 读取图片,转为二值化灰度图
img = cv2.imread('image.png', cv2.IMREAD_GRAYSCALE)
ret, binary = cv2.threshold(img