18
loading...
This website collects cookies to deliver better user experience
cap = cv2.VideoCapture("video_input.mp4")
if cap.isOpened():
width = cap.get(3) # float
height = cap.get(4) # float
fps = cap.get(cv2.CAP_PROP_FPS)
success = True
while success:
success,im = cap.read()
if not success:
break
fourcc = cv2.VideoWriter_fourcc('m','p','4','v')
out = cv2.VideoWriter('video_output.mp4',fourcc , int(fps), (int(width),int(height)))
out.write(image_obj)
frame_diff[frame_diff < frame_diff[np.nonzero(frame_diff)].mean()] = 0
frame_diff[frame_diff > frame_diff[np.nonzero(frame_diff)].mean()]
output = filters.sobel(frame_diff)
contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
if hierarchy[0][idx][3]== -1 :
x,y,w,h = cv2.boundingRect(contour)
if (w*h <= (q)**2):
continue
image = cv2.rectangle(image, (x,y),(x+w,y+h), color, 1)