Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HHousen committed Jul 25, 2023
1 parent 7e04d0e commit 7801269
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lecture2notes/end_to_end/figure_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ def detect_figures(
# If `entropy_check` is a boolean, then set it to the default
if type(entropy_check) is bool and entropy_check:
entropy_check = 2.5
gray = cv2.cvtColor(figure, cv2.COLOR_BGR2GRAY)
try:
gray = cv2.cvtColor(figure, cv2.COLOR_BGR2GRAY)
except:
continue
high_entropy = shannon_entropy(gray) > entropy_check
if not high_entropy:
continue
Expand Down

0 comments on commit 7801269

Please sign in to comment.