[opencv] 05/53: Update sift.cpp

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sun Aug 27 23:27:01 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 2.4.13.3
in repository opencv.

commit f108795e2cf0059813009ccff96ae2605a5c75a2
Author: Suleyman TURKMEN <sturkmen at hotmail.com>
Date:   Thu Jan 5 19:47:34 2017 +0200

    Update sift.cpp
---
 modules/nonfree/src/sift.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/nonfree/src/sift.cpp b/modules/nonfree/src/sift.cpp
index 9ce6b98..8ecdd87 100644
--- a/modules/nonfree/src/sift.cpp
+++ b/modules/nonfree/src/sift.cpp
@@ -170,10 +170,12 @@ static Mat createInitialImage( const Mat& img, bool doubleImageSize, float sigma
 {
     Mat gray, gray_fpt;
     if( img.channels() == 3 || img.channels() == 4 )
+    {
         cvtColor(img, gray, COLOR_BGR2GRAY);
+        gray.convertTo(gray_fpt, DataType<sift_wt>::type, SIFT_FIXPT_SCALE, 0);
+    }
     else
-        img.copyTo(gray);
-    gray.convertTo(gray_fpt, DataType<sift_wt>::type, SIFT_FIXPT_SCALE, 0);
+        img.convertTo(gray_fpt, DataType<sift_wt>::type, SIFT_FIXPT_SCALE, 0);
 
     float sig_diff;
 
@@ -181,7 +183,7 @@ static Mat createInitialImage( const Mat& img, bool doubleImageSize, float sigma
     {
         sig_diff = sqrtf( std::max(sigma * sigma - SIFT_INIT_SIGMA * SIFT_INIT_SIGMA * 4, 0.01f) );
         Mat dbl;
-        resize(gray_fpt, dbl, Size(gray.cols*2, gray.rows*2), 0, 0, INTER_LINEAR);
+        resize(gray_fpt, dbl, Size(gray_fpt.cols*2, gray_fpt.rows*2), 0, 0, INTER_LINEAR);
         GaussianBlur(dbl, dbl, Size(), sig_diff, sig_diff);
         return dbl;
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list