summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2015-11-06 17:22:16 +0100
committerJustin Lecher <jlec@gentoo.org>2015-11-06 17:22:23 +0100
commit51fc29a0a8be734001b3c829d4791b018dae08b8 (patch)
tree73a8fc85f770cad4d315a310e77a245acd1f1ec5 /sci-libs/scikits_image/files
parentdev-python/pyamg: Version Bump (diff)
downloadgentoo-51fc29a0a8be734001b3c829d4791b018dae08b8.tar.gz
gentoo-51fc29a0a8be734001b3c829d4791b018dae08b8.tar.bz2
gentoo-51fc29a0a8be734001b3c829d4791b018dae08b8.zip
sci-libs/scikits_image: Version Bump
Package-Manager: portage-2.2.23 Signed-off-by: Justin Lecher <jlec@gentoo.org>
Diffstat (limited to 'sci-libs/scikits_image/files')
-rw-r--r--sci-libs/scikits_image/files/scikits_image-0.11.3-adapthist-backport.patch82
-rw-r--r--sci-libs/scikits_image/files/scikits_image-0.11.3-adapthist-backport.patch173
2 files changed, 155 insertions, 0 deletions
diff --git a/sci-libs/scikits_image/files/scikits_image-0.11.3-adapthist-backport.patch b/sci-libs/scikits_image/files/scikits_image-0.11.3-adapthist-backport.patch
new file mode 100644
index 000000000000..0bd96916bfc1
--- /dev/null
+++ b/sci-libs/scikits_image/files/scikits_image-0.11.3-adapthist-backport.patch
@@ -0,0 +1,82 @@
+From 41159f3fd24e7653c556ddbf6ba93ad2aa8b541f Mon Sep 17 00:00:00 2001
+From: Steven Silvester <steven.silvester@ieee.org>
+Date: Mon, 19 Oct 2015 18:07:32 -0500
+Subject: [PATCH] Fix adapthist mask logic
+
+Use minlength in bincount
+
+Fix mask logic
+---
+ skimage/exposure/_adapthist.py | 8 +++++---
+ skimage/exposure/tests/test_exposure.py | 14 +++++++-------
+ 2 files changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/skimage/exposure/_adapthist.py b/skimage/exposure/_adapthist.py
+index 343f71b..757daff 100644
+--- a/skimage/exposure/_adapthist.py
++++ b/skimage/exposure/_adapthist.py
+@@ -247,12 +247,14 @@ def clip_histogram(hist, clip_limit):
+ while n_excess > 0: # Redistribute remaining excess
+ index = 0
+ while n_excess > 0 and index < hist.size:
++ under_mask = hist < 0
+ step_size = int(hist[hist < clip_limit].size / n_excess)
+ step_size = max(step_size, 1)
+ indices = np.arange(index, hist.size, step_size)
+- under = hist[indices] < clip_limit
+- hist[under] += 1
+- n_excess -= hist[under].size
++ under_mask[indices] = True
++ under_mask = (under_mask) & (hist < clip_limit)
++ hist[under_mask] += 1
++ n_excess -= under_mask.sum()
+ index += 1
+
+ return hist
+diff --git a/skimage/exposure/tests/test_exposure.py b/skimage/exposure/tests/test_exposure.py
+index 8fb6d62..1b9c778 100644
+--- a/skimage/exposure/tests/test_exposure.py
++++ b/skimage/exposure/tests/test_exposure.py
+@@ -199,9 +199,9 @@ def test_adapthist_scalar():
+ full_scale = skimage.exposure.rescale_intensity(skimage.img_as_float(img))
+
+ assert_almost_equal = np.testing.assert_almost_equal
+- assert_almost_equal(peak_snr(full_scale, adapted), 101.2295, 3)
++ assert_almost_equal(peak_snr(full_scale, adapted), 102.066, 3)
+ assert_almost_equal(norm_brightness_err(full_scale, adapted),
+- 0.041, 3)
++ 0.038, 3)
+ return img, adapted
+
+
+@@ -217,8 +217,8 @@ def test_adapthist_grayscale():
+ nbins=128)
+ assert_almost_equal = np.testing.assert_almost_equal
+ assert img.shape == adapted.shape
+- assert_almost_equal(peak_snr(img, adapted), 97.6876, 3)
+- assert_almost_equal(norm_brightness_err(img, adapted), 0.0591, 3)
++ assert_almost_equal(peak_snr(img, adapted), 102.078, 3)
++ assert_almost_equal(norm_brightness_err(img, adapted), 0.0529, 3)
+ return data, adapted
+
+
+@@ -238,7 +238,7 @@ def test_adapthist_color():
+ assert adapted.max() == 1.0
+ assert img.shape == adapted.shape
+ full_scale = skimage.exposure.rescale_intensity(img)
+- assert_almost_equal(peak_snr(full_scale, adapted), 109.6, 1)
++ assert_almost_equal(peak_snr(full_scale, adapted), 109.393, 1)
+ assert_almost_equal(norm_brightness_err(full_scale, adapted), 0.02, 2)
+ return data, adapted
+
+@@ -256,8 +256,8 @@ def test_adapthist_alpha():
+ full_scale = skimage.exposure.rescale_intensity(img)
+ assert img.shape == adapted.shape
+ assert_almost_equal = np.testing.assert_almost_equal
+- assert_almost_equal(peak_snr(full_scale, adapted), 109.60, 2)
+- assert_almost_equal(norm_brightness_err(full_scale, adapted), 0.0235, 3)
++ assert_almost_equal(peak_snr(full_scale, adapted), 109.393, 2)
++ assert_almost_equal(norm_brightness_err(full_scale, adapted), 0.0248, 3)
+
+
+ def peak_snr(img1, img2):
diff --git a/sci-libs/scikits_image/files/scikits_image-0.11.3-adapthist-backport.patch1 b/sci-libs/scikits_image/files/scikits_image-0.11.3-adapthist-backport.patch1
new file mode 100644
index 000000000000..9d8036c2a1d4
--- /dev/null
+++ b/sci-libs/scikits_image/files/scikits_image-0.11.3-adapthist-backport.patch1
@@ -0,0 +1,73 @@
+ skimage/exposure/_adapthist.py | 8 +++++---
+ skimage/exposure/tests/test_exposure.py | 14 +++++++-------
+ 2 files changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/skimage/exposure/_adapthist.py b/skimage/exposure/_adapthist.py
+index b71916f..e878bfb 100644
+--- a/skimage/exposure/_adapthist.py
++++ b/skimage/exposure/_adapthist.py
+@@ -255,12 +255,14 @@ def clip_histogram(hist, clip_limit):
+ while n_excess > 0: # Redistribute remaining excess
+ index = 0
+ while n_excess > 0 and index < hist.size:
++ under_mask = hist < 0
+ step_size = int(hist[hist < clip_limit].size / n_excess)
+ step_size = max(step_size, 1)
+ indices = np.arange(index, hist.size, step_size)
+- under = hist[indices] < clip_limit
+- hist[under] += 1
+- n_excess -= hist[under].size
++ under_mask[indices] = True
++ under_mask = (under_mask) & (hist < clip_limit)
++ hist[under_mask] += 1
++ n_excess -= under_mask.sum()
+ index += 1
+
+ return hist
+diff --git a/skimage/exposure/tests/test_exposure.py b/skimage/exposure/tests/test_exposure.py
+index 265ce24..83bb551 100644
+--- a/skimage/exposure/tests/test_exposure.py
++++ b/skimage/exposure/tests/test_exposure.py
+@@ -199,9 +199,9 @@ def test_adapthist_scalar():
+ full_scale = skimage.exposure.rescale_intensity(skimage.img_as_float(img))
+
+ assert_almost_equal = np.testing.assert_almost_equal
+- assert_almost_equal(peak_snr(full_scale, adapted), 101.2295, 3)
++ assert_almost_equal(peak_snr(full_scale, adapted), 102.066, 3)
+ assert_almost_equal(norm_brightness_err(full_scale, adapted),
+- 0.041, 3)
++ 0.038, 3)
+ return img, adapted
+
+
+@@ -216,8 +216,8 @@ def test_adapthist_grayscale():
+ nbins=128)
+ assert_almost_equal = np.testing.assert_almost_equal
+ assert img.shape == adapted.shape
+- assert_almost_equal(peak_snr(img, adapted), 97.6876, 3)
+- assert_almost_equal(norm_brightness_err(img, adapted), 0.0591, 3)
++ assert_almost_equal(peak_snr(img, adapted), 102.078, 3)
++ assert_almost_equal(norm_brightness_err(img, adapted), 0.0529, 3)
+ return data, adapted
+
+
+@@ -237,7 +237,7 @@ def test_adapthist_color():
+ assert adapted.max() == 1.0
+ assert img.shape == adapted.shape
+ full_scale = skimage.exposure.rescale_intensity(img)
+- assert_almost_equal(peak_snr(full_scale, adapted), 109.6, 1)
++ assert_almost_equal(peak_snr(full_scale, adapted), 109.393, 1)
+ assert_almost_equal(norm_brightness_err(full_scale, adapted), 0.02, 2)
+ return data, adapted
+
+@@ -255,8 +255,8 @@ def test_adapthist_alpha():
+ full_scale = skimage.exposure.rescale_intensity(img)
+ assert img.shape == adapted.shape
+ assert_almost_equal = np.testing.assert_almost_equal
+- assert_almost_equal(peak_snr(full_scale, adapted), 109.60, 2)
+- assert_almost_equal(norm_brightness_err(full_scale, adapted), 0.0235, 3)
++ assert_almost_equal(peak_snr(full_scale, adapted), 109.393, 2)
++ assert_almost_equal(norm_brightness_err(full_scale, adapted), 0.0248, 3)
+
+
+ def peak_snr(img1, img2):