Skip to content

Commit

Permalink
Update matching_tools.py
Browse files Browse the repository at this point in the history
resolving #111
  • Loading branch information
dicaearchus committed Nov 21, 2023
1 parent a94cda2 commit b420bfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dhdt/processing/matching_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ def get_integer_peak_location(C, metric=None):
from .matching_tools_organization import estimate_match_metric

assert isinstance(C, np.ndarray), "please provide an array"
C = np.atleast_2d(C)
max_corr = np.argmax(C)

ij = np.unravel_index(max_corr, C.shape, order='F') # 'C'
ij = np.unravel_index(max_corr, C.shape, order='F') # 'C'
if C.ndim >= 3: ij = ij[:2]
di, dj = ij[::-1]
di -= C.shape[0] // 2
dj -= C.shape[1] // 2
Expand Down

0 comments on commit b420bfc

Please sign in to comment.