0

我正在使用OpenCV-Python。 我有活飼料由webcam.I這樣的圖像(波紋管的形象,但不淺綠色線)發現的角落座標,在公認的多邊形周圍繪製輪廓opencv

(array([[[280, 109]], 

    [[162, 206]], 

    [[189, 341]], 

    [[329, 389]], 

    [[444, 283]], 

    [[412, 160]]]) 
多邊形的

。 如何在識別的多邊形周圍繪製線條,如圖像上顯示的淺綠色線條?

Recognized shape

回答

1

可以使用drawContours()功能:

cv2.drawContours(img, contours, -1, (0,255,0), 3) 

的文檔解釋得好:

http://docs.opencv.org/master/d4/d73/tutorial_py_contours_begin.html#gsc.tab=0

+0

結果是這樣的,它不能畫線。 https://drive.google.com/file/d/0B53F0wBGnYhdTFN1U0tQQzM3QTg/view?usp=sharing 我能爲此做些什麼? – NSiri

+0

我發現了一個解決方案,我認爲這是我的錯, 'cv2.drawContours(IMG,[輪廓], - 1,(0,255,0),3)' 這是工作properly.Thanks @ Mahm00d – NSiri

+0

@NSiri很高興它的工作。 – Mahm00d