Ask Your Question

prashant's profile - activity

2019-11-07 04:03:49 -0600 received badge  Famous Question (source)
2019-04-11 00:35:00 -0600 received badge  Notable Question (source)
2018-11-30 05:40:48 -0600 received badge  Popular Question (source)
2018-11-19 20:04:09 -0600 received badge  Nice Answer (source)
2018-05-12 06:05:38 -0600 commented answer Sorting contours from left to right and top to bottom

This does not work for me as in single row all my characters do not have same height. :(

2018-01-16 08:38:47 -0600 received badge  Teacher (source)
2018-01-16 06:28:26 -0600 received badge  Self-Learner (source)
2018-01-16 06:28:24 -0600 marked best answer Not able to save video using cv2.VideoWriter(...) on Ubuntu 16.04

After running below code I am getting a "output.avi" file of 5.7KB.Nothing is recorded from camera.

# https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html
import numpy as np
import cv2

cap = cv2.VideoCapture(0)

# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi',fourcc, 20.0, (640,480))

while(cap.isOpened()):
    ret, frame = cap.read()
    if ret==True:
        frame = cv2.flip(frame,0)

        # write the flipped frame
        out.write(frame)

        cv2.imshow('frame',frame)
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    else:
        break

# Release everything if job is finished
cap.release()
out.release()
cv2.destroyAllWindows()

Please help.

2018-01-15 13:49:30 -0600 commented question Not able to save video using cv2.VideoWriter(...) on Ubuntu 16.04

Oh, you are right the webcam frame size is 1024, 1280. I used this # Define the codec and create VideoWriter object fo

2018-01-15 10:43:17 -0600 asked a question Not able to save video using cv2.VideoWriter(...) on Ubuntu 16.04

Not able to save video using cv2.VideoWriter(...) on Ubuntu 16.04 After running below code I am getting a "output.avi" f