mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
'''
|
||||
Digit recognition from video.
|
||||
|
||||
Run digits.py before, to train and save the SVM.
|
||||
|
||||
Usage:
|
||||
digits_video.py [{camera_id|video_file}]
|
||||
'''
|
||||
|
||||
# Python 2/3 compatibility
|
||||
from __future__ import print_function
|
||||
@@ -28,11 +36,7 @@ def main():
|
||||
print('"%s" not found, run digits.py first' % classifier_fn)
|
||||
return
|
||||
|
||||
if True:
|
||||
model = cv.ml.SVM_load(classifier_fn)
|
||||
else:
|
||||
model = cv.ml.SVM_create()
|
||||
model.load_(classifier_fn) #Known bug: https://github.com/opencv/opencv/issues/4969
|
||||
model = cv.ml.SVM_load(classifier_fn)
|
||||
|
||||
while True:
|
||||
_ret, frame = cap.read()
|
||||
|
||||
Reference in New Issue
Block a user