Included Memory Shift

This commit is contained in:
gac-x11ma
2022-11-09 15:03:09 +01:00
parent d6803e82ba
commit 2ff79ee1c5
71 changed files with 1530 additions and 177 deletions
+6 -1
View File
@@ -638,5 +638,10 @@ def calculate_shift(ref,img, roi, g_sigma=3.0, upscale_factor=100, max_error=2.0
raise Exception("Bad image registration error: " + str(error))
if math.isnan(diffphase) or abs(diffphase)> max_diffphase:
raise Exception("Bad image registration phase difference: " + str(diffphase))
return xoff, yoff, error, diffphase
return xoff, yoff, error, diffphase, shifts
def apply_shift(img, shifts):
img = to_ip(img)
stack = create_stack([img,])
r=translate(stack, shifts)
return r