【发布时间】:2023-01-14 22:18:36
【问题描述】:
我正在尝试使用 python 找到沿管长的所有水滴的外边界大小。
在精明的边缘检测之后,我很难区分外部和内部边界。有人能帮帮我吗?
我使用的图像预处理是这样的:
# load the image, convert it to grayscale, and blur it slightly
gray = cv2.GaussianBlur(imc, (5, 5), 0)
# perform edge detection, then perform a dilation + erosion to
# close gaps in between object edges
dilate = cv2.dilate(gray, None, iterations=1)
#cv2.imshow('dilated',dilate)
erode = cv2.erode(dilate, None, iterations=1)
#cv2.imshow('eroded',erode)
edged = cv2.Canny(erode,230,230)
#cv2.imshow('%deroded' %count,edged)
【问题讨论】:
-
为清楚起见,您可能希望提供预期的输出图像。不错的微流体液滴顺便说一句;)
-
在提问时,确保你发布的标签是好的,因为即使你在你的问题一天前添加它们,大多数人也不会再看到它——你可以尝试阈值(或不),然后是形态学(打开或关闭)这将有望留下液滴的厚暗边界,同时擦除所有较窄的暗特征
标签: python opencv image-processing computer-vision