📜  OPENCV GET CONTOURS - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:46.061000             🧑  作者: Mango

代码示例1
im = cv.imread('test.jpg')
imgray = cv.cvtColor(im, cv.COLOR_BGR2GRAY)
ret, thresh = cv.threshold(imgray, 127, 255, 0)
contours, hierarchy = cv.findContours(thresh, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)

cv.drawContours(img, [CONTOURS], 0, (0,255,0), 3)