Skip to content

Commit 3301d64

Browse files
authored
Merge pull request #106 from OpenPIV/alexlib-patch-11
fixed a bug with dtypes
2 parents f6be4b8 + ddcbabd commit 3301d64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openpiv/preprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
from scipy.ndimage import median_filter, gaussian_filter, binary_fill_holes
23-
from skimage import io, img_as_float, exposure, data, img_as_uint
23+
from skimage import io, img_as_float, exposure, data, img_as_uint, img_as_ubyte
2424
from skimage.filters import sobel, rank, threshold_otsu
2525
import numpy as np
2626

@@ -66,7 +66,7 @@ def dynamic_masking(image,method='edges',filter_size=7,threshold=0.005):
6666
# stretch the histogram
6767
image = exposure.rescale_intensity(img_as_float(image), in_range=(0, 1))
6868
# blur the image, low-pass
69-
blurback = gaussian_filter(image,filter_size)
69+
blurback = img_as_ubyte(gaussian_filter(image,filter_size))
7070
if method is 'edges':
7171
# identify edges
7272
edges = sobel(blurback)

0 commit comments

Comments
 (0)