Skip to content

Commit 1924e81

Browse files
fix: bugs fixed.
1 parent 4f322f5 commit 1924e81

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

webcam.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Requirements:
22
# pip install numpy
3-
# sudo apt-get install python-openCV
3+
# pip install opencv-python
44
# Program:
5-
# opens your webcam, and records.
5+
# Opens your webcam and records.
66

7+
# Improve this program and make it suitable for general module like use in another programs
78
import cv2
89

910
cap = cv2.VideoCapture(0)
@@ -13,7 +14,7 @@
1314
frames_height = int(cap.get(4))
1415

1516
# Specify the video codec
16-
# FourCC is plateform dependent, however MJPG is a safe choice.
17+
# FourCC is platform dependent; however, MJPG is a safe choice.
1718
fourcc = cv2.VideoWriter_fourcc(*"MJPG")
1819

1920
# Create video writer object. Save file to recording.avi
@@ -24,7 +25,6 @@
2425
ret, frame = cap.read()
2526

2627
if ret == True:
27-
2828
# Write frame to recording.avi
2929
out.write(frame)
3030

@@ -36,7 +36,7 @@
3636
if cv2.waitKey(1) & 0xFF == ord("q"):
3737
break
3838

39-
# When everything done, release the capture and video writer
39+
# When everything is done, release the capture and video writer
4040
cap.release()
4141
out.release()
4242
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)