From 496e8c090e02dc1e73ea76eb56b206dd5b32d916 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 12 Jun 2015 20:41:38 +0200 Subject: [PATCH] the function name was shortened to multiblock_lbp --- doc/examples/plot_multiblock_local_binary_pattern.py | 6 +++--- skimage/feature/__init__.py | 4 ++-- skimage/feature/_texture.pyx | 10 +++++----- skimage/feature/tests/test_texture.py | 4 ++-- skimage/feature/texture.py | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/examples/plot_multiblock_local_binary_pattern.py b/doc/examples/plot_multiblock_local_binary_pattern.py index 6c40292d..c359a1e9 100644 --- a/doc/examples/plot_multiblock_local_binary_pattern.py +++ b/doc/examples/plot_multiblock_local_binary_pattern.py @@ -23,7 +23,7 @@ upon which we then apply MB-LBP. """ from __future__ import print_function -from skimage.feature import multiblock_local_binary_pattern +from skimage.feature import multiblock_lbp import numpy as np from numpy.testing import assert_equal from skimage.transform import integral_image @@ -43,7 +43,7 @@ correct_answer = 0b10001000 int_img = integral_image(test_img) -lbp_code = multiblock_local_binary_pattern(int_img, 0, 0, 3, 3) +lbp_code = multiblock_lbp(int_img, 0, 0, 3, 3) assert_equal(correct_answer, lbp_code) @@ -58,7 +58,7 @@ test_img = data.coins() int_img = integral_image(test_img) -lbp_code = multiblock_local_binary_pattern(int_img, 0, 0, 90, 90) +lbp_code = multiblock_lbp(int_img, 0, 0, 90, 90) img = draw_multiblock_lbp(test_img, 0, 0, 90, 90, lbp_code=lbp_code, alpha=0.5) diff --git a/skimage/feature/__init__.py b/skimage/feature/__init__.py index 4c646235..4d40e2c8 100644 --- a/skimage/feature/__init__.py +++ b/skimage/feature/__init__.py @@ -3,7 +3,7 @@ from ._daisy import daisy from ._hog import hog from .texture import (greycomatrix, greycoprops, local_binary_pattern, - multiblock_local_binary_pattern, + multiblock_lbp, draw_multiblock_lbp) from .peak import peak_local_max @@ -29,7 +29,7 @@ __all__ = ['canny', 'greycomatrix', 'greycoprops', 'local_binary_pattern', - 'multiblock_local_binary_pattern', + 'multiblock_lbp', 'draw_multiblock_lbp', 'peak_local_max', 'structure_tensor', diff --git a/skimage/feature/_texture.pyx b/skimage/feature/_texture.pyx index 85b6d530..6ff5d60b 100644 --- a/skimage/feature/_texture.pyx +++ b/skimage/feature/_texture.pyx @@ -274,11 +274,11 @@ cdef: Py_ssize_t[::1] mlbp_x_offsets = np.asarray([-1, 0, 1, 1, 1, 0, -1, -1]) Py_ssize_t[::1] mlbp_y_offsets = np.asarray([-1, -1, -1, 0, 1, 1, 1, 0]) -def _multiblock_local_binary_pattern(float[:, ::1] int_image, - Py_ssize_t x, - Py_ssize_t y, - Py_ssize_t width, - Py_ssize_t height): +def _multiblock_lbp(float[:, ::1] int_image, + Py_ssize_t x, + Py_ssize_t y, + Py_ssize_t width, + Py_ssize_t height): """Multi-block local binary pattern. Parameters diff --git a/skimage/feature/tests/test_texture.py b/skimage/feature/tests/test_texture.py index 1647f881..1bc44919 100644 --- a/skimage/feature/tests/test_texture.py +++ b/skimage/feature/tests/test_texture.py @@ -3,7 +3,7 @@ from skimage.feature import ( greycomatrix, greycoprops, local_binary_pattern, - multiblock_local_binary_pattern + multiblock_lbp ) from skimage._shared.testing import test_parallel @@ -254,7 +254,7 @@ class TestMBLBP(): int_img = integral_image(test_img) - lbp_code = multiblock_local_binary_pattern(int_img, 0, 0, 3, 3) + lbp_code = multiblock_lbp(int_img, 0, 0, 3, 3) np.testing.assert_equal(lbp_code, correct_answer) diff --git a/skimage/feature/texture.py b/skimage/feature/texture.py index f7e3baf9..1b9c8f1d 100644 --- a/skimage/feature/texture.py +++ b/skimage/feature/texture.py @@ -8,7 +8,7 @@ from ..util import img_as_float from ..color import gray2rgb from ._texture import (_glcm_loop, _local_binary_pattern, - _multiblock_local_binary_pattern) + _multiblock_lbp) def greycomatrix(image, distances, angles, levels=256, symmetric=False, @@ -297,7 +297,7 @@ def local_binary_pattern(image, P, R, method='default'): return output -def multiblock_local_binary_pattern(int_image, x, y, width, height): +def multiblock_lbp(int_image, x, y, width, height): """Multi-block local binary pattern. The features are calculated similarly to local binary patterns (LBPs), @@ -339,7 +339,7 @@ def multiblock_local_binary_pattern(int_image, x, y, width, height): """ int_image = np.ascontiguousarray(int_image, dtype=np.float32) - lbp_code = _multiblock_local_binary_pattern(int_image, x, y, width, height) + lbp_code = _multiblock_lbp(int_image, x, y, width, height) return lbp_code