Skip to content

Update OpenCV Code to Prevent Program Crash #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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 README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# opencv-tutorial

**Please note: This repository is now archived and will no longer be updated or maintained.**

This is an introduction to object-oriented Programming (OOP) to OpenCV.

Check-out the online documentation: https://opencv-tutorial.readthedocs.io
Check-out the online documentation: https://opencv-tutorial.readthedocs.io
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')
4 changes: 3 additions & 1 deletion docs/intro/intro2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
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 All @@ -17,4 +19,4 @@

# When everything done, release the capture
cap.release()
cv.destroyAllWindows()
cv.destroyAllWindows()