skimage stubs
This commit is contained in:
Родитель
116165aa23
Коммит
9789ff0ca8
|
@ -0,0 +1,3 @@
|
|||
These stubs were created with https://github.com/gramster/docs2stubs.
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
__version__: str = ...
|
||||
|
||||
submodules: list = ...
|
||||
|
||||
from ._shared.version_requirements import ensure_python_version as ensure_python_version
|
||||
|
||||
from ._shared import lazy as lazy
|
||||
|
||||
__getattr__, __lazy_dir__, _ = ...
|
||||
|
||||
def __dir__(): ...
|
||||
|
||||
# Logic for checking for improper install and importing while in the source
|
||||
# tree when package has not been installed inplace.
|
||||
# Code adapted from scikit-learn's __check_build module.
|
||||
_INPLACE_MSG: str = ...
|
||||
|
||||
_STANDARD_MSG: str = ...
|
||||
|
||||
def _raise_build_error(e): ...
|
||||
|
||||
from skimage._shared.tester import PytestTester as PytestTester # noqa
|
||||
|
||||
test = ...
|
|
@ -0,0 +1,3 @@
|
|||
from .version_requirements import is_installed
|
||||
|
||||
has_mpl = ...
|
|
@ -0,0 +1,9 @@
|
|||
__all__ = ["polygon_clip", "polygon_area"]
|
||||
|
||||
import numpy as np
|
||||
|
||||
from .version_requirements import require
|
||||
|
||||
@require("matplotlib", ">=3.0.3")
|
||||
def polygon_clip(rp, cp, r0, c0, r1, c1): ...
|
||||
def polygon_area(pr, pc) -> float: ...
|
|
@ -0,0 +1,6 @@
|
|||
from tempfile import NamedTemporaryFile
|
||||
from contextlib import contextmanager
|
||||
import os
|
||||
|
||||
@contextmanager
|
||||
def temporary_file(suffix: str = ""): ...
|
|
@ -0,0 +1,17 @@
|
|||
from contextlib import contextmanager
|
||||
import sys
|
||||
import warnings
|
||||
import re
|
||||
import functools
|
||||
import os
|
||||
|
||||
__all__ = ["all_warnings", "expected_warnings", "warn"]
|
||||
|
||||
# A version of `warnings.warn` with a default stacklevel of 2.
|
||||
# functool is used so as not to increase the call stack accidentally
|
||||
warn = ...
|
||||
|
||||
@contextmanager
|
||||
def all_warnings(): ...
|
||||
@contextmanager
|
||||
def expected_warnings(matching): ...
|
|
@ -0,0 +1,13 @@
|
|||
import numpy as np
|
||||
from scipy.spatial import distance
|
||||
|
||||
def _ensure_spacing(coord, spacing, p_norm, max_out): ...
|
||||
def ensure_spacing(
|
||||
coords,
|
||||
spacing: float = 1,
|
||||
p_norm: float = ...,
|
||||
min_split_size: int = 50,
|
||||
max_out: int | None = None,
|
||||
*,
|
||||
max_split_size: int = 2000
|
||||
): ...
|
|
@ -0,0 +1,24 @@
|
|||
from skimage._typing import Scalar
|
||||
from numpy.typing import ArrayLike, NDArray
|
||||
from typing import Literal
|
||||
from collections.abc import Iterable
|
||||
|
||||
import numpy as np
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
from .._shared import utils
|
||||
from .._shared.utils import _supported_float_type, convert_to_float, warn
|
||||
|
||||
@utils.deprecate_multichannel_kwarg(multichannel_position=5)
|
||||
def gaussian(
|
||||
image: ArrayLike,
|
||||
sigma=1,
|
||||
output: ArrayLike | None = None,
|
||||
mode: Literal["reflect", "constant", "nearest", "mirror", "wrap"] = "nearest",
|
||||
cval: Scalar = 0,
|
||||
multichannel=None,
|
||||
preserve_range: bool = False,
|
||||
truncate: float = 4.0,
|
||||
*,
|
||||
channel_axis: int | None = None
|
||||
) -> NDArray: ...
|
|
@ -0,0 +1,12 @@
|
|||
from typing import Mapping
|
||||
import importlib
|
||||
import importlib.util
|
||||
import os
|
||||
import sys
|
||||
|
||||
def attach(
|
||||
package_name: str,
|
||||
submodules: set | None = None,
|
||||
submod_attrs: Mapping | None = None,
|
||||
): ...
|
||||
def load(fullname: str): ...
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
base_path = ...
|
||||
|
||||
def configuration(parent_package="", top_path=None): ...
|
|
@ -0,0 +1,19 @@
|
|||
from numpy.typing import ArrayLike
|
||||
from typing import Literal
|
||||
import os
|
||||
import sys
|
||||
|
||||
def _show_skimage_info(): ...
|
||||
|
||||
class PytestTester(object):
|
||||
def __init__(self, module_name): ...
|
||||
def __call__(
|
||||
self,
|
||||
label: Literal["fast", "full"] = "fast",
|
||||
verbose: int = 1,
|
||||
extra_argv: ArrayLike | None = None,
|
||||
doctests: bool = False,
|
||||
coverage: bool = False,
|
||||
durations: int = ...,
|
||||
tests=None,
|
||||
) -> bool: ...
|
|
@ -0,0 +1,55 @@
|
|||
from numpy.typing import ArrayLike
|
||||
|
||||
import os
|
||||
import re
|
||||
import struct
|
||||
import threading
|
||||
import functools
|
||||
from tempfile import NamedTemporaryFile
|
||||
|
||||
import numpy as np
|
||||
from numpy import testing
|
||||
from numpy.testing import (
|
||||
assert_array_equal,
|
||||
assert_array_almost_equal,
|
||||
assert_array_less,
|
||||
assert_array_almost_equal_nulp,
|
||||
assert_equal,
|
||||
TestCase,
|
||||
assert_allclose,
|
||||
assert_almost_equal,
|
||||
assert_,
|
||||
assert_warns,
|
||||
assert_no_warnings,
|
||||
)
|
||||
|
||||
import warnings
|
||||
|
||||
from ..data._fetchers import _fetch
|
||||
from ._warnings import expected_warnings
|
||||
|
||||
SKIP_RE = ...
|
||||
|
||||
skipif = ...
|
||||
xfail = ...
|
||||
parametrize = ...
|
||||
raises = ...
|
||||
fixture = ...
|
||||
|
||||
# true if python is running in 32bit mode
|
||||
# Calculate the size of a void * pointer in bits
|
||||
# https://docs.python.org/3/library/struct.html
|
||||
arch32 = ...
|
||||
|
||||
_error_on_warnings = ...
|
||||
|
||||
def assert_less(a, b, msg=None): ...
|
||||
def assert_greater(a, b, msg=None): ...
|
||||
def doctest_skip_parser(func): ...
|
||||
def roundtrip(image, plugin, suffix): ...
|
||||
def color_check(plugin, fmt="png"): ...
|
||||
def mono_check(plugin, fmt="png"): ...
|
||||
def setup_test(): ...
|
||||
def teardown_test(): ...
|
||||
def fetch(data_filename): ...
|
||||
def test_parallel(num_threads: int = 2, warnings_matching: ArrayLike | None = None): ...
|
|
@ -0,0 +1,110 @@
|
|||
from collections.abc import Iterable
|
||||
from numpy.typing import ArrayLike, NDArray
|
||||
from typing import Any, Mapping, Literal
|
||||
import inspect
|
||||
import functools
|
||||
import sys
|
||||
import warnings
|
||||
from collections.abc import Iterable
|
||||
|
||||
import numpy as np
|
||||
import scipy
|
||||
from numpy.lib import NumpyVersion
|
||||
|
||||
from ._warnings import all_warnings, warn
|
||||
|
||||
__all__ = [
|
||||
"deprecated",
|
||||
"get_bound_method_class",
|
||||
"all_warnings",
|
||||
"safe_as_int",
|
||||
"check_shape_equality",
|
||||
"check_nD",
|
||||
"warn",
|
||||
"reshape_nd",
|
||||
"identity",
|
||||
"slice_at_axis",
|
||||
]
|
||||
|
||||
class skimage_deprecation(Warning):
|
||||
pass
|
||||
|
||||
def _get_stack_rank(func): ...
|
||||
def _is_wrapped(func): ...
|
||||
def _get_stack_length(func): ...
|
||||
|
||||
class _DecoratorBaseClass:
|
||||
|
||||
_stack_length: dict = ...
|
||||
|
||||
def get_stack_length(self, func): ...
|
||||
|
||||
class change_default_value(_DecoratorBaseClass):
|
||||
def __init__(
|
||||
self,
|
||||
arg_name: str,
|
||||
*,
|
||||
new_value: Any,
|
||||
changed_version: str,
|
||||
warning_msg: str | None = None
|
||||
): ...
|
||||
def __call__(self, func): ...
|
||||
|
||||
class remove_arg(_DecoratorBaseClass):
|
||||
def __init__(
|
||||
self, arg_name: str, *, changed_version: str, help_msg: str | None = None
|
||||
): ...
|
||||
def __call__(self, func): ...
|
||||
|
||||
def docstring_add_deprecated(
|
||||
func, kwarg_mapping: Mapping, deprecated_version: str
|
||||
) -> str: ...
|
||||
|
||||
class deprecate_kwarg(_DecoratorBaseClass):
|
||||
def __init__(
|
||||
self,
|
||||
kwarg_mapping: Mapping,
|
||||
deprecated_version: str,
|
||||
warning_msg: str | None = None,
|
||||
removed_version: str | None = None,
|
||||
): ...
|
||||
def __call__(self, func): ...
|
||||
|
||||
class deprecate_multichannel_kwarg(deprecate_kwarg):
|
||||
def __init__(self, removed_version: str = "1.0", multichannel_position=None): ...
|
||||
def __call__(self, func): ...
|
||||
|
||||
class channel_as_last_axis:
|
||||
def __init__(
|
||||
self,
|
||||
channel_arg_positions: tuple[int, ...] = ...,
|
||||
channel_kwarg_names: tuple[str, ...] = ...,
|
||||
multichannel_output: bool = True,
|
||||
): ...
|
||||
def __call__(self, func): ...
|
||||
|
||||
class deprecated:
|
||||
def __init__(
|
||||
self,
|
||||
alt_func: str | None = None,
|
||||
behavior: Literal["warn", "raise"] = "warn",
|
||||
removed_version: str | None = None,
|
||||
): ...
|
||||
def __call__(self, func): ...
|
||||
|
||||
def get_bound_method_class(m): ...
|
||||
def safe_as_int(val, atol: float = 1e-3): ...
|
||||
def check_shape_equality(im1, im2): ...
|
||||
def slice_at_axis(sl, axis: int): ...
|
||||
def reshape_nd(arr, ndim: int, dim: int): ...
|
||||
def check_nD(array: ArrayLike, ndim: int | Iterable[int], arg_name: str = "image"): ...
|
||||
def convert_to_float(image: NDArray, preserve_range: bool) -> NDArray: ...
|
||||
def _validate_interpolation_order(image_dtype, order): ...
|
||||
def _to_np_mode(mode): ...
|
||||
def _to_ndimage_mode(mode): ...
|
||||
def _fix_ndimage_mode(mode): ...
|
||||
|
||||
new_float_type: dict = ...
|
||||
|
||||
def _supported_float_type(input_dtype, allow_complex=False): ...
|
||||
def identity(image, *args, **kwargs): ...
|
|
@ -0,0 +1,10 @@
|
|||
import sys
|
||||
|
||||
from packaging import version as _version
|
||||
|
||||
def ensure_python_version(min_version): ...
|
||||
def _check_version(actver, version, cmp_op): ...
|
||||
def get_module_version(module_name): ...
|
||||
def is_installed(name: str, version: str | None = None) -> bool: ...
|
||||
def require(name: str, version: str | None = None): ...
|
||||
def get_module(module_name: str, version: str | None = None): ...
|
|
@ -0,0 +1,25 @@
|
|||
import decimal
|
||||
import io
|
||||
import numpy.typing
|
||||
import pandas as pd
|
||||
|
||||
Decimal = decimal.Decimal
|
||||
PythonScalar = str | int | float | bool
|
||||
|
||||
ArrayLike = numpy.typing.ArrayLike
|
||||
FileLike = io.IOBase
|
||||
PathLike = str
|
||||
|
||||
PandasScalar = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval
|
||||
Scalar = PythonScalar | PandasScalar
|
||||
|
||||
Color = tuple[float, float, float] | str
|
||||
|
||||
__all__ = [
|
||||
"ArrayLike",
|
||||
"Color",
|
||||
"Decimal",
|
||||
"FileLike",
|
||||
"PathLike",
|
||||
"Scalar",
|
||||
]
|
|
@ -0,0 +1,3 @@
|
|||
from .._shared import lazy as lazy
|
||||
|
||||
__getattr__, __dir__, __all__ = ...
|
|
@ -0,0 +1,12 @@
|
|||
from numpy.typing import NDArray
|
||||
import numpy as np
|
||||
|
||||
from .._shared.filters import gaussian
|
||||
|
||||
def binary_blobs(
|
||||
length: int = 512,
|
||||
blob_size_fraction: float = 0.1,
|
||||
n_dim: int = 2,
|
||||
volume_fraction: float = 0.5,
|
||||
seed=None,
|
||||
) -> NDArray: ...
|
|
@ -0,0 +1,65 @@
|
|||
from os import PathLike
|
||||
import numpy as np
|
||||
import shutil
|
||||
from packaging import version
|
||||
|
||||
from ._registry import registry, legacy_registry, registry_urls
|
||||
|
||||
from .. import __version__
|
||||
|
||||
import os.path as osp
|
||||
import os
|
||||
|
||||
legacy_data_dir = ...
|
||||
skimage_distribution_dir = ...
|
||||
|
||||
def _has_hash(path, expected_hash): ...
|
||||
def create_image_fetcher(): ...
|
||||
|
||||
image_fetcher, data_dir = ...
|
||||
|
||||
def _skip_pytest_case_requiring_pooch(data_filename): ...
|
||||
def _fetch(data_filename): ...
|
||||
def _init_pooch(): ...
|
||||
def download_all(directory: PathLike | None = None): ...
|
||||
def lbp_frontal_face_cascade_filename(): ...
|
||||
def _load(f, as_gray=False): ...
|
||||
def camera(): ...
|
||||
def eagle(): ...
|
||||
def astronaut(): ...
|
||||
def brick(): ...
|
||||
def grass(): ...
|
||||
def gravel(): ...
|
||||
def text(): ...
|
||||
def checkerboard(): ...
|
||||
def cells3d(): ...
|
||||
def human_mitosis(): ...
|
||||
def cell(): ...
|
||||
def coins(): ...
|
||||
def kidney(): ...
|
||||
def lily(): ...
|
||||
def logo(): ...
|
||||
def microaneurysms(): ...
|
||||
def moon(): ...
|
||||
def page(): ...
|
||||
def horse(): ...
|
||||
def clock(): ...
|
||||
def immunohistochemistry(): ...
|
||||
def chelsea(): ...
|
||||
|
||||
# Define an alias for chelsea that is more descriptive.
|
||||
cat = ...
|
||||
|
||||
def coffee(): ...
|
||||
def hubble_deep_field(): ...
|
||||
def retina(): ...
|
||||
def shepp_logan_phantom(): ...
|
||||
def colorwheel(): ...
|
||||
def rocket(): ...
|
||||
def stereo_motorcycle(): ...
|
||||
def lfw_subset(): ...
|
||||
def skin(): ...
|
||||
def nickel_solidification(): ...
|
||||
def protein_transport(): ...
|
||||
def brain(): ...
|
||||
def vortex(): ...
|
|
@ -0,0 +1,17 @@
|
|||
# flake8: noqa
|
||||
|
||||
# This minimal dataset was available as part of
|
||||
# scikit-image 0.15 and will be retained until
|
||||
# further notice.
|
||||
# Testing data and additional datasets should only
|
||||
# be made available by pooch
|
||||
legacy_datasets: list = ...
|
||||
|
||||
# Registry of datafiles that can be downloaded along with their SHA256 hashes
|
||||
# To generate the SHA256 hash, use the command
|
||||
# openssl sha256 filename
|
||||
registry: dict = ...
|
||||
|
||||
registry_urls: dict = ...
|
||||
|
||||
legacy_registry: dict = ...
|
|
@ -0,0 +1,41 @@
|
|||
from .draw import (
|
||||
ellipse as ellipse,
|
||||
set_color as set_color,
|
||||
polygon_perimeter as polygon_perimeter,
|
||||
line as line,
|
||||
line_aa as line_aa,
|
||||
polygon as polygon,
|
||||
ellipse_perimeter as ellipse_perimeter,
|
||||
circle_perimeter as circle_perimeter,
|
||||
circle_perimeter_aa as circle_perimeter_aa,
|
||||
disk as disk,
|
||||
bezier_curve as bezier_curve,
|
||||
rectangle as rectangle,
|
||||
rectangle_perimeter as rectangle_perimeter,
|
||||
)
|
||||
from .draw3d import ellipsoid as ellipsoid, ellipsoid_stats as ellipsoid_stats
|
||||
from ._random_shapes import random_shapes as random_shapes
|
||||
from ._polygon2mask import polygon2mask as polygon2mask
|
||||
|
||||
from .draw_nd import line_nd as line_nd
|
||||
|
||||
__all__ = [
|
||||
"line",
|
||||
"line_aa",
|
||||
"line_nd",
|
||||
"bezier_curve",
|
||||
"polygon",
|
||||
"polygon_perimeter",
|
||||
"ellipse",
|
||||
"ellipse_perimeter",
|
||||
"ellipsoid",
|
||||
"ellipsoid_stats",
|
||||
"circle_perimeter",
|
||||
"circle_perimeter_aa",
|
||||
"disk",
|
||||
"set_color",
|
||||
"random_shapes",
|
||||
"rectangle",
|
||||
"rectangle_perimeter",
|
||||
"polygon2mask",
|
||||
]
|
|
@ -0,0 +1,5 @@
|
|||
import numpy as np
|
||||
|
||||
from . import draw
|
||||
|
||||
def polygon2mask(image_shape, polygon): ...
|
|
@ -0,0 +1,33 @@
|
|||
import math
|
||||
import numpy as np
|
||||
|
||||
from . import polygon as draw_polygon, disk as draw_disk, ellipse as draw_ellipse
|
||||
from .._shared.utils import deprecate_multichannel_kwarg, warn
|
||||
|
||||
def _generate_rectangle_mask(point, image, shape, random): ...
|
||||
def _generate_circle_mask(point, image, shape, random): ...
|
||||
def _generate_triangle_mask(point, image, shape, random): ...
|
||||
def _generate_ellipse_mask(point, image, shape, random): ...
|
||||
|
||||
# Allows lookup by key as well as random selection.
|
||||
SHAPE_GENERATORS = ...
|
||||
SHAPE_CHOICES = ...
|
||||
|
||||
def _generate_random_colors(num_colors, num_channels, intensity_range, random): ...
|
||||
@deprecate_multichannel_kwarg(multichannel_position=5)
|
||||
def random_shapes(
|
||||
image_shape: tuple,
|
||||
max_shapes: int,
|
||||
min_shapes: int = 1,
|
||||
min_size: int = 2,
|
||||
max_size: int | None = None,
|
||||
multichannel: bool = True,
|
||||
num_channels: int = 3,
|
||||
shape=None,
|
||||
intensity_range=None,
|
||||
allow_overlap: bool = False,
|
||||
num_trials: int = 100,
|
||||
random_seed=None,
|
||||
*,
|
||||
channel_axis: int | None = ...
|
||||
): ...
|
|
@ -0,0 +1,61 @@
|
|||
from numpy.typing import NDArray
|
||||
from typing import Literal
|
||||
import numpy as np
|
||||
|
||||
from .._shared._geometry import polygon_clip
|
||||
from .._shared.version_requirements import require
|
||||
|
||||
def _ellipse_in_shape(shape, center, radii, rotation=0.0): ...
|
||||
def ellipse(
|
||||
r, c, r_radius, c_radius, shape: tuple | None = None, rotation=0.0
|
||||
) -> NDArray: ...
|
||||
def disk(center: tuple, radius, *, shape: tuple | None = None) -> NDArray: ...
|
||||
@require("matplotlib", ">=3.0.3")
|
||||
def polygon_perimeter(
|
||||
r, c, shape: tuple | None = None, clip: bool = False
|
||||
) -> NDArray: ...
|
||||
def set_color(image, coords, color, alpha=1): ...
|
||||
def line(r0: int, c0: int, r1: int, c1: int): ...
|
||||
def line_aa(r0: int, c0: int, r1: int, c1: int): ...
|
||||
def polygon(r, c, shape: tuple | None = None) -> NDArray: ...
|
||||
def circle_perimeter(
|
||||
r: int,
|
||||
c: int,
|
||||
radius: int,
|
||||
method: Literal["bresenham", "andres"] = "bresenham",
|
||||
shape: tuple | None = None,
|
||||
): ...
|
||||
def circle_perimeter_aa(r: int, c: int, radius: int, shape: tuple | None = None): ...
|
||||
def ellipse_perimeter(
|
||||
r: int,
|
||||
c: int,
|
||||
r_radius: int,
|
||||
c_radius: int,
|
||||
orientation=0,
|
||||
shape: tuple | None = None,
|
||||
): ...
|
||||
def bezier_curve(
|
||||
r0: int,
|
||||
c0: int,
|
||||
r1: int,
|
||||
c1: int,
|
||||
r2: int,
|
||||
c2: int,
|
||||
weight,
|
||||
shape: tuple | None = None,
|
||||
): ...
|
||||
def rectangle(
|
||||
start: tuple,
|
||||
end: tuple | None = None,
|
||||
extent: tuple | None = None,
|
||||
shape: tuple | None = None,
|
||||
): ...
|
||||
@require("matplotlib", ">=3.0.3")
|
||||
def rectangle_perimeter(
|
||||
start: tuple,
|
||||
end: tuple | None = None,
|
||||
extent: tuple | None = None,
|
||||
shape: tuple | None = None,
|
||||
clip: bool = False,
|
||||
): ...
|
||||
def _rectangle_slice(start, end=None, extent=None): ...
|
|
@ -0,0 +1,5 @@
|
|||
import numpy as np
|
||||
from scipy.special import ellipkinc as ellip_F, ellipeinc as ellip_E
|
||||
|
||||
def ellipsoid(a: float, b: float, c: float, spacing=..., levelset: bool = False): ...
|
||||
def ellipsoid_stats(a: float, b: float, c: float) -> tuple[float, float]: ...
|
|
@ -0,0 +1,4 @@
|
|||
import numpy as np
|
||||
|
||||
def _round_safe(coords): ...
|
||||
def line_nd(start, stop, *, endpoint: bool = False, integer: bool = True): ...
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
base_path = ...
|
||||
|
||||
def configuration(parent_package="", top_path=None): ...
|
|
@ -0,0 +1,99 @@
|
|||
from .._shared.utils import deprecated as deprecated
|
||||
|
||||
from ._canny import canny as canny
|
||||
from ._cascade import Cascade as Cascade
|
||||
from ._daisy import daisy as daisy
|
||||
from ._hog import hog as hog
|
||||
from .texture import (
|
||||
graycomatrix as graycomatrix,
|
||||
graycoprops as graycoprops,
|
||||
local_binary_pattern as local_binary_pattern,
|
||||
multiblock_lbp as multiblock_lbp,
|
||||
draw_multiblock_lbp as draw_multiblock_lbp,
|
||||
)
|
||||
|
||||
from .peak import peak_local_max as peak_local_max
|
||||
from .corner import (
|
||||
corner_kitchen_rosenfeld as corner_kitchen_rosenfeld,
|
||||
corner_harris as corner_harris,
|
||||
corner_shi_tomasi as corner_shi_tomasi,
|
||||
corner_foerstner as corner_foerstner,
|
||||
corner_subpix as corner_subpix,
|
||||
corner_peaks as corner_peaks,
|
||||
corner_fast as corner_fast,
|
||||
structure_tensor as structure_tensor,
|
||||
structure_tensor_eigenvalues as structure_tensor_eigenvalues,
|
||||
structure_tensor_eigvals as structure_tensor_eigvals,
|
||||
hessian_matrix as hessian_matrix,
|
||||
hessian_matrix_eigvals as hessian_matrix_eigvals,
|
||||
hessian_matrix_det as hessian_matrix_det,
|
||||
corner_moravec as corner_moravec,
|
||||
corner_orientations as corner_orientations,
|
||||
shape_index as shape_index,
|
||||
)
|
||||
from .template import match_template as match_template
|
||||
from .brief import BRIEF as BRIEF
|
||||
from .censure import CENSURE as CENSURE
|
||||
from .orb import ORB as ORB
|
||||
from .sift import SIFT as SIFT
|
||||
from .match import match_descriptors as match_descriptors
|
||||
from .util import plot_matches as plot_matches
|
||||
from .blob import blob_dog as blob_dog, blob_log as blob_log, blob_doh as blob_doh
|
||||
from .haar import (
|
||||
haar_like_feature as haar_like_feature,
|
||||
haar_like_feature_coord as haar_like_feature_coord,
|
||||
draw_haar_like_feature as draw_haar_like_feature,
|
||||
)
|
||||
from ._basic_features import multiscale_basic_features as multiscale_basic_features
|
||||
|
||||
@deprecated(alt_func="skimage.feature.graycomatrix", removed_version="1.0")
|
||||
def greycomatrix(
|
||||
image, distances, angles, levels=None, symmetric=False, normed=False
|
||||
): ...
|
||||
@deprecated(alt_func="skimage.feature.graycoprops", removed_version="1.0")
|
||||
def greycoprops(P, prop="contrast"): ...
|
||||
|
||||
__all__ = [
|
||||
"canny",
|
||||
"Cascade",
|
||||
"daisy",
|
||||
"hog",
|
||||
"graycomatrix",
|
||||
"graycoprops",
|
||||
"greycomatrix",
|
||||
"greycoprops",
|
||||
"local_binary_pattern",
|
||||
"multiblock_lbp",
|
||||
"draw_multiblock_lbp",
|
||||
"peak_local_max",
|
||||
"structure_tensor",
|
||||
"structure_tensor_eigenvalues",
|
||||
"structure_tensor_eigvals",
|
||||
"hessian_matrix",
|
||||
"hessian_matrix_det",
|
||||
"hessian_matrix_eigvals",
|
||||
"shape_index",
|
||||
"corner_kitchen_rosenfeld",
|
||||
"corner_harris",
|
||||
"corner_shi_tomasi",
|
||||
"corner_foerstner",
|
||||
"corner_subpix",
|
||||
"corner_peaks",
|
||||
"corner_moravec",
|
||||
"corner_fast",
|
||||
"corner_orientations",
|
||||
"match_template",
|
||||
"BRIEF",
|
||||
"CENSURE",
|
||||
"ORB",
|
||||
"SIFT",
|
||||
"match_descriptors",
|
||||
"plot_matches",
|
||||
"blob_dog",
|
||||
"blob_doh",
|
||||
"blob_log",
|
||||
"haar_like_feature",
|
||||
"haar_like_feature_coord",
|
||||
"draw_haar_like_feature",
|
||||
"multiscale_basic_features",
|
||||
]
|
|
@ -0,0 +1,36 @@
|
|||
from numpy.typing import NDArray
|
||||
from itertools import combinations_with_replacement
|
||||
import itertools
|
||||
import numpy as np
|
||||
|
||||
from skimage._shared import utils
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
def _texture_filter(gaussian_filtered): ...
|
||||
def _singlescale_basic_features_singlechannel(
|
||||
img, sigma, intensity=True, edges=True, texture=True
|
||||
): ...
|
||||
def _mutiscale_basic_features_singlechannel(
|
||||
img,
|
||||
intensity=True,
|
||||
edges=True,
|
||||
texture=True,
|
||||
sigma_min=0.5,
|
||||
sigma_max=16,
|
||||
num_sigma=None,
|
||||
num_workers=None,
|
||||
): ...
|
||||
@utils.deprecate_multichannel_kwarg(multichannel_position=1)
|
||||
def multiscale_basic_features(
|
||||
image: NDArray,
|
||||
multichannel: bool = False,
|
||||
intensity: bool = True,
|
||||
edges: bool = True,
|
||||
texture: bool = True,
|
||||
sigma_min: float = 0.5,
|
||||
sigma_max: float = 16,
|
||||
num_sigma: int | None = None,
|
||||
num_workers: int | None = None,
|
||||
*,
|
||||
channel_axis: int | None = None,
|
||||
): ...
|
|
@ -0,0 +1,20 @@
|
|||
import numpy as np
|
||||
import scipy.ndimage as ndi
|
||||
|
||||
from .._shared.filters import gaussian
|
||||
from .._shared.utils import check_nD
|
||||
|
||||
def _preprocess(image, mask, sigma, mode, cval): ...
|
||||
def _set_local_maxima(magnitude, pts, w_num, w_denum, row_slices, col_slices, out): ...
|
||||
def _get_local_maxima(isobel, jsobel, magnitude, eroded_mask): ...
|
||||
def canny(
|
||||
image,
|
||||
sigma: float = 1.0,
|
||||
low_threshold: float | None = None,
|
||||
high_threshold: float | None = None,
|
||||
mask=None,
|
||||
use_quantiles: bool = False,
|
||||
*,
|
||||
mode="constant",
|
||||
cval: float = 0.0
|
||||
): ...
|
|
@ -0,0 +1,23 @@
|
|||
from numpy.typing import ArrayLike
|
||||
import math
|
||||
|
||||
import numpy as np
|
||||
from numpy import arctan2, exp, pi, sqrt
|
||||
|
||||
from .. import draw
|
||||
|
||||
from .._shared.filters import gaussian
|
||||
from .._shared.utils import check_nD
|
||||
|
||||
def daisy(
|
||||
image,
|
||||
step: int = 4,
|
||||
radius: int = 15,
|
||||
rings: int = 3,
|
||||
histograms: int = 8,
|
||||
orientations: int = 8,
|
||||
normalization="l1",
|
||||
sigmas=None,
|
||||
ring_radii=None,
|
||||
visualize: bool = False,
|
||||
): ...
|
|
@ -0,0 +1,7 @@
|
|||
import numpy as np
|
||||
|
||||
def _clip(x, low, high): ...
|
||||
def _integ(img, r, c, rl, cl): ...
|
||||
|
||||
# pythran export _hessian_matrix_det(float64[:,:], float or int)
|
||||
def _hessian_matrix_det(img, sigma): ...
|
|
@ -0,0 +1,21 @@
|
|||
import numpy as np
|
||||
|
||||
from .._shared import utils
|
||||
|
||||
def _hog_normalize_block(block, method, eps=1e-5): ...
|
||||
def _hog_channel_gradient(channel): ...
|
||||
@utils.channel_as_last_axis(multichannel_output=False)
|
||||
@utils.deprecate_multichannel_kwarg(multichannel_position=8)
|
||||
def hog(
|
||||
image,
|
||||
orientations: int = 9,
|
||||
pixels_per_cell=...,
|
||||
cells_per_block=...,
|
||||
block_norm="L2-Hys",
|
||||
visualize: bool = False,
|
||||
transform_sqrt: bool = False,
|
||||
feature_vector: bool = True,
|
||||
multichannel: bool | None = None,
|
||||
*,
|
||||
channel_axis: int | None = None
|
||||
): ...
|
|
@ -0,0 +1,10 @@
|
|||
import os
|
||||
import numpy as np
|
||||
|
||||
# Putting this in cython was giving strange bugs for different versions
|
||||
# of cython which seemed to indicate troubles with the __file__ variable
|
||||
# not being defined. Keeping it in pure python makes it more reliable
|
||||
this_dir = ...
|
||||
POS = ...
|
||||
POS0 = ...
|
||||
POS1 = ...
|
|
@ -0,0 +1,56 @@
|
|||
from numpy.typing import NDArray
|
||||
import math
|
||||
|
||||
import numpy as np
|
||||
import scipy.ndimage as ndi
|
||||
from scipy import spatial
|
||||
|
||||
from .._shared.filters import gaussian
|
||||
from .._shared.utils import _supported_float_type, check_nD
|
||||
from ..transform import integral_image
|
||||
|
||||
from .peak import peak_local_max
|
||||
|
||||
# This basic blob detection algorithm is based on:
|
||||
# http://www.cs.utah.edu/~jfishbau/advimproc/project1/ (04.04.2013)
|
||||
# Theory behind: https://en.wikipedia.org/wiki/Blob_detection (04.04.2013)
|
||||
|
||||
def _compute_disk_overlap(d, r1, r2): ...
|
||||
def _compute_sphere_overlap(d, r1, r2): ...
|
||||
def _blob_overlap(blob1, blob2, *, sigma_dim=1): ...
|
||||
def _prune_blobs(blobs_array, overlap, *, sigma_dim=1): ...
|
||||
def _format_exclude_border(img_ndim, exclude_border): ...
|
||||
def blob_dog(
|
||||
image: NDArray,
|
||||
min_sigma=1,
|
||||
max_sigma=50,
|
||||
sigma_ratio: float = 1.6,
|
||||
threshold: float | None = 0.5,
|
||||
overlap: float = 0.5,
|
||||
*,
|
||||
threshold_rel: float | None = None,
|
||||
exclude_border=False
|
||||
): ...
|
||||
def blob_log(
|
||||
image: NDArray,
|
||||
min_sigma=1,
|
||||
max_sigma=50,
|
||||
num_sigma: int = 10,
|
||||
threshold: float | None = 0.2,
|
||||
overlap: float = 0.5,
|
||||
log_scale: bool = False,
|
||||
*,
|
||||
threshold_rel: float | None = None,
|
||||
exclude_border=False
|
||||
): ...
|
||||
def blob_doh(
|
||||
image,
|
||||
min_sigma: float = 1,
|
||||
max_sigma: float = 30,
|
||||
num_sigma: int = 10,
|
||||
threshold: float | None = 0.01,
|
||||
overlap: float = 0.5,
|
||||
log_scale: bool = False,
|
||||
*,
|
||||
threshold_rel: float | None = None
|
||||
): ...
|
|
@ -0,0 +1,22 @@
|
|||
from typing import Literal
|
||||
import numpy as np
|
||||
|
||||
from .._shared.filters import gaussian
|
||||
from .._shared.utils import check_nD
|
||||
|
||||
from .util import (
|
||||
DescriptorExtractor,
|
||||
_mask_border_keypoints,
|
||||
_prepare_grayscale_input_2D,
|
||||
)
|
||||
|
||||
class BRIEF(DescriptorExtractor):
|
||||
def __init__(
|
||||
self,
|
||||
descriptor_size: int = 256,
|
||||
patch_size: int = 49,
|
||||
mode: Literal["normal", "uniform"] = "normal",
|
||||
sigma: float = 1,
|
||||
sample_seed=1,
|
||||
): ...
|
||||
def extract(self, image, keypoints): ...
|
|
@ -0,0 +1,4 @@
|
|||
import numpy as np
|
||||
|
||||
# pythran export _brief_loop(float32[:,:] or float64[:,:], uint8[:,:], int64[:,2], int32[:,2], int32[:,2])
|
||||
def _brief_loop(image, descriptors, keypoints, pos0, pos1): ...
|
|
@ -0,0 +1,41 @@
|
|||
import numpy as np
|
||||
from scipy.ndimage import maximum_filter, minimum_filter, convolve
|
||||
|
||||
from ..transform import integral_image
|
||||
from ..feature import structure_tensor
|
||||
from ..morphology import octagon, star
|
||||
from ..feature.util import (
|
||||
FeatureDetector,
|
||||
_prepare_grayscale_input_2D,
|
||||
_mask_border_keypoints,
|
||||
)
|
||||
from .._shared.utils import check_nD
|
||||
|
||||
# The paper(Reference [1]) mentions the sizes of the Octagon shaped filter
|
||||
# kernel for the first seven scales only. The sizes of the later scales
|
||||
# have been extrapolated based on the following statement in the paper.
|
||||
# "These octagons scale linearly and were experimentally chosen to correspond
|
||||
# to the seven DOBs described in the previous section."
|
||||
OCTAGON_OUTER_SHAPE: list = ...
|
||||
OCTAGON_INNER_SHAPE: list = ...
|
||||
|
||||
# The sizes for the STAR shaped filter kernel for different scales have been
|
||||
# taken from the OpenCV implementation.
|
||||
STAR_SHAPE: list = ...
|
||||
STAR_FILTER_SHAPE: list = ...
|
||||
|
||||
def _filter_image(image, min_scale, max_scale, mode): ...
|
||||
def _octagon_kernel(mo, no, mi, ni): ...
|
||||
def _star_kernel(m, n): ...
|
||||
def _suppress_lines(feature_mask, image, sigma, line_threshold): ...
|
||||
|
||||
class CENSURE(FeatureDetector):
|
||||
def __init__(
|
||||
self,
|
||||
min_scale=1,
|
||||
max_scale=7,
|
||||
mode="DoB",
|
||||
non_max_threshold=0.15,
|
||||
line_threshold=10,
|
||||
): ...
|
||||
def detect(self, image): ...
|
|
@ -0,0 +1,80 @@
|
|||
from numpy import ndarray
|
||||
from numpy.typing import NDArray, ArrayLike
|
||||
from typing import Literal
|
||||
from itertools import combinations_with_replacement
|
||||
from warnings import warn
|
||||
|
||||
import numpy as np
|
||||
from scipy import ndimage as ndi
|
||||
from scipy import spatial, stats
|
||||
|
||||
from .._shared.filters import gaussian
|
||||
from .._shared.utils import _supported_float_type, safe_as_int
|
||||
from ..transform import integral_image
|
||||
from .peak import peak_local_max
|
||||
from .util import _prepare_grayscale_input_2D, _prepare_grayscale_input_nD
|
||||
|
||||
def _compute_derivatives(image, mode="constant", cval=0): ...
|
||||
def structure_tensor(
|
||||
image: NDArray,
|
||||
sigma: float | ArrayLike = 1,
|
||||
mode: Literal["constant", "reflect", "wrap", "nearest", "mirror"] = "constant",
|
||||
cval: float = 0,
|
||||
order: Literal["rc", "xy"] | None = None,
|
||||
) -> ArrayLike: ...
|
||||
def hessian_matrix(
|
||||
image: NDArray,
|
||||
sigma: float = 1,
|
||||
mode: Literal["constant", "reflect", "wrap", "nearest", "mirror"] = "constant",
|
||||
cval: float = 0,
|
||||
order: Literal["rc", "xy"] = "rc",
|
||||
) -> ArrayLike: ...
|
||||
def hessian_matrix_det(
|
||||
image: NDArray, sigma: float = 1, approximate: bool = True
|
||||
) -> ArrayLike: ...
|
||||
def _image_orthogonal_matrix22_eigvals(M00, M01, M11): ...
|
||||
def _symmetric_compute_eigenvalues(S_elems): ...
|
||||
def _symmetric_image(S_elems): ...
|
||||
def structure_tensor_eigenvalues(A_elems: ArrayLike) -> NDArray: ...
|
||||
def structure_tensor_eigvals(
|
||||
Axx: NDArray, Axy: NDArray, Ayy: NDArray
|
||||
) -> tuple[NDArray, NDArray]: ...
|
||||
def hessian_matrix_eigvals(H_elems: ArrayLike) -> NDArray: ...
|
||||
def shape_index(
|
||||
image,
|
||||
sigma: float = 1,
|
||||
mode: Literal["constant", "reflect", "wrap", "nearest", "mirror"] = "constant",
|
||||
cval: float = 0,
|
||||
) -> NDArray: ...
|
||||
def corner_kitchen_rosenfeld(
|
||||
image,
|
||||
mode: Literal["constant", "reflect", "wrap", "nearest", "mirror"] = "constant",
|
||||
cval: float = 0,
|
||||
) -> NDArray: ...
|
||||
def corner_harris(
|
||||
image,
|
||||
method: Literal["k", "eps"] = "k",
|
||||
k: float = 0.05,
|
||||
eps: float = 1e-6,
|
||||
sigma: float = 1,
|
||||
) -> NDArray: ...
|
||||
def corner_shi_tomasi(image, sigma: float = 1) -> NDArray: ...
|
||||
def corner_foerstner(image, sigma: float = 1) -> tuple[NDArray, NDArray]: ...
|
||||
def corner_fast(image, n: int = 12, threshold: float = 0.15) -> NDArray: ...
|
||||
def corner_subpix(image, corners, window_size: int = 11, alpha: float = 0.99): ...
|
||||
def corner_peaks(
|
||||
image,
|
||||
min_distance: int = 1,
|
||||
threshold_abs=None,
|
||||
threshold_rel=None,
|
||||
exclude_border=True,
|
||||
indices=True,
|
||||
num_peaks=...,
|
||||
footprint=None,
|
||||
labels=None,
|
||||
*,
|
||||
num_peaks_per_label=...,
|
||||
p_norm: float = ...
|
||||
) -> np.ndarray: ...
|
||||
def corner_moravec(image, window_size: int = 1) -> NDArray: ...
|
||||
def corner_orientations(image, corners, mask): ...
|
|
@ -0,0 +1,37 @@
|
|||
from numpy.typing import ArrayLike
|
||||
|
||||
from itertools import chain
|
||||
from operator import add
|
||||
|
||||
import numpy as np
|
||||
|
||||
from ..draw import rectangle
|
||||
|
||||
FEATURE_TYPE = ...
|
||||
|
||||
def _validate_feature_type(feature_type): ...
|
||||
def haar_like_feature_coord(
|
||||
width: int, height: int, feature_type: str | ArrayLike | None = None
|
||||
): ...
|
||||
def haar_like_feature(
|
||||
int_image,
|
||||
r: int,
|
||||
c: int,
|
||||
width: int,
|
||||
height: int,
|
||||
feature_type: str | ArrayLike | None = None,
|
||||
feature_coord=None,
|
||||
): ...
|
||||
def draw_haar_like_feature(
|
||||
image,
|
||||
r: int,
|
||||
c: int,
|
||||
width: int,
|
||||
height: int,
|
||||
feature_coord,
|
||||
color_positive_block: tuple[float, float, float] = ...,
|
||||
color_negative_block: tuple[float, float, float] = ...,
|
||||
alpha: float = 0.5,
|
||||
max_n_features: int | None = None,
|
||||
random_state=None,
|
||||
): ...
|
|
@ -0,0 +1,12 @@
|
|||
import numpy as np
|
||||
from scipy.spatial.distance import cdist
|
||||
|
||||
def match_descriptors(
|
||||
descriptors1,
|
||||
descriptors2,
|
||||
metric=None,
|
||||
p: int = 2,
|
||||
max_distance: float = ...,
|
||||
cross_check: bool = True,
|
||||
max_ratio: float = 1.0,
|
||||
): ...
|
|
@ -0,0 +1,32 @@
|
|||
import numpy as np
|
||||
|
||||
from ..feature.util import (
|
||||
FeatureDetector,
|
||||
DescriptorExtractor,
|
||||
_mask_border_keypoints,
|
||||
_prepare_grayscale_input_2D,
|
||||
)
|
||||
|
||||
from ..feature import corner_fast, corner_orientations, corner_peaks, corner_harris
|
||||
from ..transform import pyramid_gaussian
|
||||
from .._shared.utils import check_nD
|
||||
|
||||
OFAST_MASK = ...
|
||||
OFAST_UMAX: list = ...
|
||||
|
||||
class ORB(FeatureDetector, DescriptorExtractor):
|
||||
def __init__(
|
||||
self,
|
||||
downscale: float = 1.2,
|
||||
n_scales: int = 8,
|
||||
n_keypoints: int = 500,
|
||||
fast_n: int = 9,
|
||||
fast_threshold: float = 0.08,
|
||||
harris_k: float = 0.04,
|
||||
): ...
|
||||
def _build_pyramid(self, image): ...
|
||||
def _detect_octave(self, octave_image): ...
|
||||
def detect(self, image): ...
|
||||
def _extract_octave(self, octave_image, keypoints, orientations): ...
|
||||
def extract(self, image, keypoints, scales, orientations): ...
|
||||
def detect_and_extract(self, image): ...
|
|
@ -0,0 +1,31 @@
|
|||
from numpy import ndarray
|
||||
from numpy.typing import NDArray
|
||||
from warnings import warn
|
||||
import numpy as np
|
||||
import scipy.ndimage as ndi
|
||||
from .. import measure
|
||||
from .._shared.utils import remove_arg
|
||||
from .._shared.coord import ensure_spacing
|
||||
|
||||
def _get_high_intensity_peaks(image, mask, num_peaks, min_distance, p_norm): ...
|
||||
def _get_peak_mask(image, footprint, threshold, mask=None): ...
|
||||
def _exclude_border(label, border_width): ...
|
||||
def _get_threshold(image, threshold_abs, threshold_rel): ...
|
||||
def _get_excluded_border_width(image, min_distance, exclude_border): ...
|
||||
@remove_arg("indices", changed_version="0.20")
|
||||
def peak_local_max(
|
||||
image: NDArray,
|
||||
min_distance: int = 1,
|
||||
threshold_abs: float | None = None,
|
||||
threshold_rel: float | None = None,
|
||||
exclude_border=True,
|
||||
indices: bool = True,
|
||||
num_peaks: int = ...,
|
||||
footprint: NDArray | None = None,
|
||||
labels: NDArray | None = None,
|
||||
num_peaks_per_label: int = ...,
|
||||
p_norm: float = ...,
|
||||
) -> np.ndarray: ...
|
||||
def _prominent_peaks(
|
||||
image, min_xdistance=1, min_ydistance=1, threshold=None, num_peaks=np.inf
|
||||
): ...
|
|
@ -0,0 +1,48 @@
|
|||
import math
|
||||
|
||||
import numpy as np
|
||||
import scipy.ndimage as ndi
|
||||
|
||||
from .._shared.utils import check_nD, _supported_float_type
|
||||
from ..feature.util import DescriptorExtractor, FeatureDetector
|
||||
from .._shared.filters import gaussian
|
||||
from ..transform import rescale
|
||||
|
||||
def _edgeness(hxx, hyy, hxy): ...
|
||||
def _sparse_gradient(vol, positions): ...
|
||||
def _hessian(d, positions): ...
|
||||
def _offsets(grad, hess): ...
|
||||
|
||||
class SIFT(FeatureDetector, DescriptorExtractor):
|
||||
def __init__(
|
||||
self,
|
||||
upsampling: int = 2,
|
||||
n_octaves: int = 8,
|
||||
n_scales: int = 3,
|
||||
sigma_min: float = 1.6,
|
||||
sigma_in: float = 0.5,
|
||||
c_dog: float = ...,
|
||||
c_edge: float = 10,
|
||||
n_bins: int = 36,
|
||||
lambda_ori: float = 1.5,
|
||||
c_max: float = 0.8,
|
||||
lambda_descr: float = 6,
|
||||
n_hist: int = 4,
|
||||
n_ori: int = 8,
|
||||
): ...
|
||||
@property
|
||||
def deltas(self): ...
|
||||
def _set_number_of_octaves(self, image_shape): ...
|
||||
def _create_scalespace(self, image): ...
|
||||
def _inrange(self, a, dim): ...
|
||||
def _find_localize_evaluate(self, dogspace, img_shape): ...
|
||||
def _fit(self, h): ...
|
||||
def _compute_orientation(
|
||||
self, positions_oct, scales_oct, sigmas_oct, octaves, gaussian_scalespace
|
||||
): ...
|
||||
def _rotate(self, row, col, angle): ...
|
||||
def _compute_descriptor(self, gradient_space): ...
|
||||
def _preprocess(self, image): ...
|
||||
def detect(self, image): ...
|
||||
def extract(self, image): ...
|
||||
def detect_and_extract(self, image): ...
|
|
@ -0,0 +1,11 @@
|
|||
from numpy.typing import ArrayLike
|
||||
import numpy as np
|
||||
from scipy.signal import fftconvolve
|
||||
|
||||
from .._shared.utils import check_nD, _supported_float_type
|
||||
|
||||
def _window_sum_2d(image, window_shape): ...
|
||||
def _window_sum_3d(image, window_shape): ...
|
||||
def match_template(
|
||||
image, template, pad_input: bool = False, mode="constant", constant_values=0
|
||||
) -> ArrayLike: ...
|
|
@ -0,0 +1,40 @@
|
|||
from numpy import ndarray
|
||||
from numpy.typing import NDArray
|
||||
from typing import Literal
|
||||
|
||||
import numpy as np
|
||||
|
||||
from .._shared.utils import check_nD
|
||||
|
||||
def graycomatrix(
|
||||
image,
|
||||
distances,
|
||||
angles,
|
||||
levels: int | None = None,
|
||||
symmetric: bool = False,
|
||||
normed: bool = False,
|
||||
): ...
|
||||
def graycoprops(
|
||||
P: NDArray,
|
||||
prop: Literal[
|
||||
"contrast", "dissimilarity", "homogeneity", "energy", "correlation", "ASM"
|
||||
] = "contrast",
|
||||
): ...
|
||||
def local_binary_pattern(
|
||||
image,
|
||||
P: int,
|
||||
R: float,
|
||||
method: Literal["default", "ror", "uniform", "var"] = "default",
|
||||
): ...
|
||||
def multiblock_lbp(int_image, r: int, c: int, width: int, height: int) -> int: ...
|
||||
def draw_multiblock_lbp(
|
||||
image,
|
||||
r: int,
|
||||
c: int,
|
||||
width: int,
|
||||
height: int,
|
||||
lbp_code: int = 0,
|
||||
color_greater_block: tuple[float, float, float] = ...,
|
||||
color_less_block=...,
|
||||
alpha: float = 0.5,
|
||||
) -> np.ndarray: ...
|
|
@ -0,0 +1,28 @@
|
|||
from typing import Literal
|
||||
import numpy as np
|
||||
|
||||
from .._shared.utils import _supported_float_type, check_nD
|
||||
|
||||
class FeatureDetector(object):
|
||||
def __init__(self): ...
|
||||
def detect(self, image): ...
|
||||
|
||||
class DescriptorExtractor(object):
|
||||
def __init__(self): ...
|
||||
def extract(self, image, keypoints): ...
|
||||
|
||||
def plot_matches(
|
||||
ax,
|
||||
image1,
|
||||
image2,
|
||||
keypoints1,
|
||||
keypoints2,
|
||||
matches,
|
||||
keypoints_color="k",
|
||||
matches_color=None,
|
||||
only_matches: bool = False,
|
||||
alignment: Literal["horizontal", "vertical"] = "horizontal",
|
||||
): ...
|
||||
def _prepare_grayscale_input_2D(image): ...
|
||||
def _prepare_grayscale_input_nD(image): ...
|
||||
def _mask_border_keypoints(image_shape, keypoints, distance): ...
|
|
@ -0,0 +1,19 @@
|
|||
from . import graph as graph
|
||||
from .manual_segmentation import (
|
||||
manual_polygon_segmentation as manual_polygon_segmentation,
|
||||
)
|
||||
from .manual_segmentation import manual_lasso_segmentation as manual_lasso_segmentation
|
||||
from .trainable_segmentation import (
|
||||
fit_segmenter as fit_segmenter,
|
||||
predict_segmenter as predict_segmenter,
|
||||
TrainableSegmenter as TrainableSegmenter,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"graph",
|
||||
"manual_lasso_segmentation",
|
||||
"manual_polygon_segmentation",
|
||||
"fit_segmenter",
|
||||
"predict_segmenter",
|
||||
"TrainableSegmenter",
|
||||
]
|
|
@ -0,0 +1,21 @@
|
|||
from .graph_cut import cut_threshold as cut_threshold, cut_normalized as cut_normalized
|
||||
from .rag import (
|
||||
rag_mean_color as rag_mean_color,
|
||||
RAG as RAG,
|
||||
show_rag as show_rag,
|
||||
rag_boundary as rag_boundary,
|
||||
)
|
||||
from .graph_merge import merge_hierarchical as merge_hierarchical
|
||||
|
||||
ncut = ...
|
||||
|
||||
__all__ = [
|
||||
"rag_mean_color",
|
||||
"cut_threshold",
|
||||
"cut_normalized",
|
||||
"ncut",
|
||||
"show_rag",
|
||||
"merge_hierarchical",
|
||||
"rag_boundary",
|
||||
"RAG",
|
||||
]
|
|
@ -0,0 +1,8 @@
|
|||
from skimage.future.graph.rag import RAG
|
||||
from numpy.typing import NDArray
|
||||
import networkx as nx
|
||||
import numpy as np
|
||||
from scipy import sparse
|
||||
|
||||
def DW_matrices(graph: RAG): ...
|
||||
def ncut_cost(cut: NDArray, D, W) -> float: ...
|
|
@ -0,0 +1,27 @@
|
|||
from skimage.future.graph.rag import RAG
|
||||
from numpy.typing import NDArray, ArrayLike
|
||||
import networkx as nx
|
||||
import numpy as np
|
||||
from . import _ncut
|
||||
|
||||
from scipy.sparse import linalg
|
||||
|
||||
def cut_threshold(
|
||||
labels: NDArray, rag: RAG, thresh: float, in_place: bool = True
|
||||
) -> NDArray: ...
|
||||
def cut_normalized(
|
||||
labels: NDArray,
|
||||
rag: RAG,
|
||||
thresh: float = 0.001,
|
||||
num_cuts: int = 10,
|
||||
in_place: bool = True,
|
||||
max_edge: float = 1.0,
|
||||
*,
|
||||
random_state=None,
|
||||
) -> NDArray: ...
|
||||
def partition_by_cut(cut: ArrayLike, rag: RAG) -> RAG: ...
|
||||
def get_min_ncut(
|
||||
ev: ArrayLike, d: NDArray, w: NDArray, num_cuts: int
|
||||
) -> tuple[ArrayLike, float]: ...
|
||||
def _label_all(rag, attr_name): ...
|
||||
def _ncut_relabel(rag, thresh, num_cuts, random_state): ...
|
|
@ -0,0 +1,18 @@
|
|||
from skimage.future.graph.rag import RAG
|
||||
from numpy.typing import NDArray
|
||||
from typing import Callable
|
||||
import numpy as np
|
||||
import heapq
|
||||
|
||||
def _revalidate_node_edges(rag, node, heap_list): ...
|
||||
def _rename_node(graph, node_id, copy_id): ...
|
||||
def _invalidate_edge(graph, n1, n2): ...
|
||||
def merge_hierarchical(
|
||||
labels: NDArray,
|
||||
rag: RAG,
|
||||
thresh: float,
|
||||
rag_copy: bool,
|
||||
in_place_merge: bool,
|
||||
merge_func: Callable,
|
||||
weight_func: Callable,
|
||||
) -> NDArray: ...
|
|
@ -0,0 +1,53 @@
|
|||
from skimage.future.graph.rag import RAG
|
||||
from typing import Mapping, Callable, Sequence, Literal
|
||||
import networkx as nx
|
||||
import numpy as np
|
||||
from numpy.lib.stride_tricks import as_strided
|
||||
from scipy import ndimage as ndi
|
||||
from scipy import sparse
|
||||
import math
|
||||
|
||||
from ..._shared.version_requirements import require
|
||||
|
||||
def _edge_generator_from_csr(csr_matrix): ...
|
||||
def min_weight(graph: RAG, src: int, dst: int, n: int) -> Mapping: ...
|
||||
def _add_edge_filter(values, graph): ...
|
||||
|
||||
class RAG(nx.Graph):
|
||||
def __init__(self, label_image=None, connectivity=1, data=None, **attr): ...
|
||||
def merge_nodes(
|
||||
self,
|
||||
src: int,
|
||||
dst: int,
|
||||
weight_func: Callable = ...,
|
||||
in_place: bool = True,
|
||||
extra_arguments: Sequence = [],
|
||||
extra_keywords: Mapping = {},
|
||||
) -> int: ...
|
||||
def add_node(self, n, attr_dict=None, **attr): ...
|
||||
def add_edge(self, u, v, attr_dict=None, **attr): ...
|
||||
def copy(self): ...
|
||||
def fresh_copy(self): ...
|
||||
def next_id(self) -> int: ...
|
||||
def _add_node_silent(self, n): ...
|
||||
|
||||
def rag_mean_color(
|
||||
image,
|
||||
labels,
|
||||
connectivity: int = 2,
|
||||
mode: Literal["distance", "similarity"] = "distance",
|
||||
sigma: float = 255.0,
|
||||
) -> RAG: ...
|
||||
def rag_boundary(labels, edge_map, connectivity=2): ...
|
||||
@require("matplotlib", ">=3.0.3")
|
||||
def show_rag(
|
||||
labels,
|
||||
rag: RAG,
|
||||
image,
|
||||
border_color="black",
|
||||
edge_width: float = 1.5,
|
||||
edge_cmap="magma",
|
||||
img_cmap="bone",
|
||||
in_place: bool = True,
|
||||
ax=None,
|
||||
): ...
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os.path
|
||||
|
||||
base_path = ...
|
||||
|
||||
def configuration(parent_package="", top_path=None): ...
|
|
@ -0,0 +1,17 @@
|
|||
from functools import reduce
|
||||
import numpy as np
|
||||
from ..draw import polygon
|
||||
from .._shared.version_requirements import require
|
||||
|
||||
LEFT_CLICK: int = ...
|
||||
RIGHT_CLICK: int = ...
|
||||
|
||||
def _mask_from_vertices(vertices, shape, label): ...
|
||||
@require("matplotlib", ">=3.0.3")
|
||||
def _draw_polygon(ax, vertices, alpha=0.4): ...
|
||||
@require("matplotlib", ">=3.0.3")
|
||||
def manual_polygon_segmentation(
|
||||
image, alpha: float = 0.4, return_all: bool = False
|
||||
): ...
|
||||
@require("matplotlib", ">=3.0.3")
|
||||
def manual_lasso_segmentation(image, alpha: float = 0.4, return_all: bool = False): ...
|
|
@ -0,0 +1 @@
|
|||
def configuration(parent_package="skimage", top_path=None): ...
|
|
@ -0,0 +1,11 @@
|
|||
from numpy.typing import NDArray
|
||||
from skimage.feature import multiscale_basic_features
|
||||
|
||||
class TrainableSegmenter(object):
|
||||
def __init__(self, clf=None, features_func=None): ...
|
||||
def compute_features(self, image): ...
|
||||
def fit(self, image: NDArray, labels: NDArray): ...
|
||||
def predict(self, image: NDArray): ...
|
||||
|
||||
def fit_segmenter(labels: NDArray, features: NDArray, clf): ...
|
||||
def predict_segmenter(features: NDArray, clf) -> NDArray: ...
|
|
@ -0,0 +1,72 @@
|
|||
from ._find_contours import find_contours as find_contours
|
||||
from ._marching_cubes_lewiner import marching_cubes as marching_cubes
|
||||
from ._marching_cubes_classic import mesh_surface_area as mesh_surface_area
|
||||
from ._regionprops import (
|
||||
regionprops as regionprops,
|
||||
perimeter as perimeter,
|
||||
perimeter_crofton as perimeter_crofton,
|
||||
euler_number as euler_number,
|
||||
regionprops_table as regionprops_table,
|
||||
)
|
||||
from ._polygon import (
|
||||
approximate_polygon as approximate_polygon,
|
||||
subdivide_polygon as subdivide_polygon,
|
||||
)
|
||||
from .pnpoly import (
|
||||
points_in_poly as points_in_poly,
|
||||
grid_points_in_poly as grid_points_in_poly,
|
||||
)
|
||||
from ._moments import (
|
||||
moments as moments,
|
||||
moments_central as moments_central,
|
||||
moments_coords as moments_coords,
|
||||
moments_coords_central as moments_coords_central,
|
||||
moments_normalized as moments_normalized,
|
||||
centroid as centroid,
|
||||
moments_hu as moments_hu,
|
||||
inertia_tensor as inertia_tensor,
|
||||
inertia_tensor_eigvals as inertia_tensor_eigvals,
|
||||
)
|
||||
from .profile import profile_line as profile_line
|
||||
from .fit import (
|
||||
LineModelND as LineModelND,
|
||||
CircleModel as CircleModel,
|
||||
EllipseModel as EllipseModel,
|
||||
ransac as ransac,
|
||||
)
|
||||
from .block import block_reduce as block_reduce
|
||||
from ._label import label as label
|
||||
from .entropy import shannon_entropy as shannon_entropy
|
||||
from ._blur_effect import blur_effect as blur_effect
|
||||
|
||||
__all__ = [
|
||||
"find_contours",
|
||||
"regionprops",
|
||||
"regionprops_table",
|
||||
"perimeter",
|
||||
"perimeter_crofton",
|
||||
"euler_number",
|
||||
"approximate_polygon",
|
||||
"subdivide_polygon",
|
||||
"LineModelND",
|
||||
"CircleModel",
|
||||
"EllipseModel",
|
||||
"ransac",
|
||||
"block_reduce",
|
||||
"moments",
|
||||
"moments_central",
|
||||
"moments_coords",
|
||||
"moments_coords_central",
|
||||
"moments_normalized",
|
||||
"moments_hu",
|
||||
"inertia_tensor",
|
||||
"inertia_tensor_eigvals",
|
||||
"marching_cubes",
|
||||
"mesh_surface_area",
|
||||
"profile_line",
|
||||
"label",
|
||||
"points_in_poly",
|
||||
"grid_points_in_poly",
|
||||
"shannon_entropy",
|
||||
"blur_effect",
|
||||
]
|
|
@ -0,0 +1,13 @@
|
|||
from numpy.typing import NDArray
|
||||
from typing import Callable
|
||||
import numpy as np
|
||||
import scipy.ndimage as ndi
|
||||
|
||||
__all__ = ["blur_effect"]
|
||||
|
||||
def blur_effect(
|
||||
image: NDArray,
|
||||
h_size: int = 11,
|
||||
channel_axis: int | None = None,
|
||||
reduce_func: Callable = ...,
|
||||
): ...
|
|
@ -0,0 +1,17 @@
|
|||
import numpy as np
|
||||
from skimage._shared.utils import deprecate_kwarg
|
||||
|
||||
from collections import deque
|
||||
|
||||
_param_options = ...
|
||||
|
||||
@deprecate_kwarg({"array": "image"}, deprecated_version="0.18", removed_version="0.20")
|
||||
def find_contours(
|
||||
image,
|
||||
level: float | None = None,
|
||||
fully_connected="low",
|
||||
positive_orientation="low",
|
||||
*,
|
||||
mask=None
|
||||
): ...
|
||||
def _assemble_contours(segments): ...
|
|
@ -0,0 +1,14 @@
|
|||
from scipy import ndimage
|
||||
|
||||
from .._shared.utils import deprecate_kwarg
|
||||
|
||||
def _label_bool(image, background=None, return_num=False, connectivity=None): ...
|
||||
@deprecate_kwarg(
|
||||
{"input": "label_image"}, deprecated_version="0.19", removed_version="1.0"
|
||||
)
|
||||
def label(
|
||||
label_image,
|
||||
background: int | None = None,
|
||||
return_num: bool = False,
|
||||
connectivity: int | None = None,
|
||||
): ...
|
|
@ -0,0 +1,8 @@
|
|||
import numpy as np
|
||||
import scipy.ndimage as ndi
|
||||
|
||||
def _marching_cubes_classic(volume, level, spacing, gradient_direction): ...
|
||||
def mesh_surface_area(verts, faces) -> float: ...
|
||||
def _correct_mesh_orientation(
|
||||
volume, actual_verts, faces, spacing=(1.0, 1.0, 1.0), gradient_direction="descent"
|
||||
): ...
|
|
@ -0,0 +1,41 @@
|
|||
import base64
|
||||
|
||||
import numpy as np
|
||||
|
||||
from . import _marching_cubes_lewiner_luts as mcluts
|
||||
from ._marching_cubes_classic import _marching_cubes_classic
|
||||
|
||||
def marching_cubes(
|
||||
volume,
|
||||
level: float | None = None,
|
||||
*,
|
||||
spacing=...,
|
||||
gradient_direction: str = "descent",
|
||||
step_size: int = 1,
|
||||
allow_degenerate: bool = True,
|
||||
method: str = "lewiner",
|
||||
mask=None
|
||||
): ...
|
||||
def _marching_cubes_lewiner(
|
||||
volume,
|
||||
level,
|
||||
spacing,
|
||||
gradient_direction,
|
||||
step_size,
|
||||
allow_degenerate,
|
||||
use_classic,
|
||||
mask,
|
||||
): ...
|
||||
def _to_array(args): ...
|
||||
|
||||
# Map an edge-index to two relative pixel positions. The ege index
|
||||
# represents a point that lies somewhere in between these pixels.
|
||||
# Linear interpolation should be used to determine where it is exactly.
|
||||
# 0
|
||||
# 3 1 -> 0x
|
||||
# 2 xx
|
||||
EDGETORELATIVEPOSX = ...
|
||||
EDGETORELATIVEPOSY = ...
|
||||
EDGETORELATIVEPOSZ = ...
|
||||
|
||||
def _get_mc_luts(): ...
|
|
@ -0,0 +1,147 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# This file was auto-generated from `mc_meta/LookUpTable.h` by
|
||||
# `mc_meta/createluts.py`.
|
||||
|
||||
# static const char casesClassic[256][16]
|
||||
CASESCLASSIC = ...
|
||||
|
||||
# static const char cases[256][2]
|
||||
CASES = ...
|
||||
|
||||
# static const char tiling1[16][3]
|
||||
TILING1 = ...
|
||||
|
||||
# static const char tiling2[24][6]
|
||||
TILING2 = ...
|
||||
|
||||
# static const char tiling3_1[24][6]
|
||||
TILING3_1 = ...
|
||||
|
||||
# static const char tiling3_2[24][12]
|
||||
TILING3_2 = ...
|
||||
|
||||
# static const char tiling4_1[8][6]
|
||||
TILING4_1 = ...
|
||||
|
||||
# static const char tiling4_2[8][18]
|
||||
TILING4_2 = ...
|
||||
|
||||
# static const char tiling5[48][9]
|
||||
TILING5 = ...
|
||||
|
||||
# static const char tiling6_1_1[48][9]
|
||||
TILING6_1_1 = ...
|
||||
|
||||
# static const char tiling6_1_2[48][27]
|
||||
TILING6_1_2 = ...
|
||||
|
||||
# static const char tiling6_2[48][15]
|
||||
TILING6_2 = ...
|
||||
|
||||
# static const char tiling7_1[16][9]
|
||||
TILING7_1 = ...
|
||||
|
||||
# static const char tiling7_2[16][3][15]
|
||||
TILING7_2 = ...
|
||||
|
||||
# static const char tiling7_3[16][3][27]
|
||||
TILING7_3 = ...
|
||||
|
||||
# static const char tiling7_4_1[16][15]
|
||||
TILING7_4_1 = ...
|
||||
|
||||
# static const char tiling7_4_2[16][27]
|
||||
TILING7_4_2 = ...
|
||||
|
||||
# static const char tiling8[6][6]
|
||||
TILING8 = ...
|
||||
|
||||
# static const char tiling9[8][12]
|
||||
TILING9 = ...
|
||||
|
||||
# static const char tiling10_1_1[6][12]
|
||||
TILING10_1_1 = ...
|
||||
|
||||
# static const char tiling10_1_1_[6][12]
|
||||
TILING10_1_1_ = ...
|
||||
|
||||
# static const char tiling10_1_2[6][24]
|
||||
TILING10_1_2 = ...
|
||||
|
||||
# static const char tiling10_2[6][24]
|
||||
TILING10_2 = ...
|
||||
|
||||
# static const char tiling10_2_[6][24]
|
||||
TILING10_2_ = ...
|
||||
|
||||
# static const char tiling11[12][12]
|
||||
TILING11 = ...
|
||||
|
||||
# static const char tiling12_1_1[24][12]
|
||||
TILING12_1_1 = ...
|
||||
|
||||
# static const char tiling12_1_1_[24][12]
|
||||
TILING12_1_1_ = ...
|
||||
|
||||
# static const char tiling12_1_2[24][24]
|
||||
TILING12_1_2 = ...
|
||||
|
||||
# static const char tiling12_2[24][24]
|
||||
TILING12_2 = ...
|
||||
|
||||
# static const char tiling12_2_[24][24]
|
||||
TILING12_2_ = ...
|
||||
|
||||
# static const char tiling13_1[2][12]
|
||||
TILING13_1 = ...
|
||||
|
||||
# static const char tiling13_1_[2][12]
|
||||
TILING13_1_ = ...
|
||||
|
||||
# static const char tiling13_2[2][6][18]
|
||||
TILING13_2 = ...
|
||||
|
||||
# static const char tiling13_2_[2][6][18]
|
||||
TILING13_2_ = ...
|
||||
|
||||
# static const char tiling13_3[2][12][30]
|
||||
TILING13_3 = ...
|
||||
|
||||
# static const char tiling13_3_[2][12][30]
|
||||
TILING13_3_ = ...
|
||||
|
||||
# static const char tiling13_4[2][4][36]
|
||||
TILING13_4 = ...
|
||||
|
||||
# static const char tiling13_5_1[2][4][18]
|
||||
TILING13_5_1 = ...
|
||||
|
||||
# static const char tiling13_5_2[2][4][30]
|
||||
TILING13_5_2 = ...
|
||||
|
||||
# static const char tiling14[12][12]
|
||||
TILING14 = ...
|
||||
|
||||
# static const char test3[24]
|
||||
TEST3 = ...
|
||||
|
||||
# static const char test4[8]
|
||||
TEST4 = ...
|
||||
|
||||
# static const char test6[48][3]
|
||||
TEST6 = ...
|
||||
|
||||
# static const char test7[16][5]
|
||||
TEST7 = ...
|
||||
|
||||
# static const char test10[6][3]
|
||||
TEST10 = ...
|
||||
|
||||
# static const char test12[24][4]
|
||||
TEST12 = ...
|
||||
|
||||
# static const char test13[2][7]
|
||||
TEST13 = ...
|
||||
|
||||
# static const char subconfig13[64]
|
||||
SUBCONFIG13 = ...
|
|
@ -0,0 +1,18 @@
|
|||
from numpy.typing import ArrayLike
|
||||
import numpy as np
|
||||
from .._shared.utils import _supported_float_type, check_nD
|
||||
import itertools
|
||||
|
||||
def moments_coords(coords, order: int = 3): ...
|
||||
def moments_coords_central(
|
||||
coords, center: tuple[float, ...] | None = None, order: int = 3
|
||||
): ...
|
||||
def moments(image, order: int = 3): ...
|
||||
def moments_central(
|
||||
image, center: tuple[float, ...] | None = None, order: int = 3, **kwargs
|
||||
): ...
|
||||
def moments_normalized(mu, order: int = 3): ...
|
||||
def moments_hu(nu): ...
|
||||
def centroid(image: ArrayLike): ...
|
||||
def inertia_tensor(image: ArrayLike, mu: ArrayLike | None = None): ...
|
||||
def inertia_tensor_eigvals(image: ArrayLike, mu: ArrayLike | None = None, T=None): ...
|
|
@ -0,0 +1,9 @@
|
|||
import numpy as np
|
||||
from scipy import signal
|
||||
|
||||
def approximate_polygon(coords, tolerance: float): ...
|
||||
|
||||
# B-Spline subdivision
|
||||
_SUBDIVISION_MASKS: dict = ...
|
||||
|
||||
def subdivide_polygon(coords, degree=2, preserve_ends: bool = False): ...
|
|
@ -0,0 +1,176 @@
|
|||
from skimage.measure._regionprops import RegionProperties
|
||||
from numpy.typing import ArrayLike
|
||||
from typing import Mapping
|
||||
import inspect
|
||||
from functools import wraps
|
||||
from math import atan2
|
||||
from math import pi as PI
|
||||
from math import sqrt
|
||||
from warnings import warn
|
||||
|
||||
import numpy as np
|
||||
from scipy import ndimage as ndi
|
||||
from scipy.spatial.distance import pdist
|
||||
|
||||
from . import _moments
|
||||
from ._find_contours import find_contours
|
||||
from ._marching_cubes_lewiner import marching_cubes
|
||||
from ._regionprops_utils import euler_number, perimeter, perimeter_crofton
|
||||
|
||||
__all__ = ["regionprops", "euler_number", "perimeter", "perimeter_crofton"]
|
||||
|
||||
# All values in this PROPS dict correspond to current scikit-image property
|
||||
# names. The keys in this PROPS dict correspond to older names used in prior
|
||||
# releases. For backwards compatibility, these older names will continue to
|
||||
# work, but will not be documented.
|
||||
PROPS: dict = ...
|
||||
|
||||
OBJECT_COLUMNS: set = ...
|
||||
|
||||
COL_DTYPES: dict = ...
|
||||
|
||||
PROP_VALS = ...
|
||||
|
||||
def _infer_number_of_required_args(func): ...
|
||||
def _infer_regionprop_dtype(func, *, intensity, ndim): ...
|
||||
def _cached(f): ...
|
||||
def only2d(method): ...
|
||||
def _inertia_eigvals_to_axes_lengths_3D(inertia_tensor_eigvals): ...
|
||||
|
||||
class RegionProperties:
|
||||
def __init__(
|
||||
self,
|
||||
slice,
|
||||
label,
|
||||
label_image,
|
||||
intensity_image,
|
||||
cache_active,
|
||||
*,
|
||||
extra_properties=None
|
||||
): ...
|
||||
def __getattr__(self, attr): ...
|
||||
def __setattr__(self, name, value): ...
|
||||
@property
|
||||
@_cached
|
||||
def area(self): ...
|
||||
@property
|
||||
def bbox(self): ...
|
||||
@property
|
||||
def area_bbox(self): ...
|
||||
@property
|
||||
def centroid(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def area_convex(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def image_convex(self): ...
|
||||
@property
|
||||
def coords(self): ...
|
||||
@property
|
||||
@only2d
|
||||
def eccentricity(self): ...
|
||||
@property
|
||||
def equivalent_diameter_area(self): ...
|
||||
@property
|
||||
def euler_number(self): ...
|
||||
@property
|
||||
def extent(self): ...
|
||||
@property
|
||||
def feret_diameter_max(self): ...
|
||||
@property
|
||||
def area_filled(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def image_filled(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def image(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def inertia_tensor(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def inertia_tensor_eigvals(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def image_intensity(self): ...
|
||||
def _image_intensity_double(self): ...
|
||||
@property
|
||||
def centroid_local(self): ...
|
||||
@property
|
||||
def intensity_max(self): ...
|
||||
@property
|
||||
def intensity_mean(self): ...
|
||||
@property
|
||||
def intensity_min(self): ...
|
||||
@property
|
||||
def axis_major_length(self): ...
|
||||
@property
|
||||
def axis_minor_length(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def moments(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def moments_central(self): ...
|
||||
@property
|
||||
@only2d
|
||||
def moments_hu(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def moments_normalized(self): ...
|
||||
@property
|
||||
@only2d
|
||||
def orientation(self): ...
|
||||
@property
|
||||
@only2d
|
||||
def perimeter(self): ...
|
||||
@property
|
||||
@only2d
|
||||
def perimeter_crofton(self): ...
|
||||
@property
|
||||
def solidity(self): ...
|
||||
@property
|
||||
def centroid_weighted(self): ...
|
||||
@property
|
||||
def centroid_weighted_local(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def moments_weighted(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def moments_weighted_central(self): ...
|
||||
@property
|
||||
@only2d
|
||||
def moments_weighted_hu(self): ...
|
||||
@property
|
||||
@_cached
|
||||
def moments_weighted_normalized(self): ...
|
||||
def __iter__(self): ...
|
||||
def __getitem__(self, key): ...
|
||||
def __eq__(self, other): ...
|
||||
|
||||
# For compatibility with code written prior to 0.16
|
||||
_RegionProperties = RegionProperties
|
||||
|
||||
def _props_to_dict(regions, properties=("label", "bbox"), separator="-"): ...
|
||||
def regionprops_table(
|
||||
label_image,
|
||||
intensity_image=None,
|
||||
properties: tuple | ArrayLike = ...,
|
||||
*,
|
||||
cache: bool = True,
|
||||
separator: str = "-",
|
||||
extra_properties=None
|
||||
) -> Mapping: ...
|
||||
def regionprops(
|
||||
label_image,
|
||||
intensity_image=None,
|
||||
cache: bool = True,
|
||||
coordinates=None,
|
||||
*,
|
||||
extra_properties=None
|
||||
) -> list[RegionProperties]: ...
|
||||
def _parse_docs(): ...
|
||||
def _install_properties_docs(): ...
|
|
@ -0,0 +1,24 @@
|
|||
from math import sqrt
|
||||
import numpy as np
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
STREL_4 = ...
|
||||
STREL_8 = ...
|
||||
|
||||
# Coefficients from
|
||||
# Ohser J., Nagel W., Schladitz K. (2002) The Euler Number of Discretized Sets
|
||||
# - On the Choice of Adjacency in Homogeneous Lattices.
|
||||
# In: Mecke K., Stoyan D. (eds) Morphology of Condensed Matter. Lecture Notes
|
||||
# in Physics, vol 600. Springer, Berlin, Heidelberg.
|
||||
# The value of coefficients correspond to the contributions to the Euler number
|
||||
# of specific voxel configurations, which are themselves encoded thanks to a
|
||||
# LUT. Computing the Euler number from the addition of the contributions of
|
||||
# local configurations is possible thanks to an integral geometry formula
|
||||
# (see the paper by Ohser et al. for more details).
|
||||
EULER_COEFS2D_4: list = ...
|
||||
EULER_COEFS2D_8: list = ...
|
||||
EULER_COEFS3D_26 = ...
|
||||
|
||||
def euler_number(image, connectivity: int | None = None) -> int: ...
|
||||
def perimeter(image, neighbourhood=4) -> float: ...
|
||||
def perimeter_crofton(image, directions=4) -> float: ...
|
|
@ -0,0 +1,11 @@
|
|||
from numpy.typing import NDArray
|
||||
from typing import Callable, Mapping
|
||||
import numpy as np
|
||||
|
||||
def block_reduce(
|
||||
image: NDArray,
|
||||
block_size=2,
|
||||
func: Callable = ...,
|
||||
cval: float = 0,
|
||||
func_kwargs: Mapping | None = None,
|
||||
) -> NDArray: ...
|
|
@ -0,0 +1,4 @@
|
|||
from numpy import unique
|
||||
from scipy.stats import entropy as scipy_entropy
|
||||
|
||||
def shannon_entropy(image, base: float = 2) -> float: ...
|
|
@ -0,0 +1,47 @@
|
|||
from numpy.typing import ArrayLike
|
||||
from typing import Any
|
||||
import math
|
||||
from warnings import warn
|
||||
|
||||
import numpy as np
|
||||
from numpy.linalg import inv
|
||||
from scipy import optimize, spatial
|
||||
|
||||
def _check_data_dim(data, dim): ...
|
||||
def _check_data_atleast_2D(data): ...
|
||||
|
||||
class BaseModel(object):
|
||||
def __init__(self): ...
|
||||
|
||||
class LineModelND(BaseModel):
|
||||
def estimate(self, data) -> bool: ...
|
||||
def residuals(self, data, params=None): ...
|
||||
def predict(self, x, axis: int = 0, params=None): ...
|
||||
def predict_x(self, y: ArrayLike, params=None) -> ArrayLike: ...
|
||||
def predict_y(self, x: ArrayLike, params=None) -> ArrayLike: ...
|
||||
|
||||
class CircleModel(BaseModel):
|
||||
def estimate(self, data) -> bool: ...
|
||||
def residuals(self, data): ...
|
||||
def predict_xy(self, t: ArrayLike, params=None): ...
|
||||
|
||||
class EllipseModel(BaseModel):
|
||||
def estimate(self, data) -> bool: ...
|
||||
def residuals(self, data): ...
|
||||
def predict_xy(self, t: ArrayLike, params=None): ...
|
||||
|
||||
def _dynamic_max_trials(n_inliers, n_samples, min_samples, probability): ...
|
||||
def ransac(
|
||||
data,
|
||||
model_class: Any,
|
||||
min_samples,
|
||||
residual_threshold,
|
||||
is_data_valid=None,
|
||||
is_model_valid=None,
|
||||
max_trials: int = 100,
|
||||
stop_sample_num: int = ...,
|
||||
stop_residuals_sum: float = 0,
|
||||
stop_probability=1,
|
||||
random_state=None,
|
||||
initial_inliers=None,
|
||||
): ...
|
|
@ -0,0 +1,2 @@
|
|||
def grid_points_in_poly(shape, verts): ...
|
||||
def points_in_poly(points, verts): ...
|
|
@ -0,0 +1,19 @@
|
|||
from numpy.typing import ArrayLike
|
||||
from typing import Literal, Callable
|
||||
import numpy as np
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
from .._shared.utils import _validate_interpolation_order, _fix_ndimage_mode
|
||||
|
||||
def profile_line(
|
||||
image,
|
||||
src,
|
||||
dst,
|
||||
linewidth: int = 1,
|
||||
order=None,
|
||||
mode: Literal["constant", "nearest", "reflect", "mirror", "wrap"] = "reflect",
|
||||
cval: float = 0.0,
|
||||
*,
|
||||
reduce_func: Callable = ...
|
||||
) -> ArrayLike: ...
|
||||
def _line_profile_coordinates(src, dst, linewidth=1): ...
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
base_path = ...
|
||||
|
||||
def configuration(parent_package="", top_path=None): ...
|
|
@ -0,0 +1,100 @@
|
|||
from .binary import (
|
||||
binary_erosion as binary_erosion,
|
||||
binary_dilation as binary_dilation,
|
||||
binary_opening as binary_opening,
|
||||
binary_closing as binary_closing,
|
||||
)
|
||||
from .gray import (
|
||||
erosion as erosion,
|
||||
dilation as dilation,
|
||||
opening as opening,
|
||||
closing as closing,
|
||||
white_tophat as white_tophat,
|
||||
black_tophat as black_tophat,
|
||||
)
|
||||
from .footprints import (
|
||||
square as square,
|
||||
rectangle as rectangle,
|
||||
diamond as diamond,
|
||||
disk as disk,
|
||||
cube as cube,
|
||||
octahedron as octahedron,
|
||||
ball as ball,
|
||||
octagon as octagon,
|
||||
star as star,
|
||||
)
|
||||
from ..measure._label import label as label
|
||||
from ._skeletonize import (
|
||||
skeletonize as skeletonize,
|
||||
medial_axis as medial_axis,
|
||||
thin as thin,
|
||||
skeletonize_3d as skeletonize_3d,
|
||||
)
|
||||
from .convex_hull import (
|
||||
convex_hull_image as convex_hull_image,
|
||||
convex_hull_object as convex_hull_object,
|
||||
)
|
||||
from .grayreconstruct import reconstruction as reconstruction
|
||||
from .misc import (
|
||||
remove_small_objects as remove_small_objects,
|
||||
remove_small_holes as remove_small_holes,
|
||||
)
|
||||
from .extrema import (
|
||||
h_minima as h_minima,
|
||||
h_maxima as h_maxima,
|
||||
local_maxima as local_maxima,
|
||||
local_minima as local_minima,
|
||||
)
|
||||
from ._flood_fill import flood as flood, flood_fill as flood_fill
|
||||
from .max_tree import (
|
||||
max_tree as max_tree,
|
||||
area_opening as area_opening,
|
||||
area_closing as area_closing,
|
||||
diameter_opening as diameter_opening,
|
||||
diameter_closing as diameter_closing,
|
||||
max_tree_local_maxima as max_tree_local_maxima,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"binary_erosion",
|
||||
"binary_dilation",
|
||||
"binary_opening",
|
||||
"binary_closing",
|
||||
"erosion",
|
||||
"dilation",
|
||||
"opening",
|
||||
"closing",
|
||||
"white_tophat",
|
||||
"black_tophat",
|
||||
"square",
|
||||
"rectangle",
|
||||
"diamond",
|
||||
"disk",
|
||||
"cube",
|
||||
"octahedron",
|
||||
"ball",
|
||||
"octagon",
|
||||
"star",
|
||||
"label",
|
||||
"skeletonize",
|
||||
"skeletonize_3d",
|
||||
"thin",
|
||||
"medial_axis",
|
||||
"convex_hull_image",
|
||||
"convex_hull_object",
|
||||
"reconstruction",
|
||||
"remove_small_objects",
|
||||
"remove_small_holes",
|
||||
"h_minima",
|
||||
"h_maxima",
|
||||
"local_maxima",
|
||||
"local_minima",
|
||||
"flood",
|
||||
"flood_fill",
|
||||
"max_tree",
|
||||
"area_opening",
|
||||
"area_closing",
|
||||
"diameter_opening",
|
||||
"diameter_closing",
|
||||
"max_tree_local_maxima",
|
||||
]
|
|
@ -0,0 +1,40 @@
|
|||
from numpy.typing import NDArray
|
||||
|
||||
import numpy as np
|
||||
|
||||
from .._shared.utils import deprecate_kwarg
|
||||
|
||||
from ._util import (
|
||||
_offsets_to_raveled_neighbors,
|
||||
_resolve_neighborhood,
|
||||
_set_border_values,
|
||||
)
|
||||
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def flood_fill(
|
||||
image: NDArray,
|
||||
seed_point: tuple | int,
|
||||
new_value,
|
||||
*,
|
||||
footprint: NDArray | None = None,
|
||||
connectivity: int | None = None,
|
||||
tolerance: float | int | None = None,
|
||||
in_place: bool = False
|
||||
) -> NDArray: ...
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def flood(
|
||||
image: NDArray,
|
||||
seed_point: tuple | int,
|
||||
*,
|
||||
footprint: NDArray | None = None,
|
||||
connectivity: int | None = None,
|
||||
tolerance: float | int | None = None
|
||||
) -> NDArray: ...
|
|
@ -0,0 +1,35 @@
|
|||
from numpy.typing import NDArray
|
||||
from typing import Literal
|
||||
|
||||
import numpy as np
|
||||
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
from .._shared.utils import check_nD, deprecate_kwarg
|
||||
|
||||
def skeletonize(image, *, method: Literal["zhang", "lee"] | None = None) -> NDArray: ...
|
||||
def skeletonize_2d(image) -> NDArray: ...
|
||||
|
||||
# --------- Skeletonization and thinning based on Guo and Hall 1989 ---------
|
||||
|
||||
def _generate_thin_luts(): ...
|
||||
|
||||
G123_LUT = ...
|
||||
|
||||
G123P_LUT = ...
|
||||
|
||||
@deprecate_kwarg(
|
||||
{"max_iter": "max_num_iter"}, removed_version="1.0", deprecated_version="0.19"
|
||||
)
|
||||
def thin(image, max_num_iter=None) -> NDArray: ...
|
||||
|
||||
# --------- Skeletonization by medial axis transform --------
|
||||
|
||||
_eight_connect = ...
|
||||
|
||||
def medial_axis(
|
||||
image, mask=None, return_distance: bool = False, *, random_state=None
|
||||
) -> tuple[NDArray, NDArray]: ...
|
||||
def _pattern_of(index): ...
|
||||
def _table_lookup(image, table): ...
|
||||
def skeletonize_3d(image) -> NDArray: ...
|
|
@ -0,0 +1,16 @@
|
|||
import numpy as np
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
def _validate_connectivity(image_dim, connectivity, offset): ...
|
||||
def _raveled_offsets_and_distances(
|
||||
image_shape,
|
||||
*,
|
||||
footprint=None,
|
||||
connectivity=1,
|
||||
center=None,
|
||||
spacing=None,
|
||||
order="C",
|
||||
): ...
|
||||
def _offsets_to_raveled_neighbors(image_shape, footprint, center, order="C"): ...
|
||||
def _resolve_neighborhood(footprint, connectivity, ndim): ...
|
||||
def _set_border_values(image, value): ...
|
|
@ -0,0 +1,46 @@
|
|||
from numpy.typing import NDArray
|
||||
import numpy as np
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
from .._shared.utils import deprecate_kwarg
|
||||
from .misc import default_footprint
|
||||
|
||||
# The default_footprint decorator provides a diamond footprint as
|
||||
# default with the same dimension as the input image and size 3 along each
|
||||
# axis.
|
||||
@default_footprint
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def binary_erosion(
|
||||
image: NDArray, footprint: NDArray | None = None, out: NDArray | None = None
|
||||
): ...
|
||||
@default_footprint
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def binary_dilation(
|
||||
image: NDArray, footprint: NDArray | None = None, out: NDArray | None = None
|
||||
): ...
|
||||
@default_footprint
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def binary_opening(
|
||||
image: NDArray, footprint: NDArray | None = None, out: NDArray | None = None
|
||||
) -> NDArray: ...
|
||||
@default_footprint
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def binary_closing(
|
||||
image: NDArray, footprint: NDArray | None = None, out: NDArray | None = None
|
||||
) -> NDArray: ...
|
|
@ -0,0 +1,18 @@
|
|||
from numpy.typing import ArrayLike, NDArray
|
||||
from itertools import product
|
||||
import numpy as np
|
||||
|
||||
from ..measure.pnpoly import grid_points_in_poly
|
||||
|
||||
from ..measure._label import label
|
||||
|
||||
from .._shared.utils import warn
|
||||
|
||||
__all__ = ["convex_hull_image", "convex_hull_object"]
|
||||
|
||||
def _offsets_diamond(ndim): ...
|
||||
def _check_coords_in_hull(gridcoords, hull_equations, tolerance): ...
|
||||
def convex_hull_image(
|
||||
image: ArrayLike, offset_coordinates: bool = True, tolerance: float = 1e-10
|
||||
): ...
|
||||
def convex_hull_object(image, *, connectivity=2) -> NDArray: ...
|
|
@ -0,0 +1,46 @@
|
|||
from numpy import ndarray
|
||||
from numpy.typing import NDArray
|
||||
import numpy as np
|
||||
|
||||
from .._shared.utils import deprecate_kwarg, warn
|
||||
|
||||
from . import grayreconstruct, _util
|
||||
|
||||
def _add_constant_clip(image, const_value): ...
|
||||
def _subtract_constant_clip(image, const_value): ...
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def h_maxima(image: NDArray, h, footprint: NDArray | None = None) -> NDArray: ...
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def h_minima(image: NDArray, h, footprint: NDArray | None = None) -> NDArray: ...
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def local_maxima(
|
||||
image: NDArray,
|
||||
footprint: NDArray | None = None,
|
||||
connectivity: int | None = None,
|
||||
indices: bool = False,
|
||||
allow_borders: bool = True,
|
||||
) -> np.ndarray | tuple[np.ndarray]: ...
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def local_minima(
|
||||
image: NDArray,
|
||||
footprint: NDArray | None = None,
|
||||
connectivity: int | None = None,
|
||||
indices: bool = False,
|
||||
allow_borders: bool = True,
|
||||
) -> np.ndarray | tuple[np.ndarray]: ...
|
|
@ -0,0 +1,23 @@
|
|||
from numpy.typing import NDArray
|
||||
import numpy as np
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
from .. import draw
|
||||
from .._shared.utils import deprecate_kwarg
|
||||
|
||||
def square(width: int, dtype=...) -> NDArray: ...
|
||||
@deprecate_kwarg(
|
||||
{"height": "ncols", "width": "nrows"},
|
||||
deprecated_version="0.18.0",
|
||||
removed_version="0.20.0",
|
||||
)
|
||||
def rectangle(nrows: int, ncols: int, dtype=...) -> NDArray: ...
|
||||
def diamond(radius: int, dtype=...) -> NDArray: ...
|
||||
def disk(radius: int, dtype=...) -> NDArray: ...
|
||||
def ellipse(width: int, height: int, dtype=...) -> NDArray: ...
|
||||
def cube(width: int, dtype=...) -> NDArray: ...
|
||||
def octahedron(radius: int, dtype=...) -> NDArray: ...
|
||||
def ball(radius: int, dtype=...) -> NDArray: ...
|
||||
def octagon(m: int, n: int, dtype=...) -> NDArray: ...
|
||||
def star(a: int, dtype=...) -> NDArray: ...
|
||||
def _default_footprint(ndim): ...
|
|
@ -0,0 +1,80 @@
|
|||
from numpy.typing import NDArray
|
||||
from typing import Callable
|
||||
import functools
|
||||
|
||||
import numpy as np
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
from .._shared.utils import deprecate_kwarg
|
||||
|
||||
from .misc import default_footprint
|
||||
|
||||
__all__ = ["erosion", "dilation", "opening", "closing", "white_tophat", "black_tophat"]
|
||||
|
||||
def _shift_footprint(footprint, shift_x, shift_y): ...
|
||||
def _invert_footprint(footprint): ...
|
||||
def pad_for_eccentric_footprints(func: Callable) -> Callable: ...
|
||||
@default_footprint
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def erosion(
|
||||
image: NDArray,
|
||||
footprint: NDArray | None = None,
|
||||
out=None,
|
||||
shift_x: bool = False,
|
||||
shift_y: bool = False,
|
||||
): ...
|
||||
@default_footprint
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def dilation(
|
||||
image: NDArray,
|
||||
footprint: NDArray | None = None,
|
||||
out: NDArray | None = None,
|
||||
shift_x: bool = False,
|
||||
shift_y: bool = False,
|
||||
): ...
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
@default_footprint
|
||||
@pad_for_eccentric_footprints
|
||||
def opening(
|
||||
image: NDArray, footprint: NDArray | None = None, out: NDArray | None = None
|
||||
): ...
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
@default_footprint
|
||||
@pad_for_eccentric_footprints
|
||||
def closing(
|
||||
image: NDArray, footprint: NDArray | None = None, out: NDArray | None = None
|
||||
): ...
|
||||
@default_footprint
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def white_tophat(
|
||||
image: NDArray, footprint: NDArray | None = None, out: NDArray | None = None
|
||||
): ...
|
||||
@default_footprint
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def black_tophat(
|
||||
image: NDArray, footprint: NDArray | None = None, out: NDArray | None = None
|
||||
): ...
|
|
@ -0,0 +1,18 @@
|
|||
from numpy.typing import NDArray
|
||||
from typing import Literal
|
||||
import numpy as np
|
||||
|
||||
from .._shared.utils import deprecate_kwarg
|
||||
|
||||
@deprecate_kwarg(
|
||||
kwarg_mapping={"selem": "footprint"},
|
||||
removed_version="1.0",
|
||||
deprecated_version="0.19",
|
||||
)
|
||||
def reconstruction(
|
||||
seed: NDArray,
|
||||
mask: NDArray,
|
||||
method: Literal["erosion", "dilation"] = "dilation",
|
||||
footprint: NDArray | None = None,
|
||||
offset: NDArray | None = None,
|
||||
) -> NDArray: ...
|
|
@ -0,0 +1,5 @@
|
|||
import warnings
|
||||
|
||||
from .gray import black_tophat, closing, dilation, erosion, opening, white_tophat
|
||||
|
||||
__all__ = ["erosion", "dilation", "opening", "closing", "white_tophat", "black_tophat"]
|
|
@ -0,0 +1,3 @@
|
|||
import warnings
|
||||
|
||||
from .grayreconstruct import reconstruction
|
|
@ -0,0 +1,35 @@
|
|||
from numpy.typing import NDArray
|
||||
|
||||
import numpy as np
|
||||
|
||||
from ._util import _validate_connectivity, _offsets_to_raveled_neighbors
|
||||
|
||||
unsigned_int_types: list = ...
|
||||
signed_int_types: list = ...
|
||||
signed_float_types: list = ...
|
||||
|
||||
# building the max tree.
|
||||
def max_tree(image: NDArray, connectivity=1): ...
|
||||
def area_opening(
|
||||
image: NDArray, area_threshold=64, connectivity=1, parent=None, tree_traverser=None
|
||||
) -> NDArray: ...
|
||||
def diameter_opening(
|
||||
image: NDArray,
|
||||
diameter_threshold=8,
|
||||
connectivity=1,
|
||||
parent=None,
|
||||
tree_traverser=None,
|
||||
) -> NDArray: ...
|
||||
def area_closing(
|
||||
image: NDArray, area_threshold=64, connectivity=1, parent=None, tree_traverser=None
|
||||
) -> NDArray: ...
|
||||
def diameter_closing(
|
||||
image: NDArray,
|
||||
diameter_threshold=8,
|
||||
connectivity=1,
|
||||
parent=None,
|
||||
tree_traverser=None,
|
||||
) -> NDArray: ...
|
||||
def max_tree_local_maxima(
|
||||
image: NDArray, connectivity=1, parent=None, tree_traverser=None
|
||||
): ...
|
|
@ -0,0 +1,29 @@
|
|||
from numpy.typing import NDArray
|
||||
import numpy as np
|
||||
import functools
|
||||
from scipy import ndimage as ndi
|
||||
from .._shared.utils import warn, remove_arg
|
||||
from .footprints import _default_footprint
|
||||
|
||||
# Our function names don't exactly correspond to ndimages.
|
||||
# This dictionary translates from our names to scipy's.
|
||||
funcs = ...
|
||||
skimage2ndimage: dict = ...
|
||||
|
||||
# These function names are the same in ndimage.
|
||||
funcs = ...
|
||||
|
||||
def default_footprint(func): ...
|
||||
def _check_dtype_supported(ar): ...
|
||||
@remove_arg(
|
||||
"in_place", changed_version="1.0", help_msg="Please use out argument instead."
|
||||
)
|
||||
def remove_small_objects(
|
||||
ar, min_size=64, connectivity=1, in_place=False, *, out: NDArray | None = None
|
||||
): ...
|
||||
@remove_arg(
|
||||
"in_place", changed_version="1.0", help_msg="Please use out argument instead."
|
||||
)
|
||||
def remove_small_holes(
|
||||
ar, area_threshold=64, connectivity=1, in_place=False, *, out: NDArray | None = None
|
||||
): ...
|
|
@ -0,0 +1,13 @@
|
|||
import warnings
|
||||
|
||||
from .footprints import (
|
||||
square,
|
||||
rectangle,
|
||||
diamond,
|
||||
disk,
|
||||
cube,
|
||||
octahedron,
|
||||
ball,
|
||||
octagon,
|
||||
star,
|
||||
)
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
base_path = ...
|
||||
|
||||
def configuration(parent_package="", top_path=None): ...
|
|
@ -0,0 +1 @@
|
|||
def main(): ...
|
|
@ -0,0 +1 @@
|
|||
def configuration(parent_package="", top_path=None): ...
|
|
@ -0,0 +1,85 @@
|
|||
from .hough_transform import (
|
||||
hough_line as hough_line,
|
||||
hough_line_peaks as hough_line_peaks,
|
||||
probabilistic_hough_line as probabilistic_hough_line,
|
||||
hough_circle as hough_circle,
|
||||
hough_circle_peaks as hough_circle_peaks,
|
||||
hough_ellipse as hough_ellipse,
|
||||
)
|
||||
from .radon_transform import (
|
||||
radon as radon,
|
||||
iradon as iradon,
|
||||
iradon_sart as iradon_sart,
|
||||
order_angles_golden_ratio as order_angles_golden_ratio,
|
||||
)
|
||||
from .finite_radon_transform import frt2 as frt2, ifrt2 as ifrt2
|
||||
from .integral import integral_image as integral_image, integrate as integrate
|
||||
from ._geometric import (
|
||||
estimate_transform as estimate_transform,
|
||||
matrix_transform as matrix_transform,
|
||||
EuclideanTransform as EuclideanTransform,
|
||||
SimilarityTransform as SimilarityTransform,
|
||||
AffineTransform as AffineTransform,
|
||||
ProjectiveTransform as ProjectiveTransform,
|
||||
FundamentalMatrixTransform as FundamentalMatrixTransform,
|
||||
EssentialMatrixTransform as EssentialMatrixTransform,
|
||||
PolynomialTransform as PolynomialTransform,
|
||||
PiecewiseAffineTransform as PiecewiseAffineTransform,
|
||||
)
|
||||
from ._warps import (
|
||||
swirl as swirl,
|
||||
resize as resize,
|
||||
rotate as rotate,
|
||||
rescale as rescale,
|
||||
downscale_local_mean as downscale_local_mean,
|
||||
warp as warp,
|
||||
warp_coords as warp_coords,
|
||||
warp_polar as warp_polar,
|
||||
resize_local_mean as resize_local_mean,
|
||||
)
|
||||
from .pyramids import (
|
||||
pyramid_reduce as pyramid_reduce,
|
||||
pyramid_expand as pyramid_expand,
|
||||
pyramid_gaussian as pyramid_gaussian,
|
||||
pyramid_laplacian as pyramid_laplacian,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"hough_circle",
|
||||
"hough_ellipse",
|
||||
"hough_line",
|
||||
"probabilistic_hough_line",
|
||||
"hough_circle_peaks",
|
||||
"hough_line_peaks",
|
||||
"radon",
|
||||
"iradon",
|
||||
"iradon_sart",
|
||||
"order_angles_golden_ratio",
|
||||
"frt2",
|
||||
"ifrt2",
|
||||
"integral_image",
|
||||
"integrate",
|
||||
"warp",
|
||||
"warp_coords",
|
||||
"warp_polar",
|
||||
"estimate_transform",
|
||||
"matrix_transform",
|
||||
"EuclideanTransform",
|
||||
"SimilarityTransform",
|
||||
"AffineTransform",
|
||||
"ProjectiveTransform",
|
||||
"EssentialMatrixTransform",
|
||||
"FundamentalMatrixTransform",
|
||||
"PolynomialTransform",
|
||||
"PiecewiseAffineTransform",
|
||||
"swirl",
|
||||
"resize",
|
||||
"resize_local_mean",
|
||||
"rotate",
|
||||
"rescale",
|
||||
"downscale_local_mean",
|
||||
"pyramid_reduce",
|
||||
"pyramid_expand",
|
||||
"pyramid_gaussian",
|
||||
"pyramid_laplacian",
|
||||
]
|
|
@ -0,0 +1,117 @@
|
|||
from numpy.typing import ArrayLike
|
||||
from typing import Sequence
|
||||
import math
|
||||
import numpy as np
|
||||
from scipy import spatial
|
||||
import textwrap
|
||||
|
||||
from .._shared.utils import get_bound_method_class, safe_as_int
|
||||
|
||||
def _affine_matrix_from_vector(v): ...
|
||||
def _center_and_normalize_points(points): ...
|
||||
def _umeyama(src, dst, estimate_scale): ...
|
||||
|
||||
class GeometricTransform(object):
|
||||
def __call__(self, coords): ...
|
||||
def inverse(self, coords): ...
|
||||
def residuals(self, src, dst): ...
|
||||
def __add__(self, other): ...
|
||||
|
||||
class FundamentalMatrixTransform(GeometricTransform):
|
||||
def __init__(self, matrix=None, *, dimensionality=2): ...
|
||||
def __call__(self, coords): ...
|
||||
def inverse(self, coords): ...
|
||||
def _setup_constraint_matrix(self, src, dst): ...
|
||||
def estimate(self, src, dst) -> bool: ...
|
||||
def residuals(self, src, dst): ...
|
||||
|
||||
class EssentialMatrixTransform(FundamentalMatrixTransform):
|
||||
def __init__(
|
||||
self, rotation=None, translation=None, matrix=None, *, dimensionality=2
|
||||
): ...
|
||||
def estimate(self, src, dst) -> bool: ...
|
||||
|
||||
class ProjectiveTransform(GeometricTransform):
|
||||
def __init__(self, matrix=None, *, dimensionality: int = 2): ...
|
||||
@property
|
||||
def _inv_matrix(self): ...
|
||||
def _apply_mat(self, coords, matrix): ...
|
||||
def __array__(self, dtype=None): ...
|
||||
def __call__(self, coords): ...
|
||||
def inverse(self, coords): ...
|
||||
def estimate(self, src, dst, weights=None) -> bool: ...
|
||||
def __add__(self, other): ...
|
||||
def __nice__(self): ...
|
||||
def __repr__(self): ...
|
||||
def __str__(self): ...
|
||||
@property
|
||||
def dimensionality(self): ...
|
||||
|
||||
class AffineTransform(ProjectiveTransform):
|
||||
def __init__(
|
||||
self,
|
||||
matrix=None,
|
||||
scale=None,
|
||||
rotation: float | None = None,
|
||||
shear: float | None = None,
|
||||
translation=None,
|
||||
*,
|
||||
dimensionality: int = 2
|
||||
): ...
|
||||
@property
|
||||
def scale(self): ...
|
||||
@property
|
||||
def rotation(self): ...
|
||||
@property
|
||||
def shear(self): ...
|
||||
@property
|
||||
def translation(self): ...
|
||||
|
||||
class PiecewiseAffineTransform(GeometricTransform):
|
||||
def __init__(self): ...
|
||||
def estimate(self, src, dst) -> bool: ...
|
||||
def __call__(self, coords): ...
|
||||
def inverse(self, coords): ...
|
||||
|
||||
def _euler_rotation(axis, angle): ...
|
||||
def _euler_rotation_matrix(angles, axes=None): ...
|
||||
|
||||
class EuclideanTransform(ProjectiveTransform):
|
||||
def __init__(
|
||||
self,
|
||||
matrix=None,
|
||||
rotation: float | Sequence[float] | None = None,
|
||||
translation=None,
|
||||
*,
|
||||
dimensionality: int = 2
|
||||
): ...
|
||||
def estimate(self, src, dst) -> bool: ...
|
||||
@property
|
||||
def rotation(self): ...
|
||||
@property
|
||||
def translation(self): ...
|
||||
|
||||
class SimilarityTransform(EuclideanTransform):
|
||||
def __init__(
|
||||
self,
|
||||
matrix=None,
|
||||
scale: float | None = None,
|
||||
rotation: float | None = None,
|
||||
translation=None,
|
||||
*,
|
||||
dimensionality=2
|
||||
): ...
|
||||
def estimate(self, src, dst) -> bool: ...
|
||||
@property
|
||||
def scale(self): ...
|
||||
|
||||
class PolynomialTransform(GeometricTransform):
|
||||
def __init__(self, params=None, *, dimensionality=2): ...
|
||||
def estimate(self, src, dst, order: int = 2, weights=None) -> bool: ...
|
||||
def __call__(self, coords): ...
|
||||
def inverse(self, coords): ...
|
||||
|
||||
TRANSFORMS: dict = ...
|
||||
|
||||
def estimate_transform(ttype, src, dst, *args, **kwargs: ArrayLike | int): ...
|
||||
def matrix_transform(coords, matrix): ...
|
|
@ -0,0 +1,119 @@
|
|||
from collections.abc import Iterable
|
||||
from numpy.typing import NDArray
|
||||
from typing import Mapping, Literal
|
||||
import numpy as np
|
||||
from numpy.lib import NumpyVersion
|
||||
import scipy
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
from ._geometric import SimilarityTransform, AffineTransform, ProjectiveTransform
|
||||
|
||||
from ..measure import block_reduce
|
||||
|
||||
from .._shared.utils import (
|
||||
get_bound_method_class,
|
||||
safe_as_int,
|
||||
warn,
|
||||
convert_to_float,
|
||||
_to_ndimage_mode,
|
||||
_validate_interpolation_order,
|
||||
channel_as_last_axis,
|
||||
deprecate_multichannel_kwarg,
|
||||
)
|
||||
|
||||
HOMOGRAPHY_TRANSFORMS = ...
|
||||
|
||||
def _preprocess_resize_output_shape(image, output_shape): ...
|
||||
def resize(
|
||||
image: NDArray,
|
||||
output_shape: Iterable,
|
||||
order=None,
|
||||
mode="reflect",
|
||||
cval=0,
|
||||
clip=True,
|
||||
preserve_range=False,
|
||||
anti_aliasing=None,
|
||||
anti_aliasing_sigma=None,
|
||||
) -> NDArray: ...
|
||||
@channel_as_last_axis()
|
||||
@deprecate_multichannel_kwarg(multichannel_position=7)
|
||||
def rescale(
|
||||
image: NDArray,
|
||||
scale: tuple[float, ...] | float,
|
||||
order=None,
|
||||
mode="reflect",
|
||||
cval=0,
|
||||
clip=True,
|
||||
preserve_range=False,
|
||||
multichannel=False,
|
||||
anti_aliasing=None,
|
||||
anti_aliasing_sigma=None,
|
||||
*,
|
||||
channel_axis=None
|
||||
) -> NDArray: ...
|
||||
def rotate(
|
||||
image: NDArray,
|
||||
angle: float,
|
||||
resize: bool = False,
|
||||
center=None,
|
||||
order=None,
|
||||
mode="constant",
|
||||
cval=0,
|
||||
clip=True,
|
||||
preserve_range=False,
|
||||
) -> NDArray: ...
|
||||
def downscale_local_mean(
|
||||
image: NDArray, factors, cval: float = 0, clip: bool = True
|
||||
) -> NDArray: ...
|
||||
def _swirl_mapping(xy, center, rotation, strength, radius): ...
|
||||
def swirl(
|
||||
image: NDArray,
|
||||
center=None,
|
||||
strength: float = 1,
|
||||
radius: float = 100,
|
||||
rotation: float = 0,
|
||||
output_shape=None,
|
||||
order=None,
|
||||
mode="reflect",
|
||||
cval=0,
|
||||
clip=True,
|
||||
preserve_range=False,
|
||||
) -> NDArray: ...
|
||||
def _stackcopy(a, b): ...
|
||||
def warp_coords(coord_map, shape: tuple, dtype=...): ...
|
||||
def _clip_warp_output(input_image, output_image, mode, cval, clip): ...
|
||||
def warp(
|
||||
image: NDArray,
|
||||
inverse_map,
|
||||
map_args: Mapping = {},
|
||||
output_shape=None,
|
||||
order: int | None = None,
|
||||
mode: Literal["constant", "edge", "symmetric", "reflect", "wrap"] = "constant",
|
||||
cval: float = 0.0,
|
||||
clip: bool = True,
|
||||
preserve_range: bool = False,
|
||||
): ...
|
||||
def _linear_polar_mapping(output_coords, k_angle, k_radius, center): ...
|
||||
def _log_polar_mapping(output_coords, k_angle, k_radius, center): ...
|
||||
@channel_as_last_axis()
|
||||
@deprecate_multichannel_kwarg()
|
||||
def warp_polar(
|
||||
image: NDArray,
|
||||
center=None,
|
||||
*,
|
||||
radius: float | None = None,
|
||||
output_shape=None,
|
||||
scaling: Literal["linear", "log"] = "linear",
|
||||
multichannel: bool = False,
|
||||
channel_axis: int | None = None,
|
||||
**kwargs
|
||||
) -> NDArray: ...
|
||||
def _local_mean_weights(old_size, new_size, grid_mode, dtype): ...
|
||||
def resize_local_mean(
|
||||
image: NDArray,
|
||||
output_shape: Iterable,
|
||||
grid_mode: bool = True,
|
||||
preserve_range: bool = False,
|
||||
*,
|
||||
channel_axis=None
|
||||
) -> NDArray: ...
|
|
@ -0,0 +1,7 @@
|
|||
__all__ = ["frt2", "ifrt2"]
|
||||
|
||||
import numpy as np
|
||||
from numpy import roll, newaxis
|
||||
|
||||
def frt2(a): ...
|
||||
def ifrt2(a): ...
|
|
@ -0,0 +1,46 @@
|
|||
from numpy.typing import NDArray, ArrayLike
|
||||
import numpy as np
|
||||
|
||||
def hough_line_peaks(
|
||||
hspace,
|
||||
angles,
|
||||
dists,
|
||||
min_distance: int = 9,
|
||||
min_angle: int = 10,
|
||||
threshold: float | None = None,
|
||||
num_peaks: int = ...,
|
||||
) -> tuple[NDArray, ...]: ...
|
||||
def hough_circle(image, radius, normalize=True, full_output=False): ...
|
||||
def hough_ellipse(
|
||||
image,
|
||||
threshold: int = 4,
|
||||
accuracy=1,
|
||||
min_size: int = 4,
|
||||
max_size: int | None = None,
|
||||
): ...
|
||||
def hough_line(image, theta=None): ...
|
||||
def probabilistic_hough_line(
|
||||
image,
|
||||
threshold: int = 10,
|
||||
line_length: int = 50,
|
||||
line_gap: int = 10,
|
||||
theta=None,
|
||||
seed: int | None = None,
|
||||
) -> ArrayLike: ...
|
||||
def hough_circle_peaks(
|
||||
hspaces,
|
||||
radii,
|
||||
min_xdistance: int = 1,
|
||||
min_ydistance: int = 1,
|
||||
threshold: float | None = None,
|
||||
num_peaks: int = ...,
|
||||
total_num_peaks: int = ...,
|
||||
normalize: bool = False,
|
||||
) -> tuple[NDArray, ...]: ...
|
||||
def label_distant_points(
|
||||
xs: ArrayLike,
|
||||
ys: ArrayLike,
|
||||
min_xdistance: int,
|
||||
min_ydistance: int,
|
||||
max_points: int,
|
||||
) -> ArrayLike: ...
|
|
@ -0,0 +1,7 @@
|
|||
from skimage._typing import Scalar
|
||||
from numpy import ndarray
|
||||
from numpy.typing import NDArray
|
||||
import numpy as np
|
||||
|
||||
def integral_image(image: NDArray, *, dtype=None) -> NDArray: ...
|
||||
def integrate(ii: NDArray, start, end) -> Scalar | np.ndarray: ...
|
|
@ -0,0 +1,67 @@
|
|||
from numpy.typing import NDArray, ArrayLike
|
||||
from typing import Literal
|
||||
import math
|
||||
|
||||
import numpy as np
|
||||
|
||||
from .._shared import utils
|
||||
from .._shared.filters import gaussian
|
||||
from .._shared.utils import convert_to_float
|
||||
from ..transform import resize
|
||||
|
||||
def _smooth(image, sigma, mode, cval, channel_axis): ...
|
||||
def _check_factor(factor): ...
|
||||
@utils.deprecate_multichannel_kwarg(multichannel_position=6)
|
||||
def pyramid_reduce(
|
||||
image: NDArray,
|
||||
downscale: float = 2,
|
||||
sigma: float | None = None,
|
||||
order: int = 1,
|
||||
mode: Literal["reflect", "constant", "edge", "symmetric", "wrap"] = "reflect",
|
||||
cval: float = 0,
|
||||
multichannel: bool = False,
|
||||
preserve_range: bool = False,
|
||||
*,
|
||||
channel_axis: int | None = None
|
||||
) -> ArrayLike: ...
|
||||
@utils.deprecate_multichannel_kwarg(multichannel_position=6)
|
||||
def pyramid_expand(
|
||||
image: NDArray,
|
||||
upscale: float = 2,
|
||||
sigma: float | None = None,
|
||||
order: int = 1,
|
||||
mode: Literal["reflect", "constant", "edge", "symmetric", "wrap"] = "reflect",
|
||||
cval: float = 0,
|
||||
multichannel: bool = False,
|
||||
preserve_range: bool = False,
|
||||
*,
|
||||
channel_axis: int | None = None
|
||||
) -> ArrayLike: ...
|
||||
@utils.deprecate_multichannel_kwarg(multichannel_position=7)
|
||||
def pyramid_gaussian(
|
||||
image: NDArray,
|
||||
max_layer: int = ...,
|
||||
downscale: float = 2,
|
||||
sigma: float | None = None,
|
||||
order: int = 1,
|
||||
mode: Literal["reflect", "constant", "edge", "symmetric", "wrap"] = "reflect",
|
||||
cval: float = 0,
|
||||
multichannel: bool = False,
|
||||
preserve_range: bool = False,
|
||||
*,
|
||||
channel_axis: int | None = None
|
||||
): ...
|
||||
@utils.deprecate_multichannel_kwarg(multichannel_position=7)
|
||||
def pyramid_laplacian(
|
||||
image: NDArray,
|
||||
max_layer: int = ...,
|
||||
downscale: float = 2,
|
||||
sigma: float | None = None,
|
||||
order: int = 1,
|
||||
mode: Literal["reflect", "constant", "edge", "symmetric", "wrap"] = "reflect",
|
||||
cval: float = 0,
|
||||
multichannel: bool = False,
|
||||
preserve_range: bool = False,
|
||||
*,
|
||||
channel_axis: int | None = None
|
||||
): ...
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче