changeset 10740:a9fd789b543e octave-forge

normxcorr2: check input that template is smaller than image
author carandraug
date Wed, 29 Aug 2012 02:56:16 +0000
parents 7ffd9112104b
children dc6d0e4f406f
files main/image/inst/normxcorr2.m
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/image/inst/normxcorr2.m	Wed Aug 29 02:45:12 2012 +0000
+++ b/main/image/inst/normxcorr2.m	Wed Aug 29 02:56:16 2012 +0000
@@ -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