fixed drift error message
@@ -58,6 +58,11 @@ def get_image_shift(imageA, imageB, box, roi=None, display=False):
x_max_ - fit_X: x_max_ + fit_X + 1,
]
+ dimensions = FitROI.shape
+
+ if 0 in dimensions or dimensions[0] != dimensions[1]:
+ xc, yc = 0, 0
+ else:
# The fit model
def flat_2d_gaussian(a, xc, yc, s, b):
A = a * _np.exp(-0.5 * ((x - xc) ** 2 + (y - yc) ** 2) / s ** 2) + b
@@ -95,6 +100,7 @@ def get_image_shift(imageA, imageB, box, roi=None, display=False):
xc -= _np.floor(X / 2)
yc -= _np.floor(Y / 2)
+
return -yc, -xc
