What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-10 18:49:15
rgb to grayscale python
import cv2 image = cv2.imread('C:/Users/N/Desktop/Test.jpg') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) cv2.imshow('Original image',image) cv2.imshow('Gray image', gray) cv2.waitKey(0) cv2.destroyAllWindows() Add solution -
Python 2021-11-09 12:24:23
Create Wi-Fi QR code generator using Python
import os try: import pyqrcode import cv2 except Exception: os.system("pip install pyqrcode") os.system("pip install opencv-python") ssid = input("\nEnter WiFi SSID: ") authtypes = ["WEP", "WPA... Add solution -
Python 2021-11-08 23:11:06
[ WARN:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-wwma2wne\o pencv\modules\videoio\src\cap_msmf.cpp (677) CvCapture_MSMF::initStream Failed t o set mediaType (stream 0, (640x480 @ 30) MFVideoFormat_RGB24(codec not found)
The following code resolved this issue for me: video = cv2.VideoCapture(0,cv2.CAP_DSHOW) Add solution -
Other 2021-11-07 19:09:09
opencv for video recording
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 -
Python 2021-11-04 22:01:07
vs
import numpy as np import os import six.moves.urllib as urllib import sys import tarfile import tensorflow as tf import zipfile from collections import defaultdict from io import StringIO from matplotlib import pyplot as plt from PIL import Image &... Add solution -
Python 2021-11-04 13:02:10
@7chats
-----BEGIN PGP PUBLIC KEY BLOCK----- mQENBE0ti4EBCACqGtKlX9jI/enhlBdy2cyQP6Q7JoyxtaG6/ckAKWHYrqFTQk3I Ue8TuDrGT742XFncG9PoMBfJDUNltIPgKFn8E9tYQqAOlpSA25bOb30cA2ADkrjg jvDAH8cZ+fkIayWtObTxwqLfPivjFxEM//IdShFFVQj+QHmXYBJggWyEIil8Bje7 KRw6B5ucs4qSzp5VH4CqDr... Add solution -
Python 2021-11-04 03:30:09
cv2.namedwindow
import cv2 img = cv2.imread('/path_to_image/opencv-logo.png') cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAllWindows() # to use it in a loop k = cv2.waitKey(0) if k == 27: # wait for ESC key to exit cv2.destroyAllWindows() elif k == ord... Add solution -
C++ 2021-11-04 00:52:13
opencv(4.5.1) c:\users\appveyor\appdata\local\temp\1\pip-req-build-kh7iq4w7\opencv\modules\imgproc\src\resize.cpp:4051: error: (-215:assertion failed) !ssize.empty() in function
Error Message::::: error Traceback (most recent call last) in 1 # read the image and resize it to a fixed-size 2 image = cv2.imread(file) ----> 3 image = cv2.resize(image, fixed_size) error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgpr... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5