Ask Your Question

dan1's profile - activity

2018-11-07 08:02:40 -0600 marked best answer wrong predictions from OpenCV Sample Digits.py

What I did

  • Downloaded the opencv repo and setup the digit recognition sample (digits.py and digits_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 .

image description

System I'm testing this on OSX Sierra 10.12.6 with python3 and opencv 3.4.3

2018-11-07 08:02:40 -0600 received badge  Scholar (source)
2018-11-07 00:48:25 -0600 received badge  Student (source)
2018-11-06 20:48:44 -0600 asked a question wrong predictions from OpenCV Sample Digits.py

OpenCV Sample Digits Not Working What I did Downloaded the opencv repo and setup the digit recognition sample (digits.