mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-07 11:28:14 +08:00
Merge tag 'v0.8.1' into releases
* tag 'v0.8.1': Update version to 0.8.1 Remove colon as multi-line comment symbol Fix vectorized_ops for bento BUG: not all histogram memory was aligned correctly Add release instruction to update dev docs Add mailing list adresses to release instructions Use np.intp type for indices Fix `ValueError: Buffer dtype mismatch` on win-amd64 Fix `ValueError: Buffer dtype mismatch` on win-amd64 Fix `ValueError: Buffer dtype mismatch` on win-amd64 Fix `ValueError: Buffer dtype mismatch` on win-amd64 Increase version number to 0.9
This commit is contained in:
@@ -49,8 +49,16 @@ How to make a new release of ``skimage``
|
||||
- Build using ``make gh-pages``.
|
||||
- Push upstream: ``git push`` in ``gh-pages``.
|
||||
|
||||
- Update the development docs for the new version ``0.Xdev`` just like above
|
||||
|
||||
- Post release notes on mailing lists, blog, G+, etc.
|
||||
|
||||
- scikit-image@googlegroups.com
|
||||
- scipy-user@scipy.org
|
||||
- scikit-learn-general@lists.sourceforge.net
|
||||
- pythonvision@googlegroups.com
|
||||
|
||||
|
||||
Debian
|
||||
------
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
Name: scikit-image
|
||||
Version: 0.8.0
|
||||
Version: 0.8.1
|
||||
Summary: Image processing routines for SciPy
|
||||
Url: http://scikit-image.org
|
||||
DownloadUrl: http://github.com/scikit-image/scikit-image
|
||||
|
||||
@@ -17,7 +17,7 @@ MAINTAINER_EMAIL = 'stefan@sun.ac.za'
|
||||
URL = 'http://scikit-image.org'
|
||||
LICENSE = 'Modified BSD'
|
||||
DOWNLOAD_URL = 'http://github.com/scikit-image/scikit-image'
|
||||
VERSION = '0.8.0'
|
||||
VERSION = '0.8.1'
|
||||
PYTHON_VERSION = (2, 5)
|
||||
DEPENDENCIES = {
|
||||
'numpy': (1, 6),
|
||||
|
||||
@@ -109,14 +109,14 @@ def polygon(y, x, shape=None):
|
||||
|
||||
cdef Py_ssize_t r, c
|
||||
|
||||
#: make contigous arrays for r, c coordinates
|
||||
# make contigous arrays for r, c coordinates
|
||||
cdef cnp.ndarray contiguous_rdata, contiguous_cdata
|
||||
contiguous_rdata = np.ascontiguousarray(y, 'double')
|
||||
contiguous_cdata = np.ascontiguousarray(x, 'double')
|
||||
cdef cnp.double_t* rptr = <cnp.double_t*>contiguous_rdata.data
|
||||
cdef cnp.double_t* cptr = <cnp.double_t*>contiguous_cdata.data
|
||||
|
||||
#: output coordinate arrays
|
||||
# output coordinate arrays
|
||||
cdef list rr = list()
|
||||
cdef list cc = list()
|
||||
|
||||
@@ -126,7 +126,7 @@ def polygon(y, x, shape=None):
|
||||
rr.append(r)
|
||||
cc.append(c)
|
||||
|
||||
return np.array(rr), np.array(cc)
|
||||
return np.array(rr, dtype=np.intp), np.array(cc, dtype=np.intp)
|
||||
|
||||
|
||||
def ellipse(double cy, double cx, double yradius, double xradius, shape=None):
|
||||
@@ -164,7 +164,7 @@ def ellipse(double cy, double cx, double yradius, double xradius, shape=None):
|
||||
|
||||
cdef Py_ssize_t r, c
|
||||
|
||||
#: output coordinate arrays
|
||||
# output coordinate arrays
|
||||
cdef list rr = list()
|
||||
cdef list cc = list()
|
||||
|
||||
@@ -174,7 +174,7 @@ def ellipse(double cy, double cx, double yradius, double xradius, shape=None):
|
||||
rr.append(r)
|
||||
cc.append(c)
|
||||
|
||||
return np.array(rr), np.array(cc)
|
||||
return np.array(rr, dtype=np.intp), np.array(cc, dtype=np.intp)
|
||||
|
||||
|
||||
def circle(double cy, double cx, double radius, shape=None):
|
||||
@@ -281,7 +281,7 @@ def circle_perimeter(Py_ssize_t cy, Py_ssize_t cx, Py_ssize_t radius,
|
||||
y = y - 1
|
||||
x = x + 1
|
||||
|
||||
return np.array(rr) + cy, np.array(cc) + cx
|
||||
return np.array(rr, dtype=np.intp) + cy, np.array(cc, dtype=np.intp) + cx
|
||||
|
||||
|
||||
def ellipse_perimeter(Py_ssize_t cy, Py_ssize_t cx, Py_ssize_t yradius,
|
||||
@@ -368,7 +368,7 @@ def ellipse_perimeter(Py_ssize_t cy, Py_ssize_t cx, Py_ssize_t yradius,
|
||||
err += ychange
|
||||
ychange += twobsquared
|
||||
|
||||
return np.array(py) + cy, np.array(px) + cx
|
||||
return np.array(py, dtype=np.intp) + cy, np.array(px, dtype=np.intp) + cx
|
||||
|
||||
|
||||
def set_color(img, coords, color):
|
||||
|
||||
+10
-12
@@ -91,8 +91,9 @@ cdef struct SCoord:
|
||||
Py_ssize_t y
|
||||
|
||||
cdef struct Histograms:
|
||||
void *memory # pointer to the allocated memory
|
||||
Histogram *histogram # pointer to the histogram memory
|
||||
HistogramPiece accumulator # running histogram (32-byte aligned)
|
||||
void *memory # pointer to the unaligned allocated memory
|
||||
Histogram *histogram # pointer to the histogram memory (aligned)
|
||||
PixelCount *pixel_count # pointer to the pixel count memory
|
||||
cnp.uint8_t *data # pointer to the image data
|
||||
cnp.uint8_t *mask # pointer to the image mask
|
||||
@@ -142,9 +143,6 @@ cdef struct Histograms:
|
||||
|
||||
Py_ssize_t row_stride # stride between one row and the next
|
||||
Py_ssize_t col_stride # stride between one column and the next
|
||||
# The accumulator holds the running histogram
|
||||
#
|
||||
HistogramPiece accumulator
|
||||
#
|
||||
# The running count of pixels in the accumulator
|
||||
#
|
||||
@@ -188,10 +186,12 @@ cdef Histograms *allocate_histograms(Py_ssize_t rows,
|
||||
|
||||
memory_size = (adjusted_stripe_length *
|
||||
(sizeof(Histogram) + sizeof(PixelCount)) +
|
||||
sizeof(Histograms) + 32)
|
||||
sizeof(Histograms) + 64)
|
||||
ptr = malloc(memory_size)
|
||||
memset(ptr, 0, memory_size)
|
||||
ph = <Histograms *> ptr
|
||||
# align ph.accumulator to 32-byte boundary
|
||||
roundoff = (<Py_ssize_t> ptr + 31) % 32
|
||||
ph = <Histograms *> (ptr + 31 - roundoff)
|
||||
if not ptr:
|
||||
return ph
|
||||
ph.memory = ptr
|
||||
@@ -201,10 +201,8 @@ cdef Histograms *allocate_histograms(Py_ssize_t rows,
|
||||
#
|
||||
# Align histogram memory to a 32-byte boundary
|
||||
#
|
||||
roundoff = <Py_ssize_t>ptr
|
||||
roundoff += 31
|
||||
roundoff -= roundoff % 32
|
||||
ptr = <void *> roundoff
|
||||
roundoff = (<Py_ssize_t> ptr + 31) % 32
|
||||
ptr += 31 - roundoff
|
||||
ph.histogram = <Histogram *> ptr
|
||||
#
|
||||
# Fill in the statistical things we keep around
|
||||
@@ -696,7 +694,7 @@ cdef int c_median_filter(Py_ssize_t rows,
|
||||
#
|
||||
# Initialize the accumulator (octagon histogram) to zero
|
||||
#
|
||||
memset(&ph.accumulator, 0, sizeof(ph.accumulator))
|
||||
memset(&(ph.accumulator), 0, sizeof(ph.accumulator))
|
||||
ph.accumulator_count = 0
|
||||
for i in range(16):
|
||||
ph.last_update_column[i] = -radius-1
|
||||
|
||||
@@ -26,7 +26,7 @@ def configuration(parent_package='', top_path=None):
|
||||
cython(['rank/bilateral_rank.pyx'], working_path=base_path)
|
||||
|
||||
config.add_extension('_ctmf', sources=['_ctmf.c'],
|
||||
include_dirs=[get_numpy_include_dirs()])
|
||||
include_dirs=[get_numpy_include_dirs()])
|
||||
config.add_extension('_denoise_cy', sources=['_denoise_cy.c'],
|
||||
include_dirs=[get_numpy_include_dirs(), '../_shared'])
|
||||
config.add_extension('rank._core8', sources=['rank/_core8.c'],
|
||||
|
||||
@@ -49,7 +49,7 @@ def test_bbox():
|
||||
|
||||
def test_central_moments():
|
||||
mu = regionprops(SAMPLE, ['CentralMoments'])[0]['CentralMoments']
|
||||
#: determined with OpenCV
|
||||
# determined with OpenCV
|
||||
assert_almost_equal(mu[0,2], 436.00000000000045)
|
||||
# different from OpenCV results, bug in OpenCV
|
||||
assert_almost_equal(mu[0,3], -737.333333333333)
|
||||
@@ -198,7 +198,7 @@ def test_minor_axis_length():
|
||||
|
||||
def test_moments():
|
||||
m = regionprops(SAMPLE, ['Moments'])[0]['Moments']
|
||||
#: determined with OpenCV
|
||||
# determined with OpenCV
|
||||
assert_almost_equal(m[0,0], 72.0)
|
||||
assert_almost_equal(m[0,1], 408.0)
|
||||
assert_almost_equal(m[0,2], 2748.0)
|
||||
@@ -213,7 +213,7 @@ def test_moments():
|
||||
|
||||
def test_normalized_moments():
|
||||
nu = regionprops(SAMPLE, ['NormalizedMoments'])[0]['NormalizedMoments']
|
||||
#: determined with OpenCV
|
||||
# determined with OpenCV
|
||||
assert_almost_equal(nu[0,2], 0.08410493827160502)
|
||||
assert_almost_equal(nu[1,1], -0.016846707818929982)
|
||||
assert_almost_equal(nu[1,2], -0.002899800614433943)
|
||||
|
||||
@@ -31,7 +31,7 @@ def possible_hull(cnp.ndarray[dtype=cnp.uint8_t, ndim=2, mode="c"] img):
|
||||
# rows storage slots for right boundary pixels
|
||||
# cols storage slots for bottom boundary pixels
|
||||
cdef cnp.ndarray[dtype=cnp.intp_t, ndim=2] nonzero = \
|
||||
np.ones((2 * (rows + cols), 2), dtype=np.int)
|
||||
np.ones((2 * (rows + cols), 2), dtype=np.intp)
|
||||
nonzero *= -1
|
||||
|
||||
for r in range(rows):
|
||||
|
||||
@@ -73,7 +73,7 @@ def _felzenszwalb_grey(image, double scale=1, sigma=0.8, Py_ssize_t min_size=20)
|
||||
cdef cnp.intp_t *edges_p = <cnp.intp_t*>edges.data
|
||||
cdef cnp.float_t *costs_p = <cnp.float_t*>costs.data
|
||||
cdef cnp.ndarray[cnp.intp_t, ndim=1] segment_size \
|
||||
= np.ones(width * height, dtype=np.int)
|
||||
= np.ones(width * height, dtype=np.intp)
|
||||
# inner cost of segments
|
||||
cdef cnp.ndarray[cnp.float_t, ndim=1] cint = np.zeros(width * height)
|
||||
cdef int seg0, seg1, seg_new, e
|
||||
|
||||
@@ -164,7 +164,7 @@ def hough_circle(img, radius, normalize=True):
|
||||
Hough transform accumulator for each radius
|
||||
|
||||
"""
|
||||
return _hough_circle(img, radius, normalize)
|
||||
return _hough_circle(img, radius.astype(np.intp), normalize)
|
||||
|
||||
def hough_peaks(hspace, angles, dists, min_distance=10, min_angle=10,
|
||||
threshold=None, num_peaks=np.inf):
|
||||
|
||||
Reference in New Issue
Block a user