pull/28/head
vahid 4 years ago
parent 4b3c8a6707
commit 67a9fc8820

@ -1677,7 +1677,7 @@ class Eynollah:
cy_biggest_d_last5 = cy_biggest_d[-5:] cy_biggest_d_last5 = cy_biggest_d[-5:]
dists_d = [math.sqrt((cx_bigest_big[0] - cx_bigest_d_last5[j]) ** 2 + (cy_biggest_big[0] - cy_biggest_d_last5[j]) ** 2) for j in range(len(cy_biggest_d_last5))] dists_d = [math.sqrt((cx_bigest_big[0] - cx_bigest_d_last5[j]) ** 2 + (cy_biggest_big[0] - cy_biggest_d_last5[j]) ** 2) for j in range(len(cy_biggest_d_last5))]
ind_largest = len(cx_bigest_d) -5 + np.argmin(dists_d) ind_largest = len(cx_bigest_d) -5 + np.argmin(dists_d)
else: else:
cx_bigest_d_last5 = cx_bigest_d[-len(cx_bigest_d):] cx_bigest_d_last5 = cx_bigest_d[-len(cx_bigest_d):]
cy_biggest_d_last5 = cy_biggest_d[-len(cx_bigest_d):] cy_biggest_d_last5 = cy_biggest_d[-len(cx_bigest_d):]
dists_d = [math.sqrt((cx_bigest_big[0]-cx_bigest_d_last5[j])**2 + (cy_biggest_big[0]-cy_biggest_d_last5[j])**2) for j in range(len(cy_biggest_d_last5))] dists_d = [math.sqrt((cx_bigest_big[0]-cx_bigest_d_last5[j])**2 + (cy_biggest_big[0]-cy_biggest_d_last5[j])**2) for j in range(len(cy_biggest_d_last5))]

@ -2161,7 +2161,7 @@ def return_boxes_of_images_by_order_of_reading_new(splitter_y_new, regions_witho
for dj in range(len(x_starting)): for dj in range(len(x_starting)):
if set( list(np.array(range(x_starting[dj],x_ending[dj])) ) ) == set(all_columns): if set( list(np.array(range(x_starting[dj],x_ending[dj])) ) ) == set(all_columns):
pass pass
else: else:
columns_covered_by_lines_covered_more_than_2col=columns_covered_by_lines_covered_more_than_2col+list(np.array(range(x_starting[dj],x_ending[dj])) ) columns_covered_by_lines_covered_more_than_2col=columns_covered_by_lines_covered_more_than_2col+list(np.array(range(x_starting[dj],x_ending[dj])) )
columns_covered_by_lines_covered_more_than_2col=list(set(columns_covered_by_lines_covered_more_than_2col)) columns_covered_by_lines_covered_more_than_2col=list(set(columns_covered_by_lines_covered_more_than_2col))

Loading…
Cancel
Save