Skip to content

Commit d4f8216

Browse files
authored
Merge pull request #275 from ErichZimmer/master
Fix for #264
2 parents ff7a88e + f6a5521 commit d4f8216

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

openpiv/pyprocess.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def fft_correlate_images(
729729
if correlation_method == "linear":
730730
# have to be normalized, mainly because of zero padding
731731
size = s1 + s2 - 1
732-
fsize = 2 ** np.ceil(np.log2(size)).astype(int)
732+
fsize = 2 ** np.ceil(np.log2(size)).astype(int) - 1
733733
fslice = (slice(0, image_a.shape[0]),
734734
slice((fsize[0]-s1[0])//2, (fsize[0]+s1[0])//2),
735735
slice((fsize[1]-s1[1])//2, (fsize[1]+s1[1])//2))
@@ -741,7 +741,7 @@ def fft_correlate_images(
741741
f2b = rfft2(image_b)
742742
corr = fftshift(irfft2(f2a * f2b).real, axes=(-2, -1))
743743
else:
744-
print("method is not implemented!")
744+
print(f"correlation method {correlation_method } is not implemented")
745745

746746
if normalized_correlation:
747747
corr = corr/(s2[0]*s2[1]) # for extended search area
@@ -839,7 +839,7 @@ def correlate_windows(window_a, window_b, correlation_method="fft",
839839
elif correlation_method == "direct":
840840
corr = convolve2d(window_a, window_b[::-1, ::-1], "full")
841841
else:
842-
raise ValueError("method is not implemented")
842+
print(f"correlation method {correlation_method } is not implemented")
843843

844844
return corr
845845

0 commit comments

Comments
 (0)