From 8663e23f4a08309f5fdf456ecab890a60b104413 Mon Sep 17 00:00:00 2001 From: "Josh Warner (Mac)" Date: Thu, 8 May 2014 20:45:19 -0500 Subject: [PATCH] FIX: Use //= instead of /= to fix deprecation warnings in adapthist --- skimage/exposure/_adapthist.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skimage/exposure/_adapthist.py b/skimage/exposure/_adapthist.py index e364d2f0..699e9acf 100644 --- a/skimage/exposure/_adapthist.py +++ b/skimage/exposure/_adapthist.py @@ -126,8 +126,8 @@ def _clahe(image, ntiles_x, ntiles_y, clip_limit, nbins=128): x_res = image.shape[1] - image.shape[1] % ntiles_x image = image[: y_res, : x_res] - x_size = image.shape[1] / ntiles_x # Actual size of contextual regions - y_size = image.shape[0] / ntiles_y + x_size = image.shape[1] // ntiles_x # Actual size of contextual regions + y_size = image.shape[0] // ntiles_y n_pixels = x_size * y_size if clip_limit > 0.0: # Calculate actual cliplimit @@ -139,7 +139,7 @@ def _clahe(image, ntiles_x, ntiles_y, clip_limit, nbins=128): bin_size = 1 + NR_OF_GREY / nbins aLUT = np.arange(NR_OF_GREY) - aLUT /= bin_size + aLUT //= bin_size img_blocks = view_as_blocks(image, (y_size, x_size)) # Calculate greylevel mappings for each contextual region