Skip to content

Commit

Permalink
fix boundary conditions in phase_conv2d (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
FMarmoreo authored Jul 18, 2024
1 parent 9bc48f4 commit 65eb0cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cobrawap/pipeline/utils/convolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def phase_conv2d(frame, kernel, kernel_center=None):
for di,dj in itertools.product(range(dx), range(dy)):

# kernelsite != 0, framesite within borders and != nan
if k[di,dj] and i+di-ci < dimx and j+dj-cj < dimy \
if k[di,dj] and 0 <= i+di-ci < dimx and 0 <= j+dj-cj < dimy \
and np.isfinite(frame[i+di-ci,j+dj-cj]):
sign = -1*np.sign(k[di,dj])
# pos = clockwise from phase to frame[..]
Expand Down

0 comments on commit 65eb0cf

Please sign in to comment.