Open Fifis opened 1 month ago
Hard-coding a specific version of opencv
in requirements.txt
helps:
numpy
matplotlib
scipy
sympy
opencv-python-headless==4.7.0.72
tomlkit
toml
This version was the latest when the latest release was made.
cv2.remap requires np.float32, which now it is apparently asserting for, the cv2.resize a few lines above delivers np.unit8 (numpy dtypes). The solution that worked for me is to add ".astype(np.float32)" at line 57 and 60 at the end of the resize command to get the right dtype for image_x_coords and image_y_coords.
System:
Linux UL0012159 6.9.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 21 Jun 2024 19:49:19 +0000 x86_64 GNU/Linux
How to reproduce:
page-dewarp -d 3 warp.png
(the image is attached below)Error:
Input image: