@ -9,10 +9,10 @@ FAB-MAP is an approach to appearance-based place recognition. FAB-MAP compares i
openFABMAP requires training data (e.g. a collection of images from a similar but not identical environment) to construct a visual vocabulary for the visual bag-of-words model, along with a Chow-Liu tree representation of feature likelihood and for use in the Sampled new place method (see below).
FabMap
of2::FabMap
--------------------
..ocv:class:: FabMap
..ocv:class::of2::FabMap
The main FabMap class performs the comparison between visual bags-of-words extracted from one or more images. The FabMap class is instantiated as one of the four inherited FabMap classes (FabMap1, FabMapLUT, FabMapFBO, FabMap2). Each inherited class performs the comparison differently based on algorithm iterations as published (see each class below for specifics). A Chow-Liu tree, detector model parameters and some option flags are common to all Fabmap variants and are supplied on class creation. Training data (visual bag-of-words) is supplied to the class if using the SAMPLED new place method. Test data (visual bag-of-words) is supplied as images to which query bag-of-words are compared against. The common flags are listed below: ::
@ -149,10 +149,10 @@ The inverted index FAB-MAP as in [IJRR2010]_. This version of FAB-MAP is the fas
..[ICRA2011] A. Glover, et al., "OpenFABMAP: An Open Source Toolbox for Appearance-based Loop Closure Detection," in IEEE International Conference on Robotics and Automation, St Paul, Minnesota, 2011
ImageMatch
of2::IMatch
--------------------
..ocv:struct:: IMatch
..ocv:struct::of2::IMatch
FAB-MAP comparison results are stored in a vector of IMatch structs. Each IMatch structure provides the index of the provided query bag-of-words, the index of the test bag-of-words, the raw log-likelihood of the match (independent of other comparisons), and the match probability (normalised over other comparison likelihoods).
@ -180,48 +180,48 @@ FAB-MAP comparison results are stored in a vector of IMatch structs. Each IMatch
};
Chow-LiuTree
of2::ChowLiuTree
--------------------
..ocv:class:: ChowLiuTree
..ocv:class::of2::ChowLiuTree
The Chow-Liu tree is a probabilistic model of the environment in terms of feature occurance and co-occurance. The Chow-Liu tree is a form of Bayesian network. FAB-MAP uses the model when calculating bag-of-words similarity by taking into account feature saliency. Training data is provided to the ChowLiuTree class in the form of bag-of-words image descriptors. The make function produces a cv::Mat that encodes the tree structure.
Returns a vector containing multiple bag-of-words image descriptors
..ocv:function:: Mat make(double infoThreshold = 0.0)
..ocv:function:: Mat of2::ChowLiuTree::make(double infoThreshold = 0.0)
:param infoThreshold:a threshold can be set to reduce the amount of memory used when making the Chow-Liu tree, which can occur with large vocabulary sizes. This function can fail if the threshold is set too high. If memory is an issue the value must be set by trial and error (~0.0005)
BOWMSCTrainer
of2::BOWMSCTrainer
--------------------
..ocv:class:: BOWMSCTrainer : public BOWTrainer
..ocv:class::of2::BOWMSCTrainer : public of2::BOWTrainer
BOWMSCTrainer is a custom clustering algorithm used to produce the feature vocabulary required to create bag-of-words representations. The algorithm is an implementation of [AVC2007]_. Arguments against using K-means for the FAB-MAP algorithm are discussed in [IJRR2010]_. The BOWMSCTrainer inherits from the cv::BOWTrainer class, overwriting the cluster function.
..ocv:cfunction:: void cvEigenVV( CvArr* mat, CvArr* evects, CvArr* evals, double eps=0, int lowindex=-1, int highindex=-1 )
@ -2283,7 +2283,7 @@ PCA constructors
* **CV_PCA_DATA_AS_COL** indicates that the input samples are stored as matrix columns.
:param maxComponents:maximum number of components that PCA should retain; by default, all the components are retained.
:param retainedVariance:Percentage of variance that PCA should retain. Using this parameter will let the PCA decided how many components to retain but it will always keep at least 2.
The default constructor initializes an empty PCA structure. The other constructors initialize the structure and call
@ -2297,10 +2297,12 @@ Performs Principal Component Analysis of the supplied dataset.
..ocv:function:: PCA& PCA::operator()(InputArray data, InputArray mean, int flags, int maxComponents=0)
..ocv:function:: PCA& PCA::operator()(InputArray data, InputArray mean, int flags, double retainedVariance)
..ocv:function:: PCA& PCA::computeVar(InputArray data, InputArray mean, int flags, double retainedVariance)
:param data:input samples stored as the matrix rows or as the matrix columns.
:param mean:optional mean value; if the matrix is empty (``noArray()``), the mean is computed from the data.
@ -2312,7 +2314,7 @@ Performs Principal Component Analysis of the supplied dataset.
* **CV_PCA_DATA_AS_COL** indicates that the input samples are stored as matrix columns.
:param maxComponents:maximum number of components that PCA should retain; by default, all the components are retained.
:param retainedVariance:Percentage of variance that PCA should retain. Using this parameter will let the PCA decided how many components to retain but it will always keep at least 2.
The operator performs PCA of the supplied dataset. It is safe to reuse the same PCA structure for multiple datasets. That is, if the structure has been previously used with another dataset, the existing internal data is reclaimed and the new ``eigenvalues``, ``eigenvectors`` , and ``mean`` are allocated and computed.
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches between descriptor sets. ::
@ -478,67 +478,67 @@ Brute-force descriptor matcher. For each descriptor in the first set, this match
};
The class ``BFMatcher_GPU`` has an interface similar to the class :ocv:class:`DescriptorMatcher`. It has two groups of ``match`` methods: for matching descriptors of one image with another image or with an image set. Also, all functions have an alternative to save results either to the GPU memory or to the CPU memory.
The class ``BruteForceMatcher_GPU_base`` has an interface similar to the class :ocv:class:`DescriptorMatcher`. It has two groups of ``match`` methods: for matching descriptors of one image with another image or with an image set. Also, all functions have an alternative to save results either to the GPU memory or to the CPU memory.
Performs a GPU collection of train descriptors and masks in a suitable format for the :ocv:func:`gpu::BFMatcher_GPU::matchCollection` function.
Performs a GPU collection of train descriptors and masks in a suitable format for the :ocv:func:`gpu::BruteForceMatcher_GPU_base::matchCollection` function.
Downloads matrices obtained via :ocv:func:`gpu::BFMatcher_GPU::matchSingle` or :ocv:func:`gpu::BFMatcher_GPU::matchCollection` to vector with :ocv:class:`DMatch`.
Downloads matrices obtained via :ocv:func:`gpu::BruteForceMatcher_GPU_base::matchSingle` or :ocv:func:`gpu::BruteForceMatcher_GPU_base::matchCollection` to vector with :ocv:class:`DMatch`.
Converts matrices obtained via :ocv:func:`gpu::BFMatcher_GPU::matchSingle` or :ocv:func:`gpu::BFMatcher_GPU::matchCollection` to vector with :ocv:class:`DMatch`.
Converts matrices obtained via :ocv:func:`gpu::BruteForceMatcher_GPU_base::matchSingle` or :ocv:func:`gpu::BruteForceMatcher_GPU_base::matchCollection` to vector with :ocv:class:`DMatch`.
@ -560,41 +560,41 @@ The third variant of the method stores the results in GPU memory.
gpu::BFMatcher_GPU::knnMatchDownload
gpu::BruteForceMatcher_GPU_base::knnMatchDownload
------------------------------------------------
Downloads matrices obtained via :ocv:func:`gpu::BFMatcher_GPU::knnMatchSingle` or :ocv:func:`gpu::BFMatcher_GPU::knnMatch2Collection` to vector with :ocv:class:`DMatch`.
Downloads matrices obtained via :ocv:func:`gpu::BruteForceMatcher_GPU_base::knnMatchSingle` or :ocv:func:`gpu::BruteForceMatcher_GPU_base::knnMatch2Collection` to vector with :ocv:class:`DMatch`.
If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors.
gpu::BFMatcher_GPU::knnMatchConvert
gpu::BruteForceMatcher_GPU_base::knnMatchConvert
------------------------------------------------
Converts matrices obtained via :ocv:func:`gpu::BFMatcher_GPU::knnMatchSingle` or :ocv:func:`gpu::BFMatcher_GPU::knnMatch2Collection` to CPU vector with :ocv:class:`DMatch`.
Converts matrices obtained via :ocv:func:`gpu::BruteForceMatcher_GPU_base::knnMatchSingle` or :ocv:func:`gpu::BruteForceMatcher_GPU_base::knnMatch2Collection` to CPU vector with :ocv:class:`DMatch`.
Downloads matrices obtained via :ocv:func:`gpu::BFMatcher_GPU::radiusMatchSingle` or :ocv:func:`gpu::BFMatcher_GPU::radiusMatchCollection` to vector with :ocv:class:`DMatch`.
Downloads matrices obtained via :ocv:func:`gpu::BruteForceMatcher_GPU_base::radiusMatchSingle` or :ocv:func:`gpu::BruteForceMatcher_GPU_base::radiusMatchCollection` to vector with :ocv:class:`DMatch`.
Converts matrices obtained via :ocv:func:`gpu::BFMatcher_GPU::radiusMatchSingle` or :ocv:func:`gpu::BFMatcher_GPU::radiusMatchCollection` to vector with :ocv:class:`DMatch`.
Converts matrices obtained via :ocv:func:`gpu::BruteForceMatcher_GPU_base::radiusMatchSingle` or :ocv:func:`gpu::BruteForceMatcher_GPU_base::radiusMatchCollection` to vector with :ocv:class:`DMatch`.
Perform image denoising using Non-local Means Denoising algorithm http://www.ipol.im/pub/algo/bcm_non_local_means_denoising with several computational optimizations. Noise expected to be a gaussian white noise
..ocv:function:: void gpu::FastNonLocalMeansDenoising::simpleMethod(const GpuMat& src, GpuMat& dst, float h, int search_window = 21, int block_size = 7, Stream& s = Stream::Null());
..ocv:function:: void gpu::FastNonLocalMeansDenoising::simpleMethod(const GpuMat& src, GpuMat& dst, float h, int search_window = 21, int block_size = 7, Stream& s = Stream::Null())
:param src:Input 8-bit 1-channel, 2-channel or 3-channel image.
:param dst:Output image with the same size and type as ``src`` .
:param h:Parameter regulating filter strength. Big h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise
:param search_window:Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd. Affect performance linearly: greater search_window - greater denoising time. Recommended value 21 pixels
:param block_size:Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels
:param stream:Stream for the asynchronous invocations.
This function expected to be applied to grayscale images. For colored images look at ``FastNonLocalMeansDenoising::labMethod``.
This function expected to be applied to grayscale images. For colored images look at ``FastNonLocalMeansDenoising::labMethod``.
..seealso::
..seealso::
:ocv:func:`fastNlMeansDenoising`
gpu::FastNonLocalMeansDenoising::labMethod()
-------------------------------------
Modification of ``FastNonLocalMeansDenoising::simpleMethod`` for color images
..ocv:function:: void gpu::FastNonLocalMeansDenoising::labMethod(const GpuMat& src, GpuMat& dst, float h_luminance, float h_color, int search_window = 21, int block_size = 7, Stream& s = Stream::Null());
..ocv:function:: void gpu::FastNonLocalMeansDenoising::labMethod(const GpuMat& src, GpuMat& dst, float h_luminance, float h_color, int search_window = 21, int block_size = 7, Stream& s = Stream::Null())
:param src:Input 8-bit 3-channel image.
:param dst:Output image with the same size and type as ``src`` .
:param h_luminance:Parameter regulating filter strength. Big h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise
:param float:The same as h but for color components. For most images value equals 10 will be enought to remove colored noise and do not distort colors
:param search_window:Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd. Affect performance linearly: greater search_window - greater denoising time. Recommended value 21 pixels
:param block_size:Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels
:param stream:Stream for the asynchronous invocations.
The function converts image to CIELAB colorspace and then separately denoise L and AB components with given h parameters using ``FastNonLocalMeansDenoising::simpleMethod`` function.
..seealso::
..seealso::
:ocv:func:`fastNlMeansDenoisingColored`
gpu::alphaComp
-------------------
Composites two images using alpha opacity values contained in each image.
Perform image denoising using Non-local Means Denoising algorithm http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/
with several computational optimizations. Noise expected to be a gaussian white noise
..ocv:function:: void fastNlMeansDenoising( Mat& src, Mat& dst, int templateWindowSize, int searchWindowSize, int h )
..ocv:function:: void fastNlMeansDenoising( InputArray src, OutputArray dst, float h=3, int templateWindowSize=7, int searchWindowSize=21 )
:param src:Input 8-bit 1-channel, 2-channel or 3-channel image.
:param dst:Output image with the same size and type as ``src`` .
:param templateWindowSize:Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels
:param searchWindowSize:Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels
:param h:Parameter regulating filter strength. Big h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at ``fastNlMeansDenoisingColored``.
Advanced usage of this functions can be manual denoising of colored image in different colorspaces.
Advanced usage of this functions can be manual denoising of colored image in different colorspaces.
Such approach is used in ``fastNlMeansDenoisingColored`` by converting image to CIELAB colorspace and then separately denoise L and AB components with different h parameter.
fastNlMeansDenoisingColored
-----------
---------------------------
Modification of ``fastNlMeansDenoising`` function for colored images
..ocv:function:: void fastNlMeansDenoisingColored( Mat& src, Mat& dst, int templateWindowSize, int searchWindowSize, int h, int hForColorComponents )
..ocv:function:: void fastNlMeansDenoisingColored( InputArray src, OutputArray dst, float h=3, float hColor=3, int templateWindowSize=7, int searchWindowSize=21 )
:param src:Input 8-bit 3-channel image.
:param dst:Output image with the same size and type as ``src`` .
:param templateWindowSize:Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels
:param searchWindowSize:Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels
:param h:Parameter regulating filter strength for luminance component. Bigger h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise
:param hForColorComponents:The same as h but for color components. For most images value equals 10 will be enought to remove colored noise and do not distort colors
@ -45,11 +45,11 @@ Modification of ``fastNlMeansDenoising`` function for colored images
The function converts image to CIELAB colorspace and then separately denoise L and AB components with given h parameters using ``fastNlMeansDenoising`` function.
fastNlMeansDenoisingMulti
-----------
-------------------------
Modification of ``fastNlMeansDenoising`` function for images sequence where consequtive images have been captured in small period of time. For example video. This version of the function is for grayscale images or for manual manipulation with colorspaces.
For more details see http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131.6394
..ocv:function:: void fastNlMeansDenoisingMulti( const std::vector<Mat>& srcImgs, int imgToDenoiseIndex, int temporalWindowSize, Mat& dst, int templateWindowSize, int searchWindowSize, int h)
..ocv:function:: void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst, int imgToDenoiseIndex, int temporalWindowSize, float h=3, int templateWindowSize=7, int searchWindowSize=21 )
:param srcImgs:Input 8-bit 1-channel, 2-channel or 3-channel images sequence. All images should have the same type and size.
@ -60,16 +60,16 @@ For more details see http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131
:param dst:Output image with the same size and type as ``srcImgs`` images.
:param templateWindowSize:Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels
:param searchWindowSize:Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels
:param h:Parameter regulating filter strength for luminance component. Bigger h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise
fastNlMeansDenoisingColoredMulti
-----------
--------------------------------
Modification of ``fastNlMeansDenoisingMulti`` function for colored images sequences
..ocv:function:: void fastNlMeansDenoisingColoredMulti( const std::vector<Mat>& srcImgs, int imgToDenoiseIndex, int temporalWindowSize, Mat& dst, int templateWindowSize, int searchWindowSize, int h, int hForColorComponents)
..ocv:function:: void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst, int imgToDenoiseIndex, int temporalWindowSize, float h=3, float hColor=3, int templateWindowSize=7, int searchWindowSize=21 )
:param srcImgs:Input 8-bit 3-channel images sequence. All images should have the same type and size.
@ -80,9 +80,9 @@ Modification of ``fastNlMeansDenoisingMulti`` function for colored images sequen
:param dst:Output image with the same size and type as ``srcImgs`` images.
:param templateWindowSize:Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels
:param searchWindowSize:Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels
:param h:Parameter regulating filter strength for luminance component. Bigger h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise.
:param hForColorComponents:The same as h but for color components.