changeset 567:839159700195

normxcorr2: check input that template is smaller than image
author carandraug
date Wed, 29 Aug 2012 02:56:16 +0000
parents 7b04422533f1
children e5e5b62b929a
files inst/normxcorr2.m
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/inst/normxcorr2.m
+++ b/inst/normxcorr2.m
@@ -26,6 +26,8 @@
 function cc = normxcorr2 (temp, img)
   if (nargin != 2)
     print_usage;
+  elseif (rows (temp) > rows (img) || columns (temp) > columns (img))
+    error ("normxcorr2: template must be same size or smaller than image");
   endif
   cc = xcorr2 (img, temp, "coeff");
 endfunction