【发布时间】:2023-01-17 17:25:02
【问题描述】:
我正在对该图像的液滴进行外边缘检测。问题是图像的照明不均匀。因此背景减法无法正常工作。请帮忙。谢谢
Frame= cv2.rotate(Frame, cv2.ROTATE_90_CLOCKWISE)
#gray-scale convertion and Gaussian blur filter applying
GrayFrame = cv2.cvtColor(Frame, cv2.COLOR_BGR2GRAY)
GrayFrame = cv2.GaussianBlur(GrayFrame, (5, 5), 0)
fgmask=backsub.apply(GrayFrame)
cv2.imshow('fg',fgmask)
dilate = cv2.dilate(fgmask, None, iterations=1)
erode = cv2.erode(dilate, None, iterations=1)
cv2.imshow('erode',erode)
FrameThresh = cv2.threshold(erode, 1,100, cv2.THRESH_BINARY)[1]
cv2.imshow('Thresh',FrameThresh)
#Dilate image and find all the contours
cnts,heir = cv2.findContours(FrameThresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
【问题讨论】:
标签: edge-detection background-subtraction image-thresholding