mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-11-12 09:13:55 +01:00
Enhance line_based_frc function to align images using hann window and subpixel shifting
This commit is contained in:
1 parent
3a71d742d2
commit
4c021148f0
1 file changed
+8
@@ -1597,6 +1597,14 @@ def line_based_frc(
|
||||
if image1.ndim != 2 or image2.ndim != 2:
|
||||
raise ValueError("Images must be 2D")
|
||||
|
||||
# Aligning the images using find_shift and sinc_subpixel_shift
|
||||
# using hann window to reduce artifacts
|
||||
shift = ip.find_shift(
|
||||
t.as_tensor(ip.hann_window(image1)),
|
||||
t.as_tensor(ip.hann_window(image2))
|
||||
)
|
||||
image2 = ip.sinc_subpixel_shift(t.as_tensor(image2), shift).numpy()
|
||||
|
||||
if axis == 1:
|
||||
lines1, lines2 = image1, image2
|
||||
n_freq = image1.shape[1] // 2
|
||||
|
||||
Reference in new issue
Block a user