-
Notifications
You must be signed in to change notification settings - Fork 0
cv2
Jasper Zanjani edited this page Sep 14, 2020
·
1 revision
Convert colorspace 18:14
img = cv2.imread('image.png')
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imshow("Grayscale image", imgGray)
cv2.waitKey(0)
ksize
must be tuple of odd values
imgBlur = cv2.GaussianBlur(img, ksize=(7,7), sigmaX=0)
cv2.imshow('Blurred image', imgBlur)
cv2.waitKey(0)
img = cv2.imread('lena.png')
Takes two arguments:
- Name of the window in which to display the image
- The image itself
cv2.imshow("Output",img)
cv2.waitKey(0)
cap = cv2.VideoCapture("video.mp4")
while True:
success, img = cap.read()
cv2.imshow("Video",img)
cap = cv2.VideoCapture("video.mp4")
while True:
success, img = cap.read()
cv2.imshow("Video",img)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
Used to prevent window from automatically closing
cv2.waitKey(0)
Breaking out of a loop
if cv2.waitKey(1) & 0xFF == ord('q')
break
- argparse ?
- array ?
- asyncio ?
- bisect ?
- csv ?
- ctypes ?
- curses ?
- datetime ?
- functools ?
- getpass ?
- glob ?
- heapq ?
- http ?
- json ?
- logging ?
- optparse ?
- os ?
- pathlib ?
- platform ?
- pythonnet ?
- random ?
- socket ?
- subprocess ?
- sqlite3 ?
- sys ?
- termcolor ?
- threading ?
- trace ?
- typing ?
- unittest ?
- urllib ?
- venv ?
- weakref ?
- winrm ?