changeset 528:636b9e92019c

normxcorr2: new function is wrapper for xcorr2 from signal package
author carandraug
date Fri, 16 Dec 2011 20:33:08 +0000
parents 3a3ba9169c05
children 99008b4a3f2a
files DESCRIPTION INDEX NEWS inst/normxcorr2.m
diffstat 4 files changed, 34 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -9,7 +9,7 @@
  The package also provides functions for feature extraction, image
  statistics, spatial and geometric transformations, morphological
  operations, linear filtering, and much more.
-Depends: octave (>= 3.4.0)
+Depends: octave (>= 3.4.0), signal
 Autoload: yes
 License: GPL version 2 or later
 Url: http://octave.sf.net
--- a/INDEX
+++ b/INDEX
@@ -16,6 +16,7 @@
  hough_line
  hough_circle
  immaximas
+ normxcorr2
  rangefilt
  regionprops
  stdfilt
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@
       iptchecknargin
       iptcheckstrs
       iptnum2ordinal
+      normxcorr2
 
  ** The following functions have been deprecated in previous releases
     of the image package and have now been removed:
new file mode 100644
--- /dev/null
+++ b/inst/normxcorr2.m
@@ -0,0 +1,31 @@
+## Copyright (C) 2011 Carnë Draug <carandraug+dev@gmail.com>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {@var{cc} =} normxcorr2 (@var{template}, @var{img})
+## @deftypefn {Function File} {@var{cc} =} normxcorr2 (@var{template}, @var{img})
+## Compute the normalized 2D cross correlation.
+##
+## The output matrix @var{cc} shows the correlation coefficients of @var{template}
+## for each position in @var{img}.
+## @seealso{conv2, corr2, xcorr2}
+## @end deftypefn
+
+function cc = normxcorr2 (temp, img)
+  if (nargin != 2)
+    print_usage;
+  endif
+  cc = xcorr2 (img, temp, "coeff");
+endfunction