Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error while processing the pdf as per the instruction given #2

Open
maestrosuper80 opened this issue Sep 20, 2019 · 2 comments

Comments

@maestrosuper80
Copy link

Below is the log trace

%%python pdf-to-csv-cv.py -p test.pdf

Traceback (most recent call last):
File "pdf-to-csv-cv.py", line 213, in
process_file(file_name)
File "pdf-to-csv-cv.py", line 37, in process_file
extracted_table = extract_main_table(gray_image)
File "pdf-to-csv-cv.py", line 70, in extract_main_table
cnts = sorted(cnts, key=cv2.contourArea, reverse=True)
cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\shapedescr.cpp:274: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'cv::contourArea'

Traceback (most recent call last):

File "", line 1, in
get_ipython().run_cell_magic('python', 'pdf-to-csv-cv.py -p test.pdf', '\n')

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2358, in run_cell_magic
result = fn(*args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\magics\script.py", line 142, in named_script_magic
return self.shebang(line, cell)

File "<C:\ProgramData\Anaconda3\lib\site-packages\decorator.py:decorator-gen-111>", line 2, in shebang

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\magic.py", line 187, in
call = lambda f, *a, **k: f(*a, **k)

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\magics\script.py", line 245, in shebang
raise CalledProcessError(p.returncode, cell, output=out, stderr=err)

CalledProcessError: Command 'b'\n'' returned non-zero exit status 1.

Please help to solve the issue

@vitali84
Copy link
Owner

@maestrosuper80, Im afraid Opencv API was changed between 3.4.4 (version this script was developed on)
and 4.1.1 you are using

@veabanga
Copy link

How can we solve this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants