Skip to content
This repository was archived by the owner on Nov 4, 2023. It is now read-only.

Added error handling for video capture in OpenCV code #1

Merged
merged 1 commit into from
Feb 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/intro/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ and then loop back. The loop finishes when **q** is pressed::
while True:
# Capture frame-by-frame
ret, frame = cap.read()
if not ret:
break

# Our operations on the frame come here
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
Expand Down Expand Up @@ -344,4 +346,4 @@ Mouse callback::
cb(evt, x, y, flags, param)

cv.createTrackbar('name', 'win', 0, max, cb)
cv.getTrackbarPos('name', 'win')
cv.getTrackbarPos('name', 'win')