mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-30 01:57:21 +08:00
Merge pull request #148 from amueller/doc_error_message
DOC: Some sphinx and rst fixes.
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ Test coverage
|
||||
Tests for a module should ideally cover all code in that module,
|
||||
i.e. statement coverage should be at 100%.
|
||||
|
||||
To measure the test coverage, install
|
||||
To measure the test coverage, install
|
||||
`coverage.py <http://nedbatchelder.com/code/coverage/>`__
|
||||
(using ``easy_install coverage``) and then run::
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ is not rocket science.
|
||||
.. [4] http://en.wikipedia.org/wiki/K-means_clustering
|
||||
.. [5] http://en.wikipedia.org/wiki/Lateral_geniculate_nucleus
|
||||
.. [6] D. H. Hubel and T. N. Wiesel Receptive Fields of Single Neurones
|
||||
in the Cat's Striate Cortex J. Physiol. pp. 574-591 (148) 1959
|
||||
in the Cat's Striate Cortex J. Physiol. pp. 574-591 (148) 1959
|
||||
.. [7] D. H. Hubel and T. N. Wiesel Receptive Fields, Binocular
|
||||
Interaction and Functional Architecture in the Cat's Visual Cortex J.
|
||||
Physiol. 160 pp. 106-154 1962
|
||||
Interaction and Functional Architecture in the Cat's Visual Cortex J.
|
||||
Physiol. 160 pp. 106-154 1962
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.. _forking:
|
||||
|
||||
==========================================
|
||||
============================================
|
||||
Making your own copy (fork) of scikits-image
|
||||
==========================================
|
||||
============================================
|
||||
|
||||
You need to do this only once. The instructions here are very similar
|
||||
to the instructions at http://help.github.com/forking/ |emdash| please see
|
||||
@@ -10,7 +10,7 @@ that page for more detail. We're repeating some of it here just to give the
|
||||
specifics for the scikits-image_ project, and to suggest some default names.
|
||||
|
||||
Set up and configure a github account
|
||||
=====================================
|
||||
======================================
|
||||
|
||||
If you don't have a github account, go to the github page, and make one.
|
||||
|
||||
@@ -18,7 +18,7 @@ You then need to configure your account to allow write access |emdash| see
|
||||
the ``Generating SSH keys`` help on `github help`_.
|
||||
|
||||
Create your own forked copy of scikits-image_
|
||||
===========================================
|
||||
=============================================
|
||||
|
||||
#. Log into your github account.
|
||||
#. Go to the scikits-image_ github home at `scikits-image github`_.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.. _using-git:
|
||||
|
||||
Working with *scikits-image* source code
|
||||
======================================
|
||||
========================================
|
||||
|
||||
Contents:
|
||||
|
||||
|
||||
@@ -127,9 +127,9 @@ def greycoprops(P, prop='contrast'):
|
||||
- 'homogeneity': :math:`\\sum_{i,j=0}^{levels-1}\\frac{P_{i,j}}{1+(i-j)^2}`
|
||||
- 'ASM': :math:`\\sum_{i,j=0}^{levels-1} P_{i,j}^2`
|
||||
- 'energy': :math:`\\sqrt{ASM}`
|
||||
- 'correlation':
|
||||
.. math:: \\sum_{i,j=0}^{levels-1} P_{i,j}\\left[\\frac{(i-\\mu_i) \\
|
||||
(j-\\mu_j)}{\\sqrt{(\\sigma_i^2)(\\sigma_j^2)}}\\right]
|
||||
- 'correlation':
|
||||
.. math:: \\sum_{i,j=0}^{levels-1} P_{i,j}\\left[\\frac{(i-\\mu_i) \\
|
||||
(j-\\mu_j)}{\\sqrt{(\\sigma_i^2)(\\sigma_j^2)}}\\right]
|
||||
|
||||
|
||||
Parameters
|
||||
@@ -140,6 +140,7 @@ def greycoprops(P, prop='contrast'):
|
||||
`P[i,j,d,theta]` is the number of times that grey-level j
|
||||
occurs at a distance d and at an angle theta from
|
||||
grey-level i.
|
||||
|
||||
prop : {'contrast', 'dissimilarity', 'homogeneity', 'energy', \
|
||||
'correlation', 'ASM'}, optional
|
||||
The property of the GLCM to compute. The default is 'contrast'.
|
||||
|
||||
@@ -7,11 +7,12 @@ def hog(image, orientations=9, pixels_per_cell=(8, 8),
|
||||
"""Extract Histogram of Oriented Gradients (HOG) for a given image.
|
||||
|
||||
Compute a Histogram of Oriented Gradients (HOG) by
|
||||
1) (optional) global image normalisation
|
||||
2) computing the gradient image in x and y
|
||||
3) computing gradient histograms
|
||||
3) normalising across blocks
|
||||
4) flattening into a feature vector
|
||||
|
||||
1. (optional) global image normalisation
|
||||
2. computing the gradient image in x and y
|
||||
3. computing gradient histograms
|
||||
4. normalising across blocks
|
||||
5. flattening into a feature vector
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
||||
@@ -21,15 +21,6 @@ class MultiImage(object):
|
||||
Whether to conserve memory by only caching a single frame. Default is
|
||||
True.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
filename : str
|
||||
The complete path to the image file.
|
||||
conserve_memory : bool
|
||||
Whether memory is conserved by only caching a single frame.
|
||||
numframes : int
|
||||
The number of frames in the image.
|
||||
|
||||
Notes
|
||||
-----
|
||||
If ``conserve_memory=True`` the memory footprint can be reduced, however
|
||||
|
||||
@@ -182,22 +182,22 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True):
|
||||
Mode for solving the linear system in the random walker
|
||||
algorithm.
|
||||
|
||||
- 'bf' (brute force, default): an LU factorization of the
|
||||
Laplacian is computed. This is fast for small images (<1024x1024),
|
||||
but very slow (due to the memory cost) and memory-consuming for
|
||||
big images (in 3-D for example).
|
||||
- 'bf' (brute force, default): an LU factorization of the Laplacian is
|
||||
computed. This is fast for small images (<1024x1024), but very slow
|
||||
(due to the memory cost) and memory-consuming for big images (in 3-D
|
||||
for example).
|
||||
|
||||
- 'cg' (conjugate gradient): the linear system is solved
|
||||
iteratively using the Conjugate Gradient method from
|
||||
scipy.sparse.linalg. This is less memory-consuming than the
|
||||
brute force method for large images, but it is quite slow.
|
||||
- 'cg' (conjugate gradient): the linear system is solved iteratively
|
||||
using the Conjugate Gradient method from scipy.sparse.linalg. This is
|
||||
less memory-consuming than the brute force method for large images,
|
||||
but it is quite slow.
|
||||
|
||||
- 'cg_mg' (conjugate gradient with multigrid preconditioner):
|
||||
a preconditioner is computed using a multigrid solver, then
|
||||
the solution is computed with the Conjugate Gradient method.
|
||||
This mode requires that the pyamg module
|
||||
(http://code.google.com/p/pyamg/) is installed. For images of
|
||||
size > 512x512, this is the recommended (fastest) mode.
|
||||
- 'cg_mg' (conjugate gradient with multigrid preconditioner): a
|
||||
preconditioner is computed using a multigrid solver, then the
|
||||
solution is computed with the Conjugate Gradient method. This mode
|
||||
requires that the pyamg module (http://code.google.com/p/pyamg/) is
|
||||
installed. For images of size > 512x512, this is the recommended
|
||||
(fastest) mode.
|
||||
|
||||
tol : float
|
||||
tolerance to achieve when solving the linear system, in
|
||||
@@ -240,18 +240,20 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True):
|
||||
the other coefficients are looked for). Each pixel is attributed the label
|
||||
for which it has a maximal value of x. The Laplacian L of the image
|
||||
is defined as:
|
||||
|
||||
- L_ii = d_i, the number of neighbors of pixel i (the degree of i)
|
||||
- L_ij = -w_ij if i and j are adjacent pixels
|
||||
|
||||
The weight w_ij is a decreasing function of the norm of the local gradient.
|
||||
This ensures that diffusion is easier between pixels of similar values.
|
||||
|
||||
When the Laplacian is decomposed into blocks of marked and unmarked pixels
|
||||
When the Laplacian is decomposed into blocks of marked and unmarked pixels::
|
||||
|
||||
L = M B.T
|
||||
B A
|
||||
|
||||
with first indices corresponding to marked pixels, and then to unmarked
|
||||
pixels, minimizing x.T L x for one phase amount to solving
|
||||
pixels, minimizing x.T L x for one phase amount to solving::
|
||||
|
||||
A x = - B x_m
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ def ifrt2(a):
|
||||
Notes
|
||||
-----
|
||||
The FRT has a unique inverse iff n is prime.
|
||||
See [FRT] for an overview.
|
||||
See [1]_ for an overview.
|
||||
The idea for this algorithm is due to Vlad Negnevitski.
|
||||
|
||||
Examples
|
||||
@@ -120,7 +120,7 @@ def ifrt2(a):
|
||||
|
||||
References
|
||||
----------
|
||||
.. [FRT] A. Kingston and I. Svalbe, "Projective transforms on periodic
|
||||
.. [1] A. Kingston and I. Svalbe, "Projective transforms on periodic
|
||||
discrete image arrays," in P. Hawkes (Ed), Advances in Imaging
|
||||
and Electron Physics, 139 (2006)
|
||||
|
||||
|
||||
@@ -17,6 +17,9 @@ import numpy as np
|
||||
from scipy.fftpack import fftshift, fft, ifft
|
||||
from ._project import homography
|
||||
|
||||
__all__ = ["radon", "iradon"]
|
||||
|
||||
|
||||
def radon(image, theta=None):
|
||||
"""
|
||||
Calculates the radon transform of an image given specified
|
||||
|
||||
Reference in New Issue
Block a user