赞
踩
import cv2 as cv
import cv2
import numpy as np
import time
from matplotlib import pyplot as plt
value = 60
value1 = 0
canny_min = 100
canny_max = 150
minlineLength = 200
maxlineGap = 10
area_threshold = 90
#用于去除杂点
def removeLittlePoint(img,threshold):
image, contours, hierarch = cv2.findContours(img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
for i in range(len(contours)):
area = cv2.contourArea(contours[i])
if area < threshold:
cv2.drawContours(image, [contours[i]], 0, 0, cv2.FILLED)
return image
def callback(object):
global value,value1,src2,src2_copy,src,minlineLength,maxlineGap,canny_max,canny_min,area_threshold
src2[:,:] = src2_copy[:,:]
#得到滑动条对应的值
value = cv2.getTrackbarPos('value'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。