Вы находитесь на странице: 1из 1

import cv2

import numpy as np

def draw_circle(event,x,y):
if event == cv2.EVENT_LBUTTONDBLCLK:
cv2.circle(img,(x,y),100,(255,0,0),-1)

img = np.zeros((400,400,3), np.uint8)

cv2.line(img,(0,0),(200,300),(255,255,255),15)
cv2.rectangle(img,(10,50),(60,80),(0,0,255),5)
cv2.circle(img,(90,80), 20, (0,255,0), 0)
pts = np.array([[10,50],[20,30],[70,20],[50,10]], np.int32)
#pts = pts.reshape((-1,1,2))
cv2.polylines(img, [pts], True, (0,255,255), 3)
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(img,'OpenCV Tuts!',(80,90), font, 1, (200,255,155), 2, cv2.LINE_AA)
cv2.ellipse(img,(200,130),(50,25),0,0,360,(255,255,0), -1)

pts = np.array([[10,5],[20,30],[70,20],[50,10]], np.int32)


#pts = pts.reshape((-1,1,2))
cv2.polylines(img,[pts],True,(0,150,255))

cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()

Вам также может понравиться