What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-22 01:55:27
feature to determine image too dark opencv
blur = cv2.blur(image, (5, 5)) # With kernel size depending upon image size if cv2.mean(blur) > 127: # The range for a pixel's value in grayscale is (0-255), 127 lies midway return 'light' # (127 - 255) denotes light image else: return 'dark'... Add solution -
Python 2021-11-20 00:25:24
display cv2 image in jupyter notebook
# matplotlib interprets images in RGB format, but OpenCV uses BGR format # so to convert the image so that it's properly loaded, convert it before loading img = cv2.imread('filename.ext') # this is read in BGR format rgb_img = cv2.cvtColor(img, cv2.COL... Add solution -
Python 2021-11-18 22:03:07
read video opencv python
import numpy as np import cv2 cap = cv2.VideoCapture('videos/wa.avi') while(cap.isOpened()): ret, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.imshow('frame',gray) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.r... Add solution -
Other 2021-11-17 14:21:19
cv2_imshow colab
from google.colab.patches import cv2_imshow cv2_imshow(img) Add solution -
Python 2021-11-15 14:02:34
video capturing with raspberry pi
import numpy as np import cv2 cap = cv2.VideoCapture(0) while(True): # Capture frame-by-frame ret, frame = cap.read() # Our operations on the frame come here gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # Display the resulting fr... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5