Nghia Ho 11 years ago
commit d194bb6143
  1. 2
      modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst
  2. 28
      modules/core/include/opencv2/core/base.hpp
  3. 4
      modules/core/include/opencv2/core/core_c.h
  4. 2
      modules/core/include/opencv2/core/cvdef.h
  5. 4
      modules/core/include/opencv2/core/cvstd.hpp
  6. 6
      modules/core/include/opencv2/core/mat.hpp
  7. 4
      modules/core/include/opencv2/core/matx.hpp
  8. 12
      modules/core/include/opencv2/core/types.hpp
  9. 2
      modules/core/include/opencv2/core/utility.hpp
  10. 2
      modules/features2d/include/opencv2/features2d.hpp
  11. 3
      modules/highgui/doc/user_interface.rst
  12. 47
      modules/imgproc/doc/filtering.rst
  13. 1
      modules/imgproc/doc/miscellaneous_transformations.rst
  14. 8
      modules/photo/doc/inpainting.rst
  15. 10
      modules/stitching/src/motion_estimators.cpp
  16. 2
      modules/video/doc/motion_analysis_and_object_tracking.rst

@ -286,6 +286,8 @@ For points in an image of a stereo pair, computes the corresponding epilines in
.. ocv:cfunction:: void cvComputeCorrespondEpilines( const CvMat* points, int which_image, const CvMat* fundamental_matrix, CvMat* correspondent_lines )
.. ocv:pyfunction:: cv2.computeCorrespondEpilines(points, whichImage, F[, lines]) -> lines
:param points: Input points. :math:`N \times 1` or :math:`1 \times N` matrix of type ``CV_32FC2`` or ``vector<Point2f>`` .
:param whichImage: Index of the image (1 or 2) that contains the ``points`` .

@ -449,15 +449,15 @@ _AccTp normInf(const _Tp* a, const _Tp* b, int n)
////////////////// forward declarations for important OpenCV types //////////////////
template<typename _Tp, int cn> class CV_EXPORTS Vec;
template<typename _Tp, int m, int n> class CV_EXPORTS Matx;
template<typename _Tp, int cn> class Vec;
template<typename _Tp, int m, int n> class Matx;
template<typename _Tp> class CV_EXPORTS Complex;
template<typename _Tp> class CV_EXPORTS Point_;
template<typename _Tp> class CV_EXPORTS Point3_;
template<typename _Tp> class CV_EXPORTS Size_;
template<typename _Tp> class CV_EXPORTS Rect_;
template<typename _Tp> class CV_EXPORTS Scalar_;
template<typename _Tp> class Complex;
template<typename _Tp> class Point_;
template<typename _Tp> class Point3_;
template<typename _Tp> class Size_;
template<typename _Tp> class Rect_;
template<typename _Tp> class Scalar_;
class CV_EXPORTS RotatedRect;
class CV_EXPORTS Range;
@ -472,16 +472,16 @@ class CV_EXPORTS MatExpr;
class CV_EXPORTS SparseMat;
typedef Mat MatND;
template<typename _Tp> class CV_EXPORTS Mat_;
template<typename _Tp> class CV_EXPORTS SparseMat_;
template<typename _Tp> class Mat_;
template<typename _Tp> class SparseMat_;
class CV_EXPORTS MatConstIterator;
class CV_EXPORTS SparseMatIterator;
class CV_EXPORTS SparseMatConstIterator;
template<typename _Tp> class CV_EXPORTS MatIterator_;
template<typename _Tp> class CV_EXPORTS MatConstIterator_;
template<typename _Tp> class CV_EXPORTS SparseMatIterator_;
template<typename _Tp> class CV_EXPORTS SparseMatConstIterator_;
template<typename _Tp> class MatIterator_;
template<typename _Tp> class MatConstIterator_;
template<typename _Tp> class SparseMatIterator_;
template<typename _Tp> class SparseMatConstIterator_;
namespace ogl
{

@ -1906,7 +1906,7 @@ typedef Ptr<CvMemStorage> MemStorage;
i.e. no constructors or destructors
are called for the sequence elements.
*/
template<typename _Tp> class CV_EXPORTS Seq
template<typename _Tp> class Seq
{
public:
typedef SeqIterator<_Tp> iterator;
@ -1989,7 +1989,7 @@ public:
/*!
STL-style Sequence Iterator inherited from the CvSeqReader structure
*/
template<typename _Tp> class CV_EXPORTS SeqIterator : public CvSeqReader
template<typename _Tp> class SeqIterator : public CvSeqReader
{
public:
//! the default constructor

@ -201,8 +201,10 @@
#if !defined _MSC_VER && !defined __BORLANDC__
# if defined __cplusplus && __cplusplus >= 201103L
# include <cstdint>
typedef std::uint32_t uint;
# else
# include <stdint.h>
typedef uint32_t uint;
# endif
#else
typedef unsigned uint;

@ -127,7 +127,7 @@ CV_EXPORTS void fastFree(void* ptr);
/*!
The STL-compilant memory Allocator based on cv::fastMalloc() and cv::fastFree()
*/
template<typename _Tp> class CV_EXPORTS Allocator
template<typename _Tp> class Allocator
{
public:
typedef _Tp value_type;
@ -183,7 +183,7 @@ public:
\note{Another good property of the class is that the operations on the reference counter are atomic,
i.e. it is safe to use the class in multi-threaded applications}
*/
template<typename _Tp> class CV_EXPORTS Ptr
template<typename _Tp> class Ptr
{
public:
//! empty constructor

@ -831,7 +831,7 @@ protected:
img(i,j)[2] ^= (uchar)(i ^ j); // img(y,x)[c] accesses c-th channel of the pixel (x,y)
\endcode
*/
template<typename _Tp> class CV_EXPORTS Mat_ : public Mat
template<typename _Tp> class Mat_ : public Mat
{
public:
typedef _Tp value_type;
@ -1358,7 +1358,7 @@ public:
m_.ref(2) += m_(3); // equivalent to m.ref<int>(2) += m.value<int>(3);
\endcode
*/
template<typename _Tp> class CV_EXPORTS SparseMat_ : public SparseMat
template<typename _Tp> class SparseMat_ : public SparseMat
{
public:
typedef SparseMatIterator_<_Tp> iterator;
@ -1730,7 +1730,7 @@ public:
This is the derived from cv::SparseMatConstIterator_ class that
introduces more convenient operator *() for accessing the current element.
*/
template<typename _Tp> class CV_EXPORTS SparseMatIterator_ : public SparseMatConstIterator_<_Tp>
template<typename _Tp> class SparseMatIterator_ : public SparseMatConstIterator_<_Tp>
{
public:

@ -81,7 +81,7 @@ struct CV_EXPORTS Matx_DivOp {};
struct CV_EXPORTS Matx_MatMulOp {};
struct CV_EXPORTS Matx_TOp {};
template<typename _Tp, int m, int n> class CV_EXPORTS Matx
template<typename _Tp, int m, int n> class Matx
{
public:
enum { depth = DataType<_Tp>::depth,
@ -286,7 +286,7 @@ template<typename _Tp, int m, int n> static double norm(const Matx<_Tp, m, n>& M
In addition to the universal notation like Vec<float, 3>, you can use shorter aliases
for the most popular specialized variants of Vec, e.g. Vec3f ~ Vec<float, 3>.
*/
template<typename _Tp, int cn> class CV_EXPORTS Vec : public Matx<_Tp, cn, 1>
template<typename _Tp, int cn> class Vec : public Matx<_Tp, cn, 1>
{
public:
typedef _Tp value_type;

@ -68,7 +68,7 @@ namespace cv
more convenient access to the real and imaginary parts using through the simple field access, as opposite
to std::complex::real() and std::complex::imag().
*/
template<typename _Tp> class CV_EXPORTS Complex
template<typename _Tp> class Complex
{
public:
@ -120,7 +120,7 @@ public:
as a template parameter. There are a few shorter aliases available for user convenience.
See cv::Point, cv::Point2i, cv::Point2f and cv::Point2d.
*/
template<typename _Tp> class CV_EXPORTS Point_
template<typename _Tp> class Point_
{
public:
typedef _Tp value_type;
@ -191,7 +191,7 @@ public:
\see cv::Point3i, cv::Point3f and cv::Point3d
*/
template<typename _Tp> class CV_EXPORTS Point3_
template<typename _Tp> class Point3_
{
public:
typedef _Tp value_type;
@ -256,7 +256,7 @@ public:
The class represents the size of a 2D rectangle, image size, matrix size etc.
Normally, cv::Size ~ cv::Size_<int> is used.
*/
template<typename _Tp> class CV_EXPORTS Size_
template<typename _Tp> class Size_
{
public:
typedef _Tp value_type;
@ -314,7 +314,7 @@ public:
The class represents a 2D rectangle with coordinates of the specified data type.
Normally, cv::Rect ~ cv::Rect_<int> is used.
*/
template<typename _Tp> class CV_EXPORTS Rect_
template<typename _Tp> class Rect_
{
public:
typedef _Tp value_type;
@ -470,7 +470,7 @@ public:
This is partially specialized cv::Vec class with the number of elements = 4, i.e. a short vector of four elements.
Normally, cv::Scalar ~ cv::Scalar_<double> is used.
*/
template<typename _Tp> class CV_EXPORTS Scalar_ : public Vec<_Tp, 4>
template<typename _Tp> class Scalar_ : public Vec<_Tp, 4>
{
public:
//! various constructors

@ -80,7 +80,7 @@ namespace cv
}
\endcode
*/
template<typename _Tp, size_t fixed_size = 1024/sizeof(_Tp)+8> class CV_EXPORTS AutoBuffer
template<typename _Tp, size_t fixed_size = 1024/sizeof(_Tp)+8> class AutoBuffer
{
public:
typedef _Tp value_type;

@ -961,7 +961,7 @@ struct CV_EXPORTS Hamming
typedef Hamming HammingLUT;
template<int cellsize> struct CV_EXPORTS HammingMultilevel
template<int cellsize> struct HammingMultilevel
{
enum { normType = NORM_HAMMING + (cellsize>1) };
typedef unsigned char ValueType;

@ -81,6 +81,9 @@ The function ``imshow`` displays an image in the specified window. If the window
If window was created with OpenGL support, ``imshow`` also support :ocv:class:`ogl::Buffer` , :ocv:class:`ogl::Texture2D` and :ocv:class:`gpu::GpuMat` as input.
.. note:: This function should be followed by ``waitKey`` function which displays the image for specified milliseconds. Otherwise, it won't display the image.
namedWindow
---------------
Creates a window.

@ -759,7 +759,7 @@ Dilates an image by using a specific structuring element.
:param dst: output image of the same size and type as ``src``.
:param element: structuring element used for dilation; if ``element=Mat()`` , a ``3 x 3`` rectangular structuring element is used.
:param kernel: structuring element used for dilation; if ``element=Mat()`` , a ``3 x 3`` rectangular structuring element is used. Kernel can be created using :ocv:func:`getStructuringElement`
:param anchor: position of the anchor within the element; default value ``(-1, -1)`` means that the anchor is at the element center.
@ -782,11 +782,16 @@ The function supports the in-place mode. Dilation can be applied several ( ``ite
:ocv:func:`erode`,
:ocv:func:`morphologyEx`,
:ocv:func:`createMorphologyFilter`
:ocv:func:`getStructuringElement`
.. Sample code::
* : An example using the morphological dilate operation can be found at opencv_source_code/samples/cpp/morphology2.cpp
erode
-----
Erodes an image by using a specific structuring element.
@ -801,7 +806,7 @@ Erodes an image by using a specific structuring element.
:param dst: output image of the same size and type as ``src``.
:param element: structuring element used for erosion; if ``element=Mat()`` , a ``3 x 3`` rectangular structuring element is used.
:param kernel: structuring element used for erosion; if ``element=Mat()`` , a ``3 x 3`` rectangular structuring element is used. Kernel can be created using :ocv:func:`getStructuringElement`.
:param anchor: position of the anchor within the element; default value ``(-1, -1)`` means that the anchor is at the element center.
@ -823,7 +828,8 @@ The function supports the in-place mode. Erosion can be applied several ( ``iter
:ocv:func:`dilate`,
:ocv:func:`morphologyEx`,
:ocv:func:`createMorphologyFilter`
:ocv:func:`createMorphologyFilter`,
:ocv:func:`getStructuringElement`
.. Sample code::
@ -956,7 +962,7 @@ Returns Gaussian filter coefficients.
:param ksize: Aperture size. It should be odd ( :math:`\texttt{ksize} \mod 2 = 1` ) and positive.
:param sigma: Gaussian standard deviation. If it is non-positive, it is computed from ``ksize`` as \ ``sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8`` .
:param ktype: Type of filter coefficients. It can be ``CV_32f`` or ``CV_64F`` .
:param ktype: Type of filter coefficients. It can be ``CV_32F`` or ``CV_64F`` .
The function computes and returns the
:math:`\texttt{ksize} \times 1` matrix of Gaussian filter coefficients:
@ -985,6 +991,32 @@ Two of such generated kernels can be passed to
getGaborKernel
-----------------
Returns Gabor filter coefficients.
.. ocv:function:: Mat getGaborKernel( Size ksize, double sigma, double theta, double lambd, double gamma, double psi = CV_PI*0.5, int ktype = CV_64F )
.. ocv:pyfunction:: cv2.getGaborKernel(ksize, sigma, theta, lambd, gamma[, psi[, ktype]]) -> retval
:param ksize: Size of the filter returned.
:param sigma: Standard deviation of the gaussian envelope.
:param theta: Orientation of the normal to the parallel stripes of a Gabor function.
:param lambd: Wavelength of the sinusoidal factor.
:param gamma: Spatial aspect ratio.
:param psi: Phase offset.
:param ktype: Type of filter coefficients. It can be ``CV_32F`` or ``CV_64F`` .
For more details about gabor filter equations and parameters, see: `Gabor Filter <http://en.wikipedia.org/wiki/Gabor_filter>`_.
getKernelType
-------------
Returns the kernel type.
@ -1099,7 +1131,9 @@ Performs advanced morphological transformations.
:param dst: Destination image of the same size and type as ``src`` .
:param element: Structuring element.
:param kernel: Structuring element. It can be created using :ocv:func:`getStructuringElement`.
:param anchor: Anchor position with the kernel. Negative values mean that the anchor is at the kernel center.
:param op: Type of a morphological operation that can be one of the following:
@ -1157,7 +1191,8 @@ Any of the operations can be done in-place. In case of multi-channel images, eac
:ocv:func:`dilate`,
:ocv:func:`erode`,
:ocv:func:`createMorphologyFilter`
:ocv:func:`createMorphologyFilter`,
:ocv:func:`getStructuringElement`
.. Sample code::

@ -799,7 +799,6 @@ See the sample ``grabcut.cpp`` to learn how to use the function.
.. [Meyer92] Meyer, F. *Color Image Segmentation*, ICIP92, 1992
.. [Telea04] Alexandru Telea, *An Image Inpainting Technique Based on the Fast Marching Method*. Journal of Graphics, GPU, and Game Tools 9 1, pp 23-34 (2004)
.. Sample code::

@ -23,7 +23,7 @@ Restores the selected region in an image using the region neighborhood.
:param flags: Inpainting method that could be one of the following:
* **INPAINT_NS** Navier-Stokes based method.
* **INPAINT_NS** Navier-Stokes based method [Navier01]
* **INPAINT_TELEA** Method by Alexandru Telea [Telea04]_.
@ -36,3 +36,9 @@ for more details.
* : An example using the inpainting technique can be found at opencv_source_code/samples/cpp/inpaint.cpp
* : PYTHON : An example using the inpainting technique can be found at opencv_source_code/samples/python2/inpaint.py
.. [Telea04] Telea, Alexandru. "An image inpainting technique based on the fast marching method." Journal of graphics tools 9, no. 1 (2004): 23-34.
.. [Navier01] Bertalmio, Marcelo, Andrea L. Bertozzi, and Guillermo Sapiro. "Navier-stokes, fluid dynamics, and image and video inpainting." In Computer Vision and Pattern Recognition, 2001. CVPR 2001. Proceedings of the 2001 IEEE Computer Society Conference on, vol. 1, pp. I-355. IEEE, 2001.

@ -42,13 +42,7 @@
#include "precomp.hpp"
#include "opencv2/calib3d/calib3d_c.h"
#ifdef _MSC_VER
#include <float.h>
#define isnan(x) _isnan(x)
#else
#include <math.h>
#endif
#include "opencv2/core/cvdef.h"
using namespace cv;
using namespace cv::detail;
@ -259,7 +253,7 @@ bool BundleAdjusterBase::estimate(const std::vector<ImageFeatures> &features,
bool ok = true;
for (int i = 0; i < cam_params_.rows; ++i)
{
if (isnan(cam_params_.at<double>(i,0)))
if (cvIsNaN(cam_params_.at<double>(i,0)))
{
ok = false;
break;

@ -170,6 +170,8 @@ Finds the geometric transform (warp) between two images in terms of the ECC crit
.. ocv:function:: double findTransformECC( InputArray templateImage, InputArray inputImage, InputOutputArray warpMatrix, int motionType=MOTION_AFFINE, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001))
.. ocv:pyfunction:: cv2.findTransformECC(templateImage, inputImage, warpMatrix[, motionType[, criteria]]) -> retval, warpMatrix
:param templateImage: single-channel template image; ``CV_8U`` or ``CV_32F`` array.
:param inputImage: single-channel input image which should be warped with the final ``warpMatrix`` in order to provide an image similar to ``templateImage``, same type as ``temlateImage``.

Loading…
Cancel
Save