chrismeyersfsu / python-card_scan

Playing card scanner and matcher, image recognition, opencv
GNU General Public License v3.0
67 stars 26 forks source link

Division by Zero #2

Closed ryanlelek closed 9 years ago

ryanlelek commented 10 years ago

I'm receiving a "ZeroDivisionError: float division by zero" exception. This is confirmed to be initiated from line 43 of cv_utils.py.

python_card_scan_division_by_zero

# Original Line 43
return cv.DotProduct(tmp1, tmp2) /  (cv.Sum(norm1)[0]*cv.Sum(norm2)[0])**0.5

# Edited - Prevents Crash (may affect card recognition)
return cv.DotProduct(tmp1, tmp2) /  (((cv.Sum(norm1)[0]*cv.Sum(norm2)[0])**0.5) + 0.1)

Will continue debugging (been at it for about 8 hours trying to get one card to recognize).

OS: Clean Lubuntu 12.10 Using Python v2.7.2 (Python 3.x throws a syntax error)

Ryan

ryanlelek commented 10 years ago

Made progress and things are working on another machine. Going to test further to see what the issue was. Will update with more info soon

Ryan

chrismeyersfsu commented 9 years ago

old