File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def estimate_orientation(
6363 thresh = img .astype (np .uint8 )
6464
6565 page_orientation , orientation_confidence = general_page_orientation or (None , 0.0 )
66- if page_orientation and orientation_confidence >= min_confidence :
66+ if page_orientation is not None and orientation_confidence >= min_confidence :
6767 # We rotate the image to the general orientation which improves the detection
6868 # No expand needed bitmap is already padded
6969 thresh = rotate_image (thresh , - page_orientation )
@@ -100,7 +100,7 @@ def estimate_orientation(
100100 estimated_angle = - round (median ) if abs (median ) != 0 else 0
101101
102102 # combine with the general orientation and the estimated angle
103- if page_orientation and orientation_confidence >= min_confidence :
103+ if page_orientation is not None and orientation_confidence >= min_confidence :
104104 # special case where the estimated angle is mostly wrong:
105105 # case 1: - and + swapped
106106 # case 2: estimated angle is completely wrong
You can’t perform that action at this time.
0 commit comments