mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-13 01:13:54 +02:00
get_slopes_and_deskew_new_light2: ignore tiny contour areas
This commit is contained in:
parent
934ac90e92
commit
45868e99cd
1 changed files with 5 additions and 1 deletions
|
|
@ -986,7 +986,7 @@ class Eynollah:
|
|||
|
||||
def get_slopes_and_deskew_new_light2(self, contours_par, textline_mask_tot, slope_deskew):
|
||||
|
||||
polygons_of_textlines = return_contours_of_interested_region(textline_mask_tot, 1, 0.00001)
|
||||
polygons_of_textlines = return_contours_of_interested_region(textline_mask_tot, 1, 0.0001)
|
||||
cx_textlines, cy_textlines = find_center_of_contours(polygons_of_textlines)
|
||||
w_h_textlines = [cv2.boundingRect(polygon)[2:] for polygon in polygons_of_textlines]
|
||||
args_textlines = np.arange(len(polygons_of_textlines))
|
||||
|
|
@ -1013,6 +1013,10 @@ class Eynollah:
|
|||
slopes.append(estimate_skew_contours(textlines_in))
|
||||
except ValueError:
|
||||
slopes.append(slope_deskew)
|
||||
# plt.imshow(textline_mask_tot)
|
||||
# for contour in textlines_in:
|
||||
# plt.plot(*contour[:, 0].T, linewidth=3, color='red')
|
||||
# plt.show()
|
||||
|
||||
return all_found_textline_polygons, slopes
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue