savannahar68/CamScanner-Python

OpenCV error....

Opened this issue · 1 comments

runfile('/home/frohro/Downloads/CamScanner-Python/scannerApp.py', args='-i images/receipt.jpg', wdir='/home/frohro/Downloads/CamScanner-Python')
Reloaded modules: imutils, imutils.convenience, imutils.meta
STEP 1: Edge Detection
Traceback (most recent call last):

File "", line 1, in
runfile('/home/frohro/Downloads/CamScanner-Python/scannerApp.py', args='-i images/receipt.jpg', wdir='/home/frohro/Downloads/CamScanner-Python')

File "/usr/lib/python3/dist-packages/spyder_kernels/customize/spydercustomize.py", line 678, in runfile
execfile(filename, namespace)

File "/usr/lib/python3/dist-packages/spyder_kernels/customize/spydercustomize.py", line 106, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "/home/frohro/Downloads/CamScanner-Python/scannerApp.py", line 72, in
cnts = sorted(cnts, key = cv2.contourArea, reverse = True)[:5]

error: OpenCV(4.1.0-dev) /home/frohro/Projects/opencv/modules/imgproc/src/shapedescr.cpp:274: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'contourArea'

cnts = cnts[0] if imutils.is_cv2() else cnts[1]
should be replaced with
cnts = cnts[0]