mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-03-24 16:12:03 +01:00
split_textregion_main_vs_header: avoid zero division
This commit is contained in:
parent
4e9b062b84
commit
96cfddf92d
1 changed files with 5 additions and 5 deletions
|
|
@ -920,11 +920,11 @@ def split_textregion_main_vs_header(
|
||||||
(regions_model_full==2)).sum()
|
(regions_model_full==2)).sum()
|
||||||
pixels_main = all_pixels - pixels_header
|
pixels_main = all_pixels - pixels_header
|
||||||
|
|
||||||
if (( pixels_header / float(pixels_main) >= 0.6 and
|
if (( pixels_header >= 0.6 * pixels_main and
|
||||||
length_con[ii] / float(height_con[ii]) >= 1.3 and
|
length_con[ii] >= 1.3 * height_con[ii] and
|
||||||
length_con[ii] / float(height_con[ii]) <= 3 ) or
|
length_con[ii] <= 3 * height_con[ii] ) or
|
||||||
( pixels_header / float(pixels_main) >= 0.3 and
|
( pixels_header >= 0.3 * pixels_main and
|
||||||
length_con[ii] / float(height_con[ii]) >=3 )):
|
length_con[ii] >= 3 * height_con[ii] )):
|
||||||
|
|
||||||
regions_model_1[:,:][(regions_model_1[:,:]==1) & (img == 255) ] = 2
|
regions_model_1[:,:][(regions_model_1[:,:]==1) & (img == 255) ] = 2
|
||||||
contours_only_text_parent_head.append(contours_only_text_parent[ii])
|
contours_only_text_parent_head.append(contours_only_text_parent[ii])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue