Advertisement
janek9807

Open CV drawing

Feb 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import numpy as np
  2. import cv2
  3.  
  4. img = cv2.imread('parrot.bmp', -1) #2nd argument: 1-colorful img, 0-greyscale, -1-with transparency
  5. img = cv2.rectangle(img,(65, 165),(265,330),(0,255,0),3) #1st arg: top-left corner of rect
  6.                                                      #2nd arg: bottom-right corner of rect
  7.                                                      #3rd arg: color
  8.                                                      #4th arg: width in pixels
  9. cv2.imshow('Parrots', img)
  10. cv2.waitKey(0)
  11. cv2.destroyWindow('Parrots')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement