diff --git a/CMakeLists.txt b/CMakeLists.txt index 13d95dba5..cee561185 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ endif() # ---------------------------------------------------------------------------- # Current version number: # ---------------------------------------------------------------------------- -set(OPENCV_VERSION "2.2.0") +set(OPENCV_VERSION "2.2.9") string(REGEX MATCHALL "[0-9]" OPENCV_VERSION_PARTS "${OPENCV_VERSION}") diff --git a/docroot/opencv1/py/conf.py b/docroot/opencv1/py/conf.py index 4f9d64497..0742d4a47 100644 --- a/docroot/opencv1/py/conf.py +++ b/docroot/opencv1/py/conf.py @@ -48,7 +48,7 @@ copyright = u'2010, authors' # The short X.Y version. version = '2.2' # The full version, including alpha/beta/rc tags. -release = '2.2' +release = '2.2.9' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/modules/calib3d/include/opencv2/calib3d/calib3d.hpp b/modules/calib3d/include/opencv2/calib3d/calib3d.hpp index 4a394f0fd..dcd9832d3 100644 --- a/modules/calib3d/include/opencv2/calib3d/calib3d.hpp +++ b/modules/calib3d/include/opencv2/calib3d/calib3d.hpp @@ -623,11 +623,14 @@ CV_EXPORTS_W Mat getOptimalNewCameraMatrix( const InputArray& cameraMatrix, cons CV_OUT Rect* validPixROI=0); //! converts point coordinates from normal pixel coordinates to homogeneous coordinates ((x,y)->(x,y,1)) -CV_EXPORTS void convertPointsToHomogeneous( const InputArray& src, OutputArray dst ); +CV_EXPORTS_W void convertPointsToHomogeneous( const InputArray& src, OutputArray dst ); //! converts point coordinates from homogeneous to normal pixel coordinates ((x,y,z)->(x/z, y/z)) -CV_EXPORTS void convertPointsFromHomogeneous( const InputArray& src, OutputArray dst ); +CV_EXPORTS_W void convertPointsFromHomogeneous( const InputArray& src, OutputArray dst ); +//! for backward compatibility +CV_EXPORTS void convertPointsHomogeneous( const InputArray& src, OutputArray dst ); + //! the algorithm for finding fundamental matrix enum { diff --git a/modules/calib3d/src/fundam.cpp b/modules/calib3d/src/fundam.cpp index 98b3b66ed..198912dd1 100644 --- a/modules/calib3d/src/fundam.cpp +++ b/modules/calib3d/src/fundam.cpp @@ -1148,4 +1148,15 @@ void cv::convertPointsToHomogeneous( const InputArray& _src, OutputArray _dst ) cvConvertPointsHomogeneous(&c_src, &c_dst); } +void cv::convertPointsHomogeneous( const InputArray& _src, OutputArray _dst ) +{ + int stype = _src.type(), dtype = _dst.type(); + CV_Assert( _dst.fixedType() ); + + if( CV_MAT_CN(stype) > CV_MAT_CN(dtype) ) + convertPointsFromHomogeneous(_src, _dst); + else + convertPointsToHomogeneous(_src, _dst); +} + /* End of file. */ diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index 0b52ba2d3..5ab8c8819 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -1131,27 +1131,30 @@ operator - (const Vec<_Tp, cn>& a, const Vec<_Tp, cn>& b) return c -= b; } -template static inline -Vec<_Tp, 2>& operator *= (Vec<_Tp, 2>& a, _Tp alpha) +template static inline +Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, _Tp alpha) { - a[0] *= alpha; a[1] *= alpha; + for( int i = 0; i < cn; i++ ) + a[i] *= alpha; return a; } -template static inline -Vec<_Tp, 3>& operator *= (Vec<_Tp, 3>& a, _Tp alpha) +template static inline +Vec& operator *= (Vec& a, double alpha) { - a[0] *= alpha; a[1] *= alpha; a[2] *= alpha; + for( int i = 0; i < cn; i++ ) + a[i] *= (float)alpha; return a; } -template static inline -Vec<_Tp, 4>& operator *= (Vec<_Tp, 4>& a, _Tp alpha) +template static inline +Vec& operator *= (Vec& a, int alpha) { - a[0] *= alpha; a[1] *= alpha; a[2] *= alpha; a[3] *= alpha; + for( int i = 0; i < cn; i++ ) + a[i] *= (float)alpha; return a; } - + template static inline Vec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, _Tp alpha) { @@ -1162,10 +1165,38 @@ operator * (const Vec<_Tp, cn>& a, _Tp alpha) template static inline Vec<_Tp, cn> operator * (_Tp alpha, const Vec<_Tp, cn>& a) { - return a * alpha; + Vec<_Tp, cn> c = a; + return c *= alpha; +} + +template static inline Vec +operator * (double alpha, const Vec& a) +{ + Vec c = a; + return c *= (float)alpha; +} + +template static inline Vec +operator * (const Vec& a, double alpha) +{ + Vec c = a; + return c *= (float)alpha; +} + +template static inline Vec +operator * (int alpha, const Vec& a) +{ + Vec c = a; + return c *= (float)alpha; +} + +template static inline Vec +operator * (const Vec& a, int alpha) +{ + Vec c = a; + return c *= (float)alpha; } - template static inline Vec<_Tp, 4> operator * (const Vec<_Tp, 4>& a, const Vec<_Tp, 4>& b) { diff --git a/modules/core/include/opencv2/core/version.hpp b/modules/core/include/opencv2/core/version.hpp index dfd35379e..128bb4504 100644 --- a/modules/core/include/opencv2/core/version.hpp +++ b/modules/core/include/opencv2/core/version.hpp @@ -49,7 +49,7 @@ #define CV_MAJOR_VERSION 2 #define CV_MINOR_VERSION 2 -#define CV_SUBMINOR_VERSION 0 +#define CV_SUBMINOR_VERSION 9 #define CVAUX_STR_EXP(__A) #__A #define CVAUX_STR(__A) CVAUX_STR_EXP(__A)