fixes
authorKonstantin Matskevich <konstantin.matskevich@itseez.com>
Wed, 5 Feb 2014 05:59:04 +0000 (09:59 +0400)
committerKonstantin Matskevich <konstantin.matskevich@itseez.com>
Wed, 5 Feb 2014 05:59:04 +0000 (09:59 +0400)
modules/core/include/opencv2/core.hpp
modules/features2d/src/bagofwords.cpp
modules/features2d/src/brief.cpp
modules/features2d/src/draw.cpp
modules/features2d/src/freak.cpp

index 71beb2a..12d11b0 100644 (file)
@@ -507,11 +507,11 @@ CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev
 CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0);
 
 //! draws the line segment (pt1, pt2) in the image
-CV_EXPORTS_W void line(CV_IN_OUT InputOutputArray img, Point pt1, Point pt2, const Scalar& color,
+CV_EXPORTS_W void line(InputOutputArray img, Point pt1, Point pt2, const Scalar& color,
                      int thickness = 1, int lineType = LINE_8, int shift = 0);
 
 //! draws the rectangle outline or a solid rectangle with the opposite corners pt1 and pt2 in the image
-CV_EXPORTS_W void rectangle(CV_IN_OUT InputOutputArray img, Point pt1, Point pt2,
+CV_EXPORTS_W void rectangle(InputOutputArray img, Point pt1, Point pt2,
                           const Scalar& color, int thickness = 1,
                           int lineType = LINE_8, int shift = 0);
 
@@ -521,18 +521,18 @@ CV_EXPORTS void rectangle(CV_IN_OUT Mat& img, Rect rec,
                           int lineType = LINE_8, int shift = 0);
 
 //! draws the circle outline or a solid circle in the image
-CV_EXPORTS_W void circle(CV_IN_OUT InputOutputArray img, Point center, int radius,
+CV_EXPORTS_W void circle(InputOutputArray img, Point center, int radius,
                        const Scalar& color, int thickness = 1,
                        int lineType = LINE_8, int shift = 0);
 
 //! draws an elliptic arc, ellipse sector or a rotated ellipse in the image
-CV_EXPORTS_W void ellipse(CV_IN_OUT InputOutputArray img, Point center, Size axes,
+CV_EXPORTS_W void ellipse(InputOutputArray img, Point center, Size axes,
                         double angle, double startAngle, double endAngle,
                         const Scalar& color, int thickness = 1,
                         int lineType = LINE_8, int shift = 0);
 
 //! draws a rotated ellipse in the image
-CV_EXPORTS_W void ellipse(CV_IN_OUT InputOutputArray img, const RotatedRect& box, const Scalar& color,
+CV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color,
                         int thickness = 1, int lineType = LINE_8);
 
 //! draws a filled convex polygon in the image
index c57510a..c7cc5de 100644 (file)
@@ -187,7 +187,8 @@ void BOWImgDescriptorExtractor::compute( InputArray keypointDescriptors, InputOu
         pointIdxsOfClusters->resize(clusterCount);
     }
 
-    Mat( 1, clusterCount, descriptorType(), Scalar::all(0.0) ).copyTo(_imgDescriptor);
+    _imgDescriptor.create(1, clusterCount, descriptorType());
+    _imgDescriptor.setTo(Scalar::all(0));
 
     Mat imgDescriptor = _imgDescriptor.getMat();
 
index ebd730b..0226ffb 100644 (file)
@@ -176,7 +176,8 @@ void BriefDescriptorExtractor::computeImpl(InputArray image, std::vector<KeyPoin
     //Remove keypoints very close to the border
     KeyPointsFilter::runByImageBorder(keypoints, image.size(), PATCH_SIZE/2 + KERNEL_SIZE/2);
 
-    Mat(Mat::zeros((int)keypoints.size(), bytes_, CV_8U)).copyTo(descriptors);
+    descriptors.create((int)keypoints.size(), bytes_, CV_8U);
+    descriptors.setTo(Scalar::all(0));
     test_fn_(sum, keypoints, descriptors);
 }
 
index 7fea998..6673e46 100644 (file)
@@ -88,7 +88,7 @@ static inline void _drawKeypoint( InputOutputArray img, const KeyPoint& p, const
     }
 }
 
-void drawKeypoints( InputArray image, const std::vector<KeyPoint>& keypoints, InputOutputArray& outImage,
+void drawKeypoints( InputArray image, const std::vector<KeyPoint>& keypoints, InputOutputArray outImage,
                     const Scalar& _color, int flags )
 {
     if( !(flags & DrawMatchesFlags::DRAW_OVER_OUTIMG) )
@@ -143,7 +143,7 @@ static void _prepareImgAndDrawKeypoints( InputArray img1, const std::vector<KeyP
         outImg = Scalar::all(0);
         outImg1 = outImg( Rect(0, 0, img1size.width, img1size.height) );
         outImg2 = outImg( Rect(img1size.width, 0, img2size.width, img2size.height) );
-        printf("%d  %d\n", _outImg.size().width, _outImg.size().height);
+
         if( img1.type() == CV_8U )
             cvtColor( img1, outImg1, COLOR_GRAY2BGR );
         else
index a372695..8759efa 100644 (file)
@@ -297,7 +297,8 @@ void FREAK::computeImpl( InputArray _image, std::vector<KeyPoint>& keypoints, Ou
     if( !extAll )
     {
         // extract the best comparisons only
-        Mat(cv::Mat::zeros((int)keypoints.size(), FREAK_NB_PAIRS/8, CV_8U)).copyTo(_descriptors);
+        _descriptors.create((int)keypoints.size(), FREAK_NB_PAIRS/8, CV_8U);
+        _descriptors.setTo(Scalar::all(0));
         Mat descriptors = _descriptors.getMat();
 #if CV_SSE2
         __m128i* ptr= (__m128i*) (descriptors.data+(keypoints.size()-1)*descriptors.step[0]);
@@ -416,7 +417,8 @@ void FREAK::computeImpl( InputArray _image, std::vector<KeyPoint>& keypoints, Ou
     }
     else // extract all possible comparisons for selection
     {
-        Mat(cv::Mat::zeros((int)keypoints.size(), 128, CV_8U)).copyTo(_descriptors);
+        _descriptors.create((int)keypoints.size(), 128, CV_8U);
+        _descriptors.setTo(Scalar::all(0));
         Mat descriptors = _descriptors.getMat();
         std::bitset<1024>* ptr = (std::bitset<1024>*) (descriptors.data+(keypoints.size()-1)*descriptors.step[0]);