More fixes for documentation.

This commit is contained in:
Andrey Kamaev
2012-05-28 20:11:38 +00:00
parent bc929a7d46
commit 6ca618277c
35 changed files with 532 additions and 574 deletions

View File

@@ -75,8 +75,6 @@ Estimates the Gaussian mixture parameters from a sample set.
.. ocv:function:: bool CvEM::train( const CvMat* samples, const CvMat* sampleIdx=0, CvEMParams params=CvEMParams(), CvMat* labels=0 )
.. ocv:pyfunction:: cv2.EM.train(samples[, sampleIdx[, params]]) -> retval, labels
:param samples: Samples from which the Gaussian mixture model will be estimated.
:param sample_idx: Mask of samples to use. All samples are used by default.
@@ -107,8 +105,6 @@ Returns a mixture component index of a sample.
.. ocv:function:: float CvEM::predict( const CvMat* sample, CvMat* probs ) const
.. ocv:pyfunction:: cv2.EM.predict(sample) -> retval, probs
:param sample: A sample for classification.
:param probs: If it is not null then the method will write posterior probabilities of each component given the sample data to this parameter.
@@ -122,8 +118,6 @@ Returns the number of mixture components :math:`M` in the Gaussian mixture model
.. ocv:function:: int CvEM::get_nclusters() const
.. ocv:pyfunction:: cv2.EM.getNClusters() -> retval
CvEM::getMeans
------------------
@@ -133,8 +127,6 @@ Returns mixture means :math:`a_k`.
.. ocv:function:: const CvMat* CvEM::get_means() const
.. ocv:pyfunction:: cv2.EM.getMeans() -> means
CvEM::getCovs
-------------
@@ -144,8 +136,6 @@ Returns mixture covariance matrices :math:`S_k`.
.. ocv:function:: const CvMat** CvEM::get_covs() const
.. ocv:pyfunction:: cv2.EM.getCovs([covs]) -> covs
CvEM::getWeights
----------------
@@ -155,8 +145,6 @@ Returns mixture weights :math:`\pi_k`.
.. ocv:function:: const CvMat* CvEM::get_weights() const
.. ocv:pyfunction:: cv2.EM.getWeights() -> weights
CvEM::getProbs
--------------
@@ -166,8 +154,6 @@ Returns vectors of probabilities for each training sample.
.. ocv:function:: const CvMat* CvEM::get_probs() const
.. ocv:pyfunction:: cv2.EM.getProbs() -> probs
For each training sample :math:`i` (that have been passed to the constructor or to :ocv:func:`CvEM::train`) returns probabilities :math:`p_{i,k}` to belong to a mixture component :math:`k`.
@@ -179,8 +165,6 @@ Returns logarithm of likelihood.
.. ocv:function:: double CvEM::get_log_likelihood() const
.. ocv:pyfunction:: cv2.EM.getLikelihood() -> likelihood
CvEM::write
-----------

View File

@@ -81,22 +81,22 @@ RandomizedTree::train
-------------------------
Trains a randomized tree using an input set of keypoints.
.. ocv:function:: void train(std::vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
.. ocv:function:: void RandomizedTree::train( vector<BaseKeypoint> const& base_set, RNG & rng, int depth, int views, size_t reduced_num_dim, int num_quant_bits )
.. ocv:function:: void train(std::vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
.. ocv:function:: void RandomizedTree::train( vector<BaseKeypoint> const& base_set, RNG & rng, PatchGenerator & make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits )
:param base_set: Vector of the ``BaseKeypoint`` type. It contains image keypoints used for training.
:param rng: Random-number generator used for training.
:param make_patch: Patch generator used for training.
:param depth: Maximum tree depth.
:param views: Number of random views of each keypoint neighborhood to generate.
:param reduced_num_dim: Number of dimensions used in the compressed signature.
:param num_quant_bits: Number of bits used for quantization.
@@ -105,9 +105,9 @@ RandomizedTree::read
------------------------
Reads a pre-saved randomized tree from a file or stream.
.. ocv:function:: read(const char* file_name, int num_quant_bits)
.. ocv:function:: RandomizedTree::read(const char* file_name, int num_quant_bits)
.. ocv:function:: read(std::istream &is, int num_quant_bits)
.. ocv:function:: RandomizedTree::read(std::istream &is, int num_quant_bits)
:param file_name: Name of the file that contains randomized tree data.
@@ -121,9 +121,9 @@ RandomizedTree::write
-------------------------
Writes the current randomized tree to a file or stream.
.. ocv:function:: void write(const char* file_name) const
.. ocv:function:: void RandomizedTree::write(const char* file_name) const
.. ocv:function:: void write(std::ostream &os) const
.. ocv:function:: void RandomizedTree::write(std::ostream &os) const
:param file_name: Name of the file where randomized tree data is stored.
@@ -133,7 +133,7 @@ Writes the current randomized tree to a file or stream.
RandomizedTree::applyQuantization
-------------------------------------
.. ocv:function:: void applyQuantization(int num_quant_bits)
.. ocv:function:: void RandomizedTree::applyQuantization(int num_quant_bits)
Applies quantization to the current randomized tree.
@@ -240,26 +240,26 @@ RTreeClassifier::train
--------------------------
Trains a randomized tree classifier using an input set of keypoints.
.. ocv:function:: void train(vector<BaseKeypoint> const& base_set, RNG& rng, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
.. ocv:function:: void RTreeClassifier::train( vector<BaseKeypoint> const& base_set, RNG & rng, int num_trees=RTreeClassifier::DEFAULT_TREES, int depth=RandomizedTree::DEFAULT_DEPTH, int views=RandomizedTree::DEFAULT_VIEWS, size_t reduced_num_dim=RandomizedTree::DEFAULT_REDUCED_NUM_DIM, int num_quant_bits=DEFAULT_NUM_QUANT_BITS )
.. ocv:function:: void train(vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
.. ocv:function:: void RTreeClassifier::train( vector<BaseKeypoint> const& base_set, RNG & rng, PatchGenerator & make_patch, int num_trees=RTreeClassifier::DEFAULT_TREES, int depth=RandomizedTree::DEFAULT_DEPTH, int views=RandomizedTree::DEFAULT_VIEWS, size_t reduced_num_dim=RandomizedTree::DEFAULT_REDUCED_NUM_DIM, int num_quant_bits=DEFAULT_NUM_QUANT_BITS )
:param base_set: Vector of the ``BaseKeypoint`` type. It contains image keypoints used for training.
:param rng: Random-number generator used for training.
:param make_patch: Patch generator used for training.
:param num_trees: Number of randomized trees used in ``RTreeClassificator`` .
:param depth: Maximum tree depth.
:param views: Number of random views of each keypoint neighborhood to generate.
:param reduced_num_dim: Number of dimensions used in the compressed signature.
:param num_quant_bits: Number of bits used for quantization.
:param print_status: Current status of training printed on the console.
@@ -268,9 +268,9 @@ RTreeClassifier::getSignature
---------------------------------
Returns a signature for an image patch.
.. ocv:function:: void getSignature(IplImage *patch, uchar *sig)
.. ocv:function:: void RTreeClassifier::getSignature(IplImage *patch, uchar *sig)
.. ocv:function:: void getSignature(IplImage *patch, float *sig)
.. ocv:function:: void RTreeClassifier::getSignature(IplImage *patch, float *sig)
:param patch: Image patch to calculate the signature for.
:param sig: Output signature (array dimension is ``reduced_num_dim)`` .
@@ -278,15 +278,15 @@ Returns a signature for an image patch.
RTreeClassifier::getSparseSignature
---------------------------------------
---------------------------------------
Returns a sparse signature for an image patch
.. ocv:function:: void getSparseSignature(IplImage *patch, float *sig, float thresh)
.. ocv:function:: void RTreeClassifier::getSparseSignature(IplImage *patch, float *sig, float thresh)
:param patch: Image patch to calculate the signature for.
:param sig: Output signature (array dimension is ``reduced_num_dim)`` .
:param thresh: Threshold used for compressing the signature.
Returns a signature for an image patch similarly to ``getSignature`` but uses a threshold for removing all signature elements below the threshold so that the signature is compressed.
@@ -296,7 +296,7 @@ RTreeClassifier::countNonZeroElements
-----------------------------------------
Returns the number of non-zero elements in an input array.
.. ocv:function:: static int countNonZeroElements(float *vec, int n, double tol=1e-10)
.. ocv:function:: static int RTreeClassifier::countNonZeroElements(float *vec, int n, double tol=1e-10)
:param vec: Input vector containing float elements.
@@ -310,9 +310,9 @@ RTreeClassifier::read
-------------------------
Reads a pre-saved ``RTreeClassifier`` from a file or stream.
.. ocv:function:: read(const char* file_name)
.. ocv:function:: void RTreeClassifier::read(const char* file_name)
.. ocv:function:: read(std::istream& is)
.. ocv:function:: void RTreeClassifier::read( std::istream & is )
:param file_name: Name of the file that contains randomized tree data.
@@ -324,9 +324,9 @@ RTreeClassifier::write
--------------------------
Writes the current ``RTreeClassifier`` to a file or stream.
.. ocv:function:: void write(const char* file_name) const
.. ocv:function:: void RTreeClassifier::write(const char* file_name) const
.. ocv:function:: void write(std::ostream &os) const
.. ocv:function:: void RTreeClassifier::write(std::ostream &os) const
:param file_name: Name of the file where randomized tree data is stored.
@@ -338,7 +338,7 @@ RTreeClassifier::setQuantization
------------------------------------
Applies quantization to the current randomized tree.
.. ocv:function:: void setQuantization(int num_quant_bits)
.. ocv:function:: void RTreeClassifier::setQuantization(int num_quant_bits)
:param num_quant_bits: Number of bits used for quantization.

View File

@@ -0,0 +1,95 @@
Histograms
==========
.. highlight:: cpp
CalcPGH
-------
Calculates a pair-wise geometrical histogram for a contour.
.. ocv:cfunction:: void cvCalcPGH( const CvSeq* contour, CvHistogram* hist )
:param contour: Input contour. Currently, only integer point coordinates are allowed.
:param hist: Calculated histogram. It must be two-dimensional.
The function calculates a 2D pair-wise geometrical histogram (PGH), described in [Iivarinen97]_ for the contour. The algorithm considers every pair of contour
edges. The angle between the edges and the minimum/maximum distances
are determined for every pair. To do this, each of the edges in turn
is taken as the base, while the function loops through all the other
edges. When the base edge and any other edge are considered, the minimum
and maximum distances from the points on the non-base edge and line of
the base edge are selected. The angle between the edges defines the row
of the histogram in which all the bins that correspond to the distance
between the calculated minimum and maximum distances are incremented
(that is, the histogram is transposed relatively to the definition in the original paper). The histogram can be used for contour matching.
.. [Iivarinen97] Jukka Iivarinen, Markus Peura, Jaakko Srel, and Ari Visa. *Comparison of Combined Shape Descriptors for Irregular Objects*, 8th British Machine Vision Conference, BMVC'97. http://www.cis.hut.fi/research/IA/paper/publications/bmvc97/bmvc97.html
QueryHistValue*D
----------------
Queries the value of the histogram bin.
.. ocv:cfunction:: float cvQueryHistValue_1D(CvHistogram hist, int idx0)
.. ocv:cfunction:: float cvQueryHistValue_2D(CvHistogram hist, int idx0, int idx1)
.. ocv:cfunction:: float cvQueryHistValue_3D(CvHistogram hist, int idx0, int idx1, int idx2)
.. ocv:cfunction:: float cvQueryHistValue_nD(CvHistogram hist, const int* idx)
.. ocv:pyoldfunction:: cv.QueryHistValue_1D(hist, idx0) -> float
.. ocv:pyoldfunction:: cv.QueryHistValue_2D(hist, idx0, idx1) -> float
.. ocv:pyoldfunction:: cv.QueryHistValue_3D(hist, idx0, idx1, idx2) -> float
.. ocv:pyoldfunction:: cv.QueryHistValue_nD(hist, idx) -> float
:param hist: Histogram.
:param idx0: 0-th index.
:param idx1: 1-st index.
:param idx2: 2-nd index.
:param idx: Array of indices.
The macros return the value of the specified bin of the 1D, 2D, 3D, or N-D histogram. In case of a sparse histogram, the function returns 0. If the bin is not present in the histogram, no new bin is created.
GetHistValue\_?D
----------------
Returns a pointer to the histogram bin.
.. ocv:cfunction:: float cvGetHistValue_1D(CvHistogram hist, int idx0)
.. ocv:cfunction:: float cvGetHistValue_2D(CvHistogram hist, int idx0, int idx1)
.. ocv:cfunction:: float cvGetHistValue_3D(CvHistogram hist, int idx0, int idx1, int idx2)
.. ocv:cfunction:: float cvGetHistValue_nD(CvHistogram hist, int idx)
:param hist: Histogram.
:param idx0: 0-th index.
:param idx1: 1-st index.
:param idx2: 2-nd index.
:param idx: Array of indices.
::
#define cvGetHistValue_1D( hist, idx0 )
((float*)(cvPtr1D( (hist)->bins, (idx0), 0 ))
#define cvGetHistValue_2D( hist, idx0, idx1 )
((float*)(cvPtr2D( (hist)->bins, (idx0), (idx1), 0 )))
#define cvGetHistValue_3D( hist, idx0, idx1, idx2 )
((float*)(cvPtr3D( (hist)->bins, (idx0), (idx1), (idx2), 0 )))
#define cvGetHistValue_nD( hist, idx )
((float*)(cvPtrND( (hist)->bins, (idx), 0 )))
..
The macros ``GetHistValue`` return a pointer to the specified bin of the 1D, 2D, 3D, or N-D histogram. In case of a sparse histogram, the function creates a new bin and sets it to 0, unless it exists already.

View File

@@ -9,6 +9,7 @@ legacy. Deprecated stuff
motion_analysis
expectation_maximization
histograms
planar_subdivisions
feature_detection_and_description
common_interfaces_of_descriptor_extractors

View File

@@ -19,7 +19,7 @@ Planar subdivision.
CvSubdiv2DEdge recent_edge; \
CvPoint2D32f topleft; \
CvPoint2D32f bottomright;
typedef struct CvSubdiv2D
{
CV_SUBDIV2D_FIELDS()
@@ -64,13 +64,13 @@ Quad-edge of a planar subdivision.
/* one of edges within quad-edge, lower 2 bits is index (0..3)
and upper bits are quad-edge pointer */
typedef long CvSubdiv2DEdge;
/* quad-edge structure fields */
#define CV_QUADEDGE2D_FIELDS() \
int flags; \
struct CvSubdiv2DPoint* pt[4]; \
CvSubdiv2DEdge next[4];
typedef struct CvQuadEdge2D
{
CV_QUADEDGE2D_FIELDS()
@@ -97,9 +97,9 @@ Point of an original or dual subdivision.
CvSubdiv2DEdge first; \
CvPoint2D32f pt; \
int id;
#define CV_SUBDIV2D_VIRTUAL_POINT_FLAG (1 << 30)
typedef struct CvSubdiv2DPoint
{
CV_SUBDIV2D_POINT_FIELDS()
@@ -135,7 +135,7 @@ Removes all virtual points.
:param subdiv: Delaunay subdivision.
The function removes all of the virtual points. It
is called internally in
is called internally in
:ocv:cfunc:`CalcSubdivVoronoi2D`
if the subdivision
was modified after the previous call to the function.
@@ -145,7 +145,7 @@ CreateSubdivDelaunay2D
Creates an empty Delaunay triangulation.
.. ocv:cfunction:: CvSubdiv2D* cvCreateSubdivDelaunay2D( CvRect rect, CvMemStorage* storage )
.. ocv:pyoldfunction:: cv.CreateSubdivDelaunay2D(rect, storage)-> emptyDelaunayTriangulation
.. ocv:pyoldfunction:: cv.CreateSubdivDelaunay2D(rect, storage) -> CvSubdiv2D
:param rect: Rectangle that includes all of the 2D points that are to be added to the subdivision.
@@ -157,7 +157,7 @@ subdivision where 2D points can be added using the function
. All of the points to be added must be within
the specified rectangle, otherwise a runtime error is raised.
Note that the triangulation is a single large triangle that covers the given rectangle. Hence the three vertices of this triangle are outside the rectangle
Note that the triangulation is a single large triangle that covers the given rectangle. Hence the three vertices of this triangle are outside the rectangle
``rect``
.
@@ -192,7 +192,7 @@ Returns the edge destination.
The function returns the edge destination. The
returned pointer may be NULL if the edge is from a dual subdivision and
the virtual point coordinates are not calculated yet. The virtual points
can be calculated using the function
can be calculated using the function
:ocv:cfunc:`CalcSubdivVoronoi2D`.
Subdiv2DGetEdge
@@ -235,9 +235,9 @@ Returns next edge around the edge origin.
:param edge: Subdivision edge (not a quad-edge).
The function returns the next edge around the edge origin:
The function returns the next edge around the edge origin:
``eOnext``
on the picture above if
on the picture above if
``e``
is the input edge).
@@ -259,33 +259,33 @@ Returns the location of a point within a Delaunay triangulation.
The function locates the input point within the subdivision. There are five cases:
*
The point falls into some facet. The function returns
The point falls into some facet. The function returns
``CV_PTLOC_INSIDE``
and
and
``*edge``
will contain one of edges of the facet.
*
The point falls onto the edge. The function returns
The point falls onto the edge. The function returns
``CV_PTLOC_ON_EDGE``
and
and
``*edge``
will contain this edge.
*
The point coincides with one of the subdivision vertices. The function returns
The point coincides with one of the subdivision vertices. The function returns
``CV_PTLOC_VERTEX``
and
and
``*vertex``
will contain a pointer to the vertex.
*
The point is outside the subdivision reference rectangle. The function returns
The point is outside the subdivision reference rectangle. The function returns
``CV_PTLOC_OUTSIDE_RECT``
and no pointers are filled.
*
One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error processing mode is selected,
One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error processing mode is selected,
``CV_PTLOC_ERROR``
is returnd.