Merged the trunk r8467:8507 (inclusive) (big bunch of documentation fixes)
This commit is contained in:
@@ -13,7 +13,7 @@ descriptor extractors inherit the
|
||||
|
||||
CalonderDescriptorExtractor
|
||||
---------------------------
|
||||
.. ocv:class:: CalonderDescriptorExtractor
|
||||
.. ocv:class:: CalonderDescriptorExtractor : public DescriptorExtractor
|
||||
|
||||
Wrapping class for computing descriptors by using the
|
||||
:ocv:class:`RTreeClassifier` class. ::
|
||||
|
@@ -5,7 +5,7 @@ Common Interfaces of Generic Descriptor Matchers
|
||||
|
||||
OneWayDescriptorMatcher
|
||||
-----------------------
|
||||
.. ocv:class:: OneWayDescriptorMatcher
|
||||
.. ocv:class:: OneWayDescriptorMatcher : public GenericDescriptorMatcher
|
||||
|
||||
Wrapping class for computing, matching, and classifying descriptors using the
|
||||
:ocv:class:`OneWayDescriptorBase` class. ::
|
||||
@@ -64,7 +64,7 @@ Wrapping class for computing, matching, and classifying descriptors using the
|
||||
|
||||
FernDescriptorMatcher
|
||||
---------------------
|
||||
.. ocv:class:: FernDescriptorMatcher
|
||||
.. ocv:class:: FernDescriptorMatcher : public GenericDescriptorMatcher
|
||||
|
||||
Wrapping class for computing, matching, and classifying descriptors using the
|
||||
:ocv:class:`FernClassifier` class. ::
|
||||
|
@@ -8,7 +8,7 @@ This section describes obsolete ``C`` interface of EM algorithm. Details of the
|
||||
|
||||
CvEMParams
|
||||
----------
|
||||
.. ocv:class:: CvEMParams
|
||||
.. ocv:struct:: CvEMParams
|
||||
|
||||
Parameters of the EM algorithm. All parameters are public. You can initialize them by a constructor and then override some of them directly if you want.
|
||||
|
||||
@@ -18,10 +18,10 @@ The constructors
|
||||
|
||||
.. ocv:function:: CvEMParams::CvEMParams()
|
||||
|
||||
.. ocv:function:: CvEMParams::CvEMParams( int nclusters, int cov_mat_type=CvEM::COV_MAT_DIAGONAL, int start_step=CvEM::START_AUTO_STEP, CvTermCriteria term_crit=cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 100, FLT_EPSILON), const CvMat* probs=0, const CvMat* weights=0, const CvMat* means=0, const CvMat** covs=0 )
|
||||
.. ocv:function:: CvEMParams::CvEMParams( int nclusters, int cov_mat_type=EM::COV_MAT_DIAGONAL, int start_step=EM::START_AUTO_STEP, CvTermCriteria term_crit=cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 100, FLT_EPSILON), const CvMat* probs=0, const CvMat* weights=0, const CvMat* means=0, const CvMat** covs=0 )
|
||||
|
||||
:param nclusters: The number of mixture components in the Gaussian mixture model. Some of EM implementation could determine the optimal number of mixtures within a specified value range, but that is not the case in ML yet.
|
||||
|
||||
|
||||
:param cov_mat_type: Constraint on covariance matrices which defines type of matrices. Possible values are:
|
||||
|
||||
* **CvEM::COV_MAT_SPHERICAL** A scaled identity matrix :math:`\mu_k * I`. There is the only parameter :math:`\mu_k` to be estimated for each matrix. The option may be used in special cases, when the constraint is relevant, or as a first step in the optimization (for example in case when the data is preprocessed with PCA). The results of such preliminary estimation may be passed again to the optimization procedure, this time with ``cov_mat_type=CvEM::COV_MAT_DIAGONAL``.
|
||||
@@ -30,7 +30,7 @@ The constructors
|
||||
|
||||
* **CvEM::COV_MAT_GENERIC** A symmetric positively defined matrix. The number of free parameters in each matrix is about :math:`d^2/2`. It is not recommended to use this option, unless there is pretty accurate initial estimation of the parameters and/or a huge number of training samples.
|
||||
|
||||
:param start_step: The start step of the EM algorithm:
|
||||
:param start_step: The start step of the EM algorithm:
|
||||
|
||||
* **CvEM::START_E_STEP** Start with Expectation step. You need to provide means :math:`a_k` of mixture components to use this option. Optionally you can pass weights :math:`\pi_k` and covariance matrices :math:`S_k` of mixture components.
|
||||
* **CvEM::START_M_STEP** Start with Maximization step. You need to provide initial probabilities :math:`p_{i,k}` to use this option.
|
||||
@@ -40,7 +40,7 @@ The constructors
|
||||
|
||||
:param probs: Initial probabilities :math:`p_{i,k}` of sample :math:`i` to belong to mixture component :math:`k`. It is a floating-point matrix of :math:`nsamples \times nclusters` size. It is used and must be not NULL only when ``start_step=CvEM::START_M_STEP``.
|
||||
|
||||
:param weights: Initial weights :math:`\pi_k` of mixture components. It is a floating-point vector with :math:`nclusters` elements. It is used (if not NULL) only when ``start_step=CvEM::START_E_STEP``.
|
||||
:param weights: Initial weights :math:`\pi_k` of mixture components. It is a floating-point vector with :math:`nclusters` elements. It is used (if not NULL) only when ``start_step=CvEM::START_E_STEP``.
|
||||
|
||||
:param means: Initial means :math:`a_k` of mixture components. It is a floating-point matrix of :math:`nclusters \times dims` size. It is used used and must be not NULL only when ``start_step=CvEM::START_E_STEP``.
|
||||
|
||||
@@ -62,7 +62,7 @@ With another constructor it is possible to override a variety of parameters from
|
||||
|
||||
CvEM
|
||||
----
|
||||
.. ocv:class:: CvEM
|
||||
.. ocv:class:: CvEM : public CvStatModel
|
||||
|
||||
The class implements the EM algorithm as described in the beginning of the section :ref:`ML_Expectation Maximization`.
|
||||
|
||||
@@ -71,15 +71,13 @@ CvEM::train
|
||||
-----------
|
||||
Estimates the Gaussian mixture parameters from a sample set.
|
||||
|
||||
.. ocv:function:: void CvEM::train( const Mat& samples, const Mat& sample_idx=Mat(), CvEMParams params=CvEMParams(), Mat* labels=0 )
|
||||
.. ocv:function:: bool CvEM::train( const Mat& samples, const Mat& sampleIdx=Mat(), CvEMParams params=CvEMParams(), Mat* labels=0 )
|
||||
|
||||
.. 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.
|
||||
:param sampleIdx: Mask of samples to use. All samples are used by default.
|
||||
|
||||
:param params: Parameters of the EM algorithm.
|
||||
|
||||
@@ -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
|
||||
-----------
|
||||
|
@@ -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.
|
||||
|
||||
@@ -142,7 +142,7 @@ RandomizedTree::applyQuantization
|
||||
|
||||
RTreeNode
|
||||
---------
|
||||
.. ocv:class:: RTreeNode
|
||||
.. ocv:struct:: RTreeNode
|
||||
|
||||
Class containing a base structure for ``RandomizedTree``. ::
|
||||
|
||||
@@ -240,37 +240,34 @@ 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.
|
||||
|
||||
:param num_quant_bits: Number of bits used for quantization.
|
||||
|
||||
|
||||
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 +275,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 +293,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 +307,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 +321,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 +335,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.
|
||||
|
||||
|
95
modules/legacy/doc/histograms.rst
Normal file
95
modules/legacy/doc/histograms.rst
Normal 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.
|
||||
|
@@ -9,6 +9,7 @@ legacy. Deprecated stuff
|
||||
|
||||
motion_analysis
|
||||
expectation_maximization
|
||||
histograms
|
||||
planar_subdivisions
|
||||
feature_detection_and_description
|
||||
common_interfaces_of_descriptor_extractors
|
||||
|
@@ -8,58 +8,58 @@ CalcOpticalFlowBM
|
||||
-----------------
|
||||
Calculates the optical flow for two images by using the block matching method.
|
||||
|
||||
.. ocv:cfunction:: void cvCalcOpticalFlowBM( const CvArr* prev, const CvArr* curr, CvSize blockSize, CvSize shiftSize, CvSize maxRange, int usePrevious, CvArr* velx, CvArr* vely )
|
||||
.. ocv:cfunction:: void cvCalcOpticalFlowBM( const CvArr* prev, const CvArr* curr, CvSize block_size, CvSize shift_size, CvSize max_range, int use_previous, CvArr* velx, CvArr* vely )
|
||||
|
||||
.. ocv:pyoldfunction:: cv.CalcOpticalFlowBM(prev, curr, blockSize, shiftSize, maxRange, usePrevious, velx, vely)-> None
|
||||
.. ocv:pyoldfunction:: cv.CalcOpticalFlowBM(prev, curr, blockSize, shiftSize, max_range, usePrevious, velx, vely)-> None
|
||||
|
||||
:param prev: First image, 8-bit, single-channel
|
||||
:param prev: First image, 8-bit, single-channel
|
||||
|
||||
:param curr: Second image, 8-bit, single-channel
|
||||
:param curr: Second image, 8-bit, single-channel
|
||||
|
||||
:param blockSize: Size of basic blocks that are compared
|
||||
:param block_size: Size of basic blocks that are compared
|
||||
|
||||
:param shiftSize: Block coordinate increments
|
||||
:param shift_size: Block coordinate increments
|
||||
|
||||
:param maxRange: Size of the scanned neighborhood in pixels around the block
|
||||
:param max_range: Size of the scanned neighborhood in pixels around the block
|
||||
|
||||
:param usePrevious: Flag that specifies whether to use the input velocity as initial approximations or not.
|
||||
:param use_previous: Flag that specifies whether to use the input velocity as initial approximations or not.
|
||||
|
||||
:param velx: Horizontal component of the optical flow of
|
||||
|
||||
.. math::
|
||||
|
||||
\left \lfloor \frac{\texttt{prev->width} - \texttt{blockSize.width}}{\texttt{shiftSize.width}} \right \rfloor \times \left \lfloor \frac{\texttt{prev->height} - \texttt{blockSize.height}}{\texttt{shiftSize.height}} \right \rfloor
|
||||
\left \lfloor \frac{\texttt{prev->width} - \texttt{block_size.width}}{\texttt{shift_size.width}} \right \rfloor \times \left \lfloor \frac{\texttt{prev->height} - \texttt{block_size.height}}{\texttt{shift_size.height}} \right \rfloor
|
||||
|
||||
size, 32-bit floating-point, single-channel
|
||||
size, 32-bit floating-point, single-channel
|
||||
|
||||
:param vely: Vertical component of the optical flow of the same size ``velx`` , 32-bit floating-point, single-channel
|
||||
:param vely: Vertical component of the optical flow of the same size ``velx`` , 32-bit floating-point, single-channel
|
||||
|
||||
|
||||
The function calculates the optical flow for overlapped blocks ``blockSize.width x blockSize.height`` pixels each, thus the velocity fields are smaller than the original images. For every block in ``prev``
|
||||
the functions tries to find a similar block in ``curr`` in some neighborhood of the original block or shifted by ``(velx(x0,y0), vely(x0,y0))`` block as has been calculated by previous function call (if ``usePrevious=1``)
|
||||
The function calculates the optical flow for overlapped blocks ``block_size.width x block_size.height`` pixels each, thus the velocity fields are smaller than the original images. For every block in ``prev``
|
||||
the functions tries to find a similar block in ``curr`` in some neighborhood of the original block or shifted by ``(velx(x0,y0), vely(x0,y0))`` block as has been calculated by previous function call (if ``use_previous=1``)
|
||||
|
||||
|
||||
CalcOpticalFlowHS
|
||||
-----------------
|
||||
Calculates the optical flow for two images using Horn-Schunck algorithm.
|
||||
|
||||
.. ocv:cfunction:: void cvCalcOpticalFlowHS(const CvArr* prev, const CvArr* curr, int usePrevious, CvArr* velx, CvArr* vely, double lambda, CvTermCriteria criteria)
|
||||
.. ocv:cfunction:: void cvCalcOpticalFlowHS(const CvArr* prev, const CvArr* curr, int use_previous, CvArr* velx, CvArr* vely, double lambda, CvTermCriteria criteria)
|
||||
|
||||
.. ocv:pyoldfunction:: cv.CalcOpticalFlowHS(prev, curr, usePrevious, velx, vely, lambda, criteria)-> None
|
||||
|
||||
:param prev: First image, 8-bit, single-channel
|
||||
:param prev: First image, 8-bit, single-channel
|
||||
|
||||
:param curr: Second image, 8-bit, single-channel
|
||||
:param curr: Second image, 8-bit, single-channel
|
||||
|
||||
:param usePrevious: Flag that specifies whether to use the input velocity as initial approximations or not.
|
||||
:param use_previous: Flag that specifies whether to use the input velocity as initial approximations or not.
|
||||
|
||||
:param velx: Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
|
||||
:param velx: Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
|
||||
|
||||
:param vely: Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
|
||||
:param vely: Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
|
||||
|
||||
:param lambda: Smoothness weight. The larger it is, the smoother optical flow map you get.
|
||||
|
||||
:param criteria: Criteria of termination of velocity computing
|
||||
:param criteria: Criteria of termination of velocity computing
|
||||
|
||||
The function computes the flow for every pixel of the first input image using the Horn and Schunck algorithm [Horn81]_. The function is obsolete. To track sparse features, use :ocv:func:`calcOpticalFlowPyrLK`. To track all the pixels, use :ocv:func:`calcOpticalFlowFarneback`.
|
||||
|
||||
@@ -69,19 +69,19 @@ CalcOpticalFlowLK
|
||||
|
||||
Calculates the optical flow for two images using Lucas-Kanade algorithm.
|
||||
|
||||
.. ocv:cfunction:: void cvCalcOpticalFlowLK( const CvArr* prev, const CvArr* curr, CvSize winSize, CvArr* velx, CvArr* vely )
|
||||
.. ocv:cfunction:: void cvCalcOpticalFlowLK( const CvArr* prev, const CvArr* curr, CvSize win_size, CvArr* velx, CvArr* vely )
|
||||
|
||||
.. ocv:pyoldfunction:: cv.CalcOpticalFlowLK(prev, curr, winSize, velx, vely)-> None
|
||||
|
||||
:param prev: First image, 8-bit, single-channel
|
||||
:param prev: First image, 8-bit, single-channel
|
||||
|
||||
:param curr: Second image, 8-bit, single-channel
|
||||
:param curr: Second image, 8-bit, single-channel
|
||||
|
||||
:param winSize: Size of the averaging window used for grouping pixels
|
||||
:param win_size: Size of the averaging window used for grouping pixels
|
||||
|
||||
:param velx: Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
|
||||
:param velx: Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
|
||||
|
||||
:param vely: Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
|
||||
:param vely: Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
|
||||
|
||||
The function computes the flow for every pixel of the first input image using the Lucas and Kanade algorithm [Lucas81]_. The function is obsolete. To track sparse features, use :ocv:func:`calcOpticalFlowPyrLK`. To track all the pixels, use :ocv:func:`calcOpticalFlowFarneback`.
|
||||
|
||||
|
@@ -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.
|
||||
|
||||
|
Reference in New Issue
Block a user