projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a63ab3
)
If the user passes an empty output matrix, initialize it to identity.
author
Utkarsh Sinha
<sinha.utkarsh1990@gmail.com>
Tue, 11 Apr 2017 03:43:33 +0000
(20:43 -0700)
committer
Utkarsh Sinha
<sinha.utkarsh1990@gmail.com>
Tue, 11 Apr 2017 03:43:33 +0000
(20:43 -0700)
modules/video/src/ecc.cpp
patch
|
blob
|
history
diff --git
a/modules/video/src/ecc.cpp
b/modules/video/src/ecc.cpp
index
d11419e
..
377b775
100644
(file)
--- a/
modules/video/src/ecc.cpp
+++ b/
modules/video/src/ecc.cpp
@@
-325,6
+325,16
@@
double cv::findTransformECC(InputArray templateImage,
CV_Assert(!src.empty());
CV_Assert(!dst.empty());
+ // If the user passed an un-initialized warpMatrix, initialize to identity
+ if(map.empty()) {
+ int rowCount = 2;
+ if(motionType == MOTION_HOMOGRAPHY)
+ rowCount = 3;
+
+ warpMatrix.create(rowCount, 3, CV_32FC1);
+ map = warpMatrix.getMat();
+ map = Mat::eye(rowCount, 3, CV_32F);
+ }
if( ! (src.type()==dst.type()))
CV_Error( Error::StsUnmatchedFormats, "Both input images must have the same data type" );