|
1 | | -from openpiv.pyprocess import extended_search_area_piv as piv |
2 | | -from openpiv.pyprocess import fft_correlate_images, \ |
3 | | - correlation_to_displacement |
4 | | -import matplotlib.pyplot as plt |
5 | | - |
6 | 1 | import numpy as np |
7 | | - |
8 | | - |
| 2 | +import matplotlib.pyplot as plt |
9 | 3 | from skimage.util import random_noise |
10 | 4 | from skimage import img_as_ubyte |
11 | 5 | from scipy.ndimage import shift as shift_img |
12 | | -import pkg_resources as pkg |
| 6 | +# import pkg_resources as pkg |
| 7 | +from importlib_resources import files |
| 8 | +from openpiv.pyprocess import extended_search_area_piv as piv |
| 9 | +from openpiv.pyprocess import fft_correlate_images, \ |
| 10 | + correlation_to_displacement |
| 11 | + |
13 | 12 |
|
14 | 13 | threshold = 0.25 |
15 | 14 |
|
@@ -128,8 +127,9 @@ def test_process_extended_search_area(): |
128 | 127 | def test_sig2noise_ratio(): |
129 | 128 | """ s2n ratio test """ |
130 | 129 | from openpiv import tools |
131 | | - im1 = pkg.resource_filename("openpiv", "data/test1/exp1_001_a.bmp") |
132 | | - im2 = pkg.resource_filename("openpiv", "data/test1/exp1_001_b.bmp") |
| 130 | + im1 = files('openpiv.data').joinpath('test1/exp1_001_a.bmp') |
| 131 | + im2 = files('openpiv.data').joinpath('test1/exp1_001_b.bmp') |
| 132 | + |
133 | 133 |
|
134 | 134 | frame_a = tools.imread(im1) |
135 | 135 | frame_b = tools.imread(im2) |
|
0 commit comments