python3 opencv3.4.5.20(高版本可行) 实现 matlab 去除小面积对象 bwareaopen函数
def bwareaopen(image, p, level):
#image为传入的灰度图或二值化后的图,p为小面积的大小,level为函数内部二值化阈值
import cv2
area = []
area1 = []
# 二值化函数
ret, binary = cv2.threshold(image, level, 255, cv2.THRES...
原创
2019-08-28 18:19:56 ·
2277 阅读 ·
0 评论