## "Fossies" - the Fresh Open Source Software Archive

### Source code changes of the file "skimage/transform/hough_transform.py" betweenscikit-image-0.19.2.tar.gz and scikit-image-0.19.3.tar.gz

About: scikit-image is a collection of algorithms for image processing in Python.

hough_transform.py  (scikit-image-0.19.2):hough_transform.py  (scikit-image-0.19.3)
import numpy as np import numpy as np
from scipy.spatial import cKDTree from scipy.spatial import cKDTree
from ._hough_transform import
_hough_ellipse, from ._hough_transform import _hough_circle, _hough_ellipse, _hough_line
from ._hough_transform import _probabilistic_hough_line as _prob_hough_line
_probabilistic_hough_line as
def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10, def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10,
threshold=None, num_peaks=np.inf): threshold=None, num_peaks=np.inf):
"""Return peaks in a straight line Hough transform. """Return peaks in a straight line Hough transform.
Identifies most prominent lines separated by a certain angle and distance Identifies most prominent lines separated by a certain angle and distance
in a Hough transform. Non-maximum suppression with different sizes is in a Hough transform. Non-maximum suppression with different sizes is
applied separately in the first (distances) and second (angles) dimension applied separately in the first (distances) and second (angles) dimension
of the Hough space to identify peaks. of the Hough space to identify peaks.
skipping to change at line 65 skipping to change at line 64
2 2
""" """
from ..feature.peak import _prominent_peaks from ..feature.peak import _prominent_peaks
min_angle = min(min_angle, hspace.shape[1]) min_angle = min(min_angle, hspace.shape[1])
h, a, d = _prominent_peaks(hspace, min_xdistance=min_angle, h, a, d = _prominent_peaks(hspace, min_xdistance=min_angle,
min_ydistance=min_distance, min_ydistance=min_distance,
threshold=threshold, threshold=threshold,
num_peaks=num_peaks) num_peaks=num_peaks)
if a.: if a.size > 0:
return (h, angles[a], dists[d]) return (h, angles[a], dists[d])
else: else:
return (h, np.array([]), np.array([])) return (h, np.array([]), np.array([]))
"""Perform a circular Hough transform. """Perform a circular Hough transform.
Parameters Parameters
---------- ----------
image : (M, N) ndarray image : (M, N) ndarray
skipping to change at line 265 skipping to change at line 264
Hough transform for line detection", in IEEE Computer Society Hough transform for line detection", in IEEE Computer Society
Conference on Computer Vision and Pattern Recognition, 1999. Conference on Computer Vision and Pattern Recognition, 1999.
""" """
if image.ndim != 2: if image.ndim != 2:
raise ValueError('The input image `image` must be 2D.') raise ValueError('The input image `image` must be 2D.')
if theta is None: if theta is None:
theta = np.linspace(-np.pi / 2, np.pi / 2, 180, endpoint=False) theta = np.linspace(-np.pi / 2, np.pi / 2, 180, endpoint=False)
return _prob_hough_line(image, threshold=threshold, line_length=line_length, return _prob_hough_line(image, threshold=threshold,
line_gap=line_gap, theta=theta, seed=seed) line_length=line_length, line_gap=line_gap,
theta=theta, seed=seed)