0

I am working on OpenCV-Python. I have a image like this(bellow image,but without light green lines) from live feed by webcam.I have found corners coordinates,

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

   [[162, 206]],

   [[189, 341]],

   [[329, 389]],

   [[444, 283]],

   [[412, 160]]])

of polygon. How to draw a line around recognized polygon like light green lines shown on image?

Recognized shape

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
user_fs10
  • 210
  • 4
  • 14

1 Answers1

2

You can use drawContours() function:

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

The documentation explains it well:

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

Mahm00d
  • 3,881
  • 8
  • 44
  • 83
  • Result is like this,It can't draw lines. https://drive.google.com/file/d/0B53F0wBGnYhdTFN1U0tQQzM3QTg/view?usp=sharing What can I do for this? – user_fs10 Jan 23 '16 at 12:20
  • 1
    I found a solution,I think It's my fault, `cv2.drawContours(img,[contours],-1,(0,255,0),3)` This is working properly.Thanks @Mahm00d – user_fs10 Jan 23 '16 at 13:16