What I did
- Downloaded the opencv repo and setup the digit recognition sample (
digits.py
anddigits_video.py
) - Modify
digits.py
to modify line 44 (this prevents "ValueError: too many values to unpack" error)
contours, heirs = cv.findContours( bin.copy(), cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE)
with
_, contours, heirs = cv.findContours( bin.copy(), cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE)
- Run digits.py and then run digits_video.py
Results
digits_video.py
has no trouble isolating and deskewing the hand written digits but the prediction allows resolves to 0
(seen in blue above each green square). The only modification I've made to the code is the one line mentioned above in digits.py
.
System I'm testing this on OSX Sierra 10.12.6 with python3 and opencv 3.4.3