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

Python3 issues #27

Open
cybernard opened this issue Oct 17, 2021 · 1 comment
Open

Python3 issues #27

cybernard opened this issue Oct 17, 2021 · 1 comment

Comments

@cybernard
Copy link

First all print statements need to be converted from print "" to print()

floating point errors here:
561 wrap values in int() due to floating point error
795 int(width...)
796 int(height....)


general errors which need handling

some text is white washed away

DSC05331
z

Traceback (most recent call last):
File "page_dewarp.py", line 915, in
main()
File "page_dewarp.py", line 868, in main
cinfo_list = get_contours(name, small, pagemask, 'text')
File "page_dewarp.py", line 470, in get_contours
contours_out.append(ContourInfo(contour, rect, tight_mask))
File "page_dewarp.py", line 376, in init
self.center, self.tangent = blob_mean_and_tangent(contour)
File "page_dewarp.py", line 352, in blob_mean_and_tangent
mean_x = moments['m10'] / area
ZeroDivisionError: float division by zero

apparently area can be 0 so we need to protect against this

If area==0:
area=1

Resizing the image resulted in problems for me, so I nulled it out with img=src

@rramphal
Copy link

It looks like there are already some open PRs to update the codebase: #14, #15, #20, #25 (most recent) in case they are useful to you.

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

2 participants