Skip to content

Commit

Permalink
Improve detection of edges
Browse files Browse the repository at this point in the history
when image is too closed to the border of the image.
  • Loading branch information
bansan85 committed Oct 22, 2020
1 parent ba773d8 commit 5734a23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions page/crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,15 @@ def found_data_try2_find_edges(
enable_debug + "_" + str(n_page) + "_" + str(i) + "_5d.png",
image_with_lines,
)
height, width = cv2ext.get_hw(image)
liste_lines.append(np.array([[0, 0, 0, height - 1]], dtype=int))
liste_lines.append(np.array([[0, 0, width - 1, 0]], dtype=int))
liste_lines.append(
np.array([[width - 1, 0, width - 1, height - 1]], dtype=int)
)
liste_lines.append(
np.array([[0, height - 1, width - 1, height - 1]], dtype=int)
)
return liste_lines


Expand Down
2 changes: 1 addition & 1 deletion tests
Submodule tests updated from d8a0d4 to bb2015

0 comments on commit 5734a23

Please sign in to comment.