What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-24 04:42:14
how to read frame width of video in cv2
import cv2 vcap = cv2.VideoCapture('video.avi') # 0=camera if vcap.isOpened(): # get vcap property width = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH) # float `width` height = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT) # float `height` ... Add solution -
Other 2021-10-21 20:19:13
Onject ssd detection code
import cv2thres = 0.45 # Threshold to detect objectcap = cv2.VideoCapture(1)cap.set(3,1280)cap.set(4,720)cap.set(10,70)classNames= []classFile = 'coco.names'with open(classFile,'rt') as f: classNames = f.read().rstrip('\n').split('\n')configPath = 'ssd... Add solution -
Python 2021-10-21 15:43:10
how to get camera stream cv2
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-10-14 00:25:13
object color detection python program youtube
# Python code for Multiple Color Detection import numpy as np import cv2 # Capturing video through webcam webcam = cv2.VideoCapture(0) # Start a while loop while(1): # Reading the video from the # webcam in image frames _... Add solution -
Python 2021-10-10 12:02:09
get video duration opencv python
import cv2 cap = cv2.VideoCapture("./video.mp4") fps = cap.get(cv2.CAP_PROP_FPS) # OpenCV2 version 2 used "CV_CAP_PROP_FPS" frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) duration = frame_count/fps print('fps = ' + str(fps... Add solution -
Python 2021-10-09 21:19:09
python opencv camera capture
import cv2 cap = cv2.VideoCapture(0) while True: ret, frame = cap.read() cv2.imshow('webcam feed' , frame) if cv2.waitKey(1) & 0xFF == ord(' '): break cap.release() cv2.destroyAllWindows() #by using the spacebar you will be able t... Add solution -
Python 2021-09-17 23:36:03
extract images from mp4 python
import cv2 vidcap = cv2.VideoCapture('big_buck_bunny_720p_5mb.mp4') success,image = vidcap.read() count = 0 while success: cv2.imwrite("frame%d.jpg" % count, image) # save frame as JPEG file success,image = vidcap.read() print('R... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5