mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-12-01 08:44:13 +01:00
deskewing: add a 2nd stage for precision
after selecting the optimum angle on the original search range, narrow down around in the vicinity with half the range (adding computational costs, but gaining precision)
This commit is contained in:
parent
adcea47bc0
commit
56e73bf72f
1 changed files with 3 additions and 0 deletions
|
|
@ -1564,6 +1564,9 @@ def return_deskew_slop(img_patch_org, sigma_des,n_tot_angles=100,
|
|||
angle2, var2 = get_smallest_skew(img_resized, sigma_des, angles2, map=map, logger=logger, plotter=plotter)
|
||||
if var2 > var:
|
||||
angle = angle2
|
||||
# precision stage:
|
||||
angles = np.linspace(angle - 2.5, angle + 2.5, n_tot_angles // 2)
|
||||
angle, _ = get_smallest_skew(img_resized, sigma_des, angles, map=map, logger=logger, plotter=plotter)
|
||||
return angle
|
||||
|
||||
def get_smallest_skew(img, sigma_des, angles, logger=None, plotter=None, map=map):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue