Skip to content

Commit b0b0f4e

Browse files
committed
Add check that the images don't contain only zero values
1 parent e0a2bdf commit b0b0f4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pysteps/motion/proesmans.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def proesmans(input_images, lam=50.0, num_iter=100, num_levels=6, filter_std=0.0
5757
im = np.stack([im1, im2])
5858
im_min = np.min(im)
5959
im_max = np.max(im)
60-
im = (im - im_min) / (im_max - im_min) * 255.0
60+
if im_max - im_min > 1e-8:
61+
im = (im - im_min) / (im_max - im_min) * 255.0
6162

6263
if filter_std > 0.0:
6364
im[0, :, :] = gaussian_filter(im[0, :, :], filter_std)

0 commit comments

Comments
 (0)