Skip to content

Commit

Permalink
fixed maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
brisvag committed Sep 11, 2023
1 parent 05c03e8 commit 7d74c1b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/stemia/utils/image_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,11 @@ def correlate_rotations(img, features, angle_step=5):
axes=(1, 2),
)
)
norm_denominators = np.sqrt(img_autocc.max() * feat_autocc.max(axis=(1, 2)))
norm_denominators = np.sqrt(img_autocc.max()) * np.sqrt(feat_autocc.max(axis=(1, 2)))

for feat_ft, denom in zip(feat_fts, norm_denominators):
best_cc = 0
for _, feat_ft_rot in rotations(feat_ft, range(0, 360, angle_step)):
cc_ft = img_ft_conj * feat_ft_rot

cc = np.abs(ifftshift(ifftn(ifftshift(cc_ft))))

cc = np.abs(ifftshift(ifftn(ifftshift(img_ft_conj * feat_ft_rot))))
best_cc = max(np.max(cc / denom), best_cc)
yield best_cc

0 comments on commit 7d74c1b

Please sign in to comment.