【发布时间】:2020-10-27 00:43:08
【问题描述】:
我做了三个不同阈值的精明边缘检测,然后以不同的方式更改颜色线,现在我想将所有这些线组合在一个窗口中显示。以一张图片为例: Edge detection with different colors
到目前为止,这是我的代码:
edges1 = cv2.Canny(frame,30,50)
rgb1 = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB) # RGB for matplotlib, BGR for imshow() !
edges2 = cv2.Canny(frame,20,60)
rgb2 = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB)
edges3 = cv2.Canny(frame,40,40)
rgb3 = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB)
# multiply with another array to change line colors:
rgb1 *= np.array((1,0,0),np.uint8)
rgb2 *= np.array((0,1,0),np.uint8)
rgb3 *= np.array((0,0,1),np.uint8)
cv2.imshow('Deteksi Tepi dengan Canny', rgb1)
【问题讨论】:
标签: python opencv computer-vision edge-detection canny-operator