From f618466c25d43f3bae9e40920273bf77de1e1149 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Mon, 19 Oct 2020 23:09:30 -0400 Subject: initial sd-vbs initial sd-vbs add sd-vbs sd-vbs --- SD-VBS/benchmarks/sift/src/matlab/diffss.m | 72 +++ SD-VBS/benchmarks/sift/src/matlab/gaussianss.m | 216 +++++++++ SD-VBS/benchmarks/sift/src/matlab/imreadbw.m | 52 ++ SD-VBS/benchmarks/sift/src/matlab/imsmooth.c | 115 +++++ SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexa64 | Bin 0 -> 9570 bytes SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexglx | Bin 0 -> 7450 bytes SD-VBS/benchmarks/sift/src/matlab/imsmooth_.c | 103 ++++ SD-VBS/benchmarks/sift/src/matlab/mexutils.c | 98 ++++ SD-VBS/benchmarks/sift/src/matlab/plotmatches.m | 124 +++++ .../sift/src/matlab/plotsiftdescriptor.m | 169 +++++++ SD-VBS/benchmarks/sift/src/matlab/plotsiftframe.m | 119 +++++ SD-VBS/benchmarks/sift/src/matlab/plotss.m | 68 +++ .../sift/src/matlab/script_run_profile.m | 23 + SD-VBS/benchmarks/sift/src/matlab/sift.m | 110 +++++ SD-VBS/benchmarks/sift/src/matlab/sift_compile.m | 60 +++ SD-VBS/benchmarks/sift/src/matlab/sift_demo2.m | 110 +++++ SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.css | 159 +++++++ SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.m | 50 ++ SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.pl | 296 ++++++++++++ SD-VBS/benchmarks/sift/src/matlab/sift_overview.m | 33 ++ SD-VBS/benchmarks/sift/src/matlab/siftdescriptor.c | 524 +++++++++++++++++++++ SD-VBS/benchmarks/sift/src/matlab/siftdescriptor.m | 79 ++++ .../sift/src/matlab/siftdescriptor.mexa64 | Bin 0 -> 15700 bytes .../sift/src/matlab/siftdescriptor.mexglx | Bin 0 -> 13332 bytes SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.c | 291 ++++++++++++ SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.m | 33 ++ .../benchmarks/sift/src/matlab/siftlocalmax.mexa64 | Bin 0 -> 10836 bytes .../benchmarks/sift/src/matlab/siftlocalmax.mexglx | Bin 0 -> 8518 bytes SD-VBS/benchmarks/sift/src/matlab/siftmatch.c | 250 ++++++++++ SD-VBS/benchmarks/sift/src/matlab/siftmatch.m | 60 +++ SD-VBS/benchmarks/sift/src/matlab/siftmatch.mexa64 | Bin 0 -> 11877 bytes SD-VBS/benchmarks/sift/src/matlab/siftmatch.mexglx | Bin 0 -> 9607 bytes SD-VBS/benchmarks/sift/src/matlab/siftormx.c | 251 ++++++++++ SD-VBS/benchmarks/sift/src/matlab/siftormx.mexa64 | Bin 0 -> 12860 bytes SD-VBS/benchmarks/sift/src/matlab/siftormx.mexglx | Bin 0 -> 10524 bytes SD-VBS/benchmarks/sift/src/matlab/siftread.m | 101 ++++ SD-VBS/benchmarks/sift/src/matlab/siftrefinemx.c | 342 ++++++++++++++ SD-VBS/benchmarks/sift/src/matlab/siftrefinemx.m | 61 +++ .../benchmarks/sift/src/matlab/siftrefinemx.mexa64 | Bin 0 -> 12392 bytes .../benchmarks/sift/src/matlab/siftrefinemx.mexglx | Bin 0 -> 9007 bytes SD-VBS/benchmarks/sift/src/matlab/tightsubplot.m | 151 ++++++ 41 files changed, 4120 insertions(+) create mode 100644 SD-VBS/benchmarks/sift/src/matlab/diffss.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/gaussianss.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/imreadbw.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/imsmooth.c create mode 100755 SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexa64 create mode 100755 SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexglx create mode 100644 SD-VBS/benchmarks/sift/src/matlab/imsmooth_.c create mode 100644 SD-VBS/benchmarks/sift/src/matlab/mexutils.c create mode 100644 SD-VBS/benchmarks/sift/src/matlab/plotmatches.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/plotsiftdescriptor.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/plotsiftframe.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/plotss.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/script_run_profile.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/sift.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/sift_compile.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/sift_demo2.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.css create mode 100644 SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.m create mode 100755 SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.pl create mode 100644 SD-VBS/benchmarks/sift/src/matlab/sift_overview.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftdescriptor.c create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftdescriptor.m create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftdescriptor.mexa64 create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftdescriptor.mexglx create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.c create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.m create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.mexa64 create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.mexglx create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftmatch.c create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftmatch.m create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftmatch.mexa64 create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftmatch.mexglx create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftormx.c create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftormx.mexa64 create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftormx.mexglx create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftread.m create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftrefinemx.c create mode 100644 SD-VBS/benchmarks/sift/src/matlab/siftrefinemx.m create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftrefinemx.mexa64 create mode 100755 SD-VBS/benchmarks/sift/src/matlab/siftrefinemx.mexglx create mode 100644 SD-VBS/benchmarks/sift/src/matlab/tightsubplot.m (limited to 'SD-VBS/benchmarks/sift/src/matlab') diff --git a/SD-VBS/benchmarks/sift/src/matlab/diffss.m b/SD-VBS/benchmarks/sift/src/matlab/diffss.m new file mode 100644 index 0000000..1e65390 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/diffss.m @@ -0,0 +1,72 @@ +function dss = diffss(ss) +% DIFFSS Difference of scale space +% DSS=DIFFSS(SS) returns a scale space DSS obtained by subtracting +% consecutive levels of the scale space SS. +% +% In SIFT, this function is used to compute the difference of +% Gaussian scale space from the Gaussian scale space of an image. +% +% See also GAUSSIANSS(), PDF:SIFT.USER.SS. + +% AUTORIGHTS +% Copyright (c) 2006 The Regents of the University of California. +% All Rights Reserved. +% +% Created by Andrea Vedaldi +% UCLA Vision Lab - Department of Computer Science +% +% Permission to use, copy, modify, and distribute this software and its +% documentation for educational, research and non-profit purposes, +% without fee, and without a written agreement is hereby granted, +% provided that the above copyright notice, this paragraph and the +% following three paragraphs appear in all copies. +% +% This software program and documentation are copyrighted by The Regents +% of the University of California. The software program and +% documentation are supplied "as is", without any accompanying services +% from The Regents. The Regents does not warrant that the operation of +% the program will be uninterrupted or error-free. The end-user +% understands that the program was developed for research purposes and +% is advised not to rely exclusively on the program for any reason. +% +% This software embodies a method for which the following patent has +% been issued: "Method and apparatus for identifying scale invariant +% features in an image and use of same for locating an object in an +% image," David G. Lowe, US Patent 6,711,293 (March 23, +% 2004). Provisional application filed March 8, 1999. Asignee: The +% University of British Columbia. +% +% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY +% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND +% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN +% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF +% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE +% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +dss.smin = ss.smin ; +dss.smax = ss.smax-1 ; +dss.omin = ss.omin ; +dss.O = ss.O ; +dss.S = ss.S ; +dss.sigma0 = ss.sigma0 ; + +for o=1:dss.O + % Can be done at once, but it turns out to be faster + % this way + [M,N,S] = size(ss.octave{o}) ; + dss.octave{o} = zeros(M,N,S-1) ; + for s=1:S-1 + dss.octave{o}(:,:,s) = ... + ss.octave{o}(:,:,s+1) - ss.octave{o}(:,:,s) ; + end +end + +% for i=1:32 +% for j=1:32 +% fprintf(1, '%f\n', dss.octave{1}(i,j,1)); +% end +% end diff --git a/SD-VBS/benchmarks/sift/src/matlab/gaussianss.m b/SD-VBS/benchmarks/sift/src/matlab/gaussianss.m new file mode 100644 index 0000000..c92383c --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/gaussianss.m @@ -0,0 +1,216 @@ +function SS = gaussianss(I,sigman,O,S,omin,smin,smax,sigma0) +% GAUSSIANSS +% SS = GAUSSIANSS(I,SIGMAN,O,S,OMIN,SMIN,SMAX,SIGMA0) returns the +% Gaussian scale space of image I. Image I is assumed to be +% pre-smoothed at level SIGMAN. O,S,OMIN,SMIN,SMAX,SIGMA0 are the +% parameters of the scale space as explained in PDF:SIFT.USER.SS. +% +% See also DIFFSS(), PDF:SIFT.USER.SS. + +% History +% 4-15-2006 Fixed some comments + +% AUTORIGHTS +% Copyright (c) 2006 The Regents of the University of California. +% All Rights Reserved. +% +% Created by Andrea Vedaldi +% UCLA Vision Lab - Department of Computer Science +% +% Permission to use, copy, modify, and distribute this software and its +% documentation for educational, research and non-profit purposes, +% without fee, and without a written agreement is hereby granted, +% provided that the above copyright notice, this paragraph and the +% following three paragraphs appear in all copies. +% +% This software program and documentation are copyrighted by The Regents +% of the University of California. The software program and +% documentation are supplied "as is", without any accompanying services +% from The Regents. The Regents does not warrant that the operation of +% the program will be uninterrupted or error-free. The end-user +% understands that the program was developed for research purposes and +% is advised not to rely exclusively on the program for any reason. +% +% This software embodies a method for which the following patent has +% been issued: "Method and apparatus for identifying scale invariant +% features in an image and use of same for locating an object in an +% image," David G. Lowe, US Patent 6,711,293 (March 23, +% 2004). Provisional application filed March 8, 1999. Asignee: The +% University of British Columbia. +% +% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY +% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND +% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN +% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF +% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE +% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +% -------------------------------------------------------------------- +% Check the arguments +% -------------------------------------------------------------------- +% -------------------------------------------------------------------- +% Do the job +% -------------------------------------------------------------------- + +% Scale multiplicative step +k = 2^(1/S) ; + +dsigma0 = sigma0 * sqrt(1 - 1/k^2) ; % Scale step factor +sigman = 0.5 ; % Nominal smoothing of the image + +% Scale space structure +SS.O = O ; +SS.S = S ; +SS.sigma0 = sigma0 ; +SS.omin = omin ; +SS.smin = smin ; +SS.smax = smax ; + +% If mino < 0, multiply the size of the image. +% (The rest of the code is consistent with this.) + + +if omin < 0 + for o=1:-omin + I = doubleSize(I) ; + end +elseif omin > 0 + for o=1:omin + I = halveSize(I) ; + end +end + +[M,N] = size(I) ; + +% Index offset +so = -smin+1 ; + +% -------------------------------------------------------------------- +% First octave +% -------------------------------------------------------------------- +% +% The first level of the first octave has scale index (o,s) = +% (omin,smin) and scale coordinate +% +% sigma(omin,smin) = sigma0 2^omin k^smin +% +% The input image I is at nominal scale sigman. Thus in order to get +% the first level of the pyramid we need to apply a smoothing of +% +% sqrt( (sigma0 2^omin k^smin)^2 - sigman^2 ). +% +% As we have pre-scaled the image omin octaves (up or down, +% depending on the sign of omin), we need to correct this value +% by dividing by 2^omin, getting +%e +% sqrt( (sigma0 k^smin)^2 - (sigman/2^omin)^2 ) +% + +SS.octave{1} = zeros(M,N,smax-smin+1) ; +SS.octave{1}(:,:,1) = imsmooth(I, ... + sqrt((sigma0*k^smin)^2 - (sigman/2^omin)^2)) ; + +temp = sqrt((sigma0*k^smin)^2 - (sigman/2^omin)^2) ; + +for s=smin+1:smax + % Here we go from (omin,s-1) to (omin,s). The extra smoothing + % standard deviation is + % + % (sigma0 2^omin 2^(s/S) )^2 - (simga0 2^omin 2^(s/S-1/S) )^2 + % + % Aftred dividing by 2^omin (to take into account the fact + % that the image has been pre-scaled omin octaves), the + % standard deviation of the smoothing kernel is + % + % dsigma = sigma0 k^s sqrt(1-1/k^2) + % + dsigma = k^s * dsigma0 ; + SS.octave{1}(:,:,s +so) = ... + imsmooth(squeeze(... + SS.octave{1}(:,:,s-1 +so)... + ), dsigma ) ; +end + +% -------------------------------------------------------------------- +% Other octaves +% -------------------------------------------------------------------- + +for o=2:O + % We need to initialize the first level of octave (o,smin) from + % the closest possible level of the previous octave. A level (o,s) + % in this octave corrsponds to the level (o-1,s+S) in the previous + % octave. In particular, the level (o,smin) correspnds to + % (o-1,smin+S). However (o-1,smin+S) might not be among the levels + % (o-1,smin), ..., (o-1,smax) that we have previously computed. + % The closest pick is + % + % / smin+S if smin+S <= smax + % (o-1,sbest) , sbest = | + % \ smax if smin+S > smax + % + % The amount of extra smoothing we need to apply is then given by + % + % ( sigma0 2^o 2^(smin/S) )^2 - ( sigma0 2^o 2^(sbest/S - 1) )^2 + % + % As usual, we divide by 2^o to cancel out the effect of the + % downsampling and we get + % + % ( sigma 0 k^smin )^2 - ( sigma0 2^o k^(sbest - S) )^2 + % + sbest = min(smin + S, smax) ; + TMP = halveSize(squeeze(SS.octave{o-1}(:,:,sbest+so))) ; + + target_sigma = sigma0 * k^smin ; + prev_sigma = sigma0 * k^(sbest - S) ; + + if(target_sigma > prev_sigma) + temp = sqrt(target_sigma^2 - prev_sigma^2); + TMP = imsmooth(TMP, temp ) ; + end + [M,N] = size(TMP) ; + + SS.octave{o} = zeros(M,N,smax-smin+1) ; + SS.octave{o}(:,:,1) = TMP ; + + for s=smin+1:smax + % The other levels are determined as above for the first octave. + dsigma = k^s * dsigma0 ; + SS.octave{o}(:,:,s +so) = ... + imsmooth(squeeze(... + SS.octave{o}(:,:,s-1 +so)... + ), dsigma) ; + end + + +end + +% ------------------------------------------------------------------------- +% Auxiliary functions +% ------------------------------------------------------------------------- +function J = doubleSize(I) +[M,N]=size(I) ; +J = zeros(2*M,2*N) ; +J(1:2:end,1:2:end) = I ; +J(2:2:end-1,2:2:end-1) = ... + 0.25*I(1:end-1,1:end-1) + ... + 0.25*I(2:end,1:end-1) + ... + 0.25*I(1:end-1,2:end) + ... + 0.25*I(2:end,2:end) ; +J(2:2:end-1,1:2:end) = ... + 0.5*I(1:end-1,:) + ... + 0.5*I(2:end,:) ; +J(1:2:end,2:2:end-1) = ... + 0.5*I(:,1:end-1) + ... + 0.5*I(:,2:end) ; + +function J = halveSize(I) +J=I(1:2:end,1:2:end) ; +%[M,N] = size(I) ; +%m=floor((M+1)/2) ; +%n=floor((N+1)/2) ; +%J = I(:,1:2:2*n) + I(:,2:2:2*n+1) ; +%J = 0.25*(J(1:2:2*m,:)+J(2:2:2*m+1,:)) ; diff --git a/SD-VBS/benchmarks/sift/src/matlab/imreadbw.m b/SD-VBS/benchmarks/sift/src/matlab/imreadbw.m new file mode 100644 index 0000000..55cb708 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/imreadbw.m @@ -0,0 +1,52 @@ +function I = imreadbw(file) +% IMREADBW Reads an image as gray-scale +% I=IMREADBW(FILE) reads the image FILE and converts the result to a +% gray scale image (with DOUBLE storage class anr range normalized +% in [0,1]). + +% AUTORIGHTS +% Copyright (c) 2006 The Regents of the University of California. +% All Rights Reserved. +% +% Created by Andrea Vedaldi +% UCLA Vision Lab - Department of Computer Science +% +% Permission to use, copy, modify, and distribute this software and its +% documentation for educational, research and non-profit purposes, +% without fee, and without a written agreement is hereby granted, +% provided that the above copyright notice, this paragraph and the +% following three paragraphs appear in all copies. +% +% This software program and documentation are copyrighted by The Regents +% of the University of California. The software program and +% documentation are supplied "as is", without any accompanying services +% from The Regents. The Regents does not warrant that the operation of +% the program will be uninterrupted or error-free. The end-user +% understands that the program was developed for research purposes and +% is advised not to rely exclusively on the program for any reason. +% +% This software embodies a method for which the following patent has +% been issued: "Method and apparatus for identifying scale invariant +% features in an image and use of same for locating an object in an +% image," David G. Lowe, US Patent 6,711,293 (March 23, +% 2004). Provisional application filed March 8, 1999. Asignee: The +% University of British Columbia. +% +% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY +% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND +% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN +% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF +% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE +% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +I=im2double(imread(file)) ; + +if(size(I,3) > 1) + I = rgb2gray( I ) ; +end + + diff --git a/SD-VBS/benchmarks/sift/src/matlab/imsmooth.c b/SD-VBS/benchmarks/sift/src/matlab/imsmooth.c new file mode 100644 index 0000000..5d6a660 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/imsmooth.c @@ -0,0 +1,115 @@ +/** file: imsmooth.c + ** author: Andrea Vedaldi + ** description: Smooth an image. + **/ + +#include"mex.h" +#include +#include +#include +#include + +#define greater(a,b) ((a) > (b)) +#define min(a,b) (((a)<(b))?(a):(b)) +#define max(a,b) (((a)>(b))?(a):(b)) + +const double win_factor = 1.5 ; +const int nbins = 36 ; + +void +mexFunction(int nout, mxArray *out[], + int nin, const mxArray *in[]) +{ + int M,N ; + double* I_pt ; + double* J_pt ; + double s ; + enum {I=0,S} ; + enum {J=0} ; + + /* ------------------------------------------------------------------ + ** Check the arguments + ** --------------------------------------------------------------- */ + if (nin != 2) { + mexErrMsgTxt("Exactly two input arguments required."); + } else if (nout > 1) { + mexErrMsgTxt("Too many output arguments."); + } + + if (!mxIsDouble(in[I]) || + !mxIsDouble(in[S]) ) { + mexErrMsgTxt("All arguments must be real.") ; + } + + if(mxGetNumberOfDimensions(in[I]) > 2|| + mxGetNumberOfDimensions(in[S]) > 2) { + mexErrMsgTxt("I must be a two dimensional array and S a scalar.") ; + } + + if(max(mxGetM(in[S]),mxGetN(in[S])) > 1) { + mexErrMsgTxt("S must be a scalar.\n") ; + } + + M = mxGetM(in[I]) ; + N = mxGetN(in[I]) ; + + out[J] = mxCreateDoubleMatrix(M, N, mxREAL) ; + + I_pt = mxGetPr(in[I]) ; + J_pt = mxGetPr(out[J]) ; + s = *mxGetPr(in[S]) ; + + /* ------------------------------------------------------------------ + ** Do the job + ** --------------------------------------------------------------- */ + if(s > 0.01) { + + int W = (int) ceil(4*s) ; + int i ; + int j ; + double* g0 = (double*) mxMalloc( (2*W+1)*sizeof(double) ) ; + double* buffer = (double*) mxMalloc( M*N*sizeof(double) ) ; + double acc=0.0 ; + + for(j = 0 ; j < 2*W+1 ; ++j) { + g0[j] = exp(-0.5 * (j - W)*(j - W)/(s*s)) ; + acc += g0[j] ; + } + for(j = 0 ; j < 2*W+1 ; ++j) { + g0[j] /= acc ; + } + + /* + ** Convolve along the columns + **/ + for(j = 0 ; j < N ; ++j) { + for(i = 0 ; i < M ; ++i) { + double* start = I_pt + max(i-W,0) + j*M ; + double* stop = I_pt + min(i+W,M-1) + j*M + 1 ; + double* g = g0 + max(0, W-i) ; + acc = 0.0 ; + while(stop != start) acc += (*g++) * (*start++) ; + *buffer++ = acc ; + } + } + buffer -= M*N ; + + /* + ** Convolve along the rows + **/ + for(j = 0 ; j < N ; ++j) { + for(i = 0 ; i < M ; ++i) { + double* start = buffer + i + max(j-W,0)*M ; + double* stop = buffer + i + min(j+W,N-1)*M + M ; + double* g = g0 + max(0, W-j) ; + acc = 0.0 ; + while(stop != start) { acc += (*g++) * (*start) ; start+=M ;} + *J_pt++ = acc ; + } + } + mxFree(buffer) ; + mxFree(g0) ; + } else { + memcpy(J_pt, I_pt, sizeof(double)*M*N) ; + } +} diff --git a/SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexa64 b/SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexa64 new file mode 100755 index 0000000..0997262 Binary files /dev/null and b/SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexa64 differ diff --git a/SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexglx b/SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexglx new file mode 100755 index 0000000..a4a7a20 Binary files /dev/null and b/SD-VBS/benchmarks/sift/src/matlab/imsmooth.mexglx differ diff --git a/SD-VBS/benchmarks/sift/src/matlab/imsmooth_.c b/SD-VBS/benchmarks/sift/src/matlab/imsmooth_.c new file mode 100644 index 0000000..e0adeff --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/imsmooth_.c @@ -0,0 +1,103 @@ +#include +#include +#include +#include "imsmooth.h" + +#define greater(a,b) ((a) > (b)) +#define min(a,b) (((a)<(b))?(a):(b)) +#define max(a,b) (((a)>(b))?(a):(b)) + +const double win_factor = 1.5 ; +const int nbins = 36 ; + +float* imsmooth(float* I_pt_, float dsigma) +{ + int M,N ; + float *I_pt ; + float* J_pt_, *J_pt ; + float* out_, *out; + float s ; + enum {I=0,S} ; + enum {J=0} ; + + /* ------------------------------------------------------------------ + ** Check the arguments + ** --------------------------------------------------------------- */ + + M = (int)in_[0]; + N = (int)in_[1]; + + out_ = fMallocHandle(M, N); + J_pt_ = &(out_[0]); + J_pt = &(J_pt_[4]); + s = dsigma; + + + /* ------------------------------------------------------------------ + ** Do the job + ** --------------------------------------------------------------- */ + if(s > 0.01) + { + + int W = (int) ceil(4*s) ; + int i ; + int j ; + float* g0_, *g0, *buffer_, *buffer, acc; + g0_ = fMallocHandle(1, 2*W+1); + g0 = &(g0_[4]); + buffer_ = fMallocHandle(M, N); + acc=0.0 ; + + for(j = 0 ; j < 2*W+1 ; ++j) + { + g0[j] = exp(-0.5 * (j - W)*(j - W)/(s*s)) ; + acc += g0[j] ; + } + + for(j = 0 ; j < 2*W+1 ; ++j) + { + g0[j] /= acc ; + } + + /* + ** Convolve along the columns + **/ + + for(j = 0 ; j < N ; ++j) + { + for(i = 0 ; i < M ; ++i) + { + float* start = I_pt + max(i-W,0) + j*M ; + float* stop = I_pt + min(i+W,M-1) + j*M + 1 ; + float* g = g0 + max(0, W-i) ; + acc = 0.0 ; + while(stop != start) acc += (*g++) * (*start++) ; + *buffer++ = acc ; + } + } + buffer -= M*N ; + + /* + ** Convolve along the rows + **/ + for(j = 0 ; j < N ; ++j) + { + for(i = 0 ; i < M ; ++i) + { + float* start = buffer + i + max(j-W,0)*M ; + float* stop = buffer + i + min(j+W,N-1)*M + M ; + float* g = g0 + max(0, W-j) ; + acc = 0.0 ; + while(stop != start) { acc += (*g++) * (*start) ; start+=M ;} + *J_pt++ = acc ; + } + } + free(buffer) ; + free(g0) ; + } + else + { + memcpy(J_pt, I_pt, sizeof(double)*M*N) ; + } + return J_pt_; +} diff --git a/SD-VBS/benchmarks/sift/src/matlab/mexutils.c b/SD-VBS/benchmarks/sift/src/matlab/mexutils.c new file mode 100644 index 0000000..45843cf --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/mexutils.c @@ -0,0 +1,98 @@ +/* file: mexutils.c +** author: Andrea Vedaldi +** description: Utility functions to write MEX files. +**/ + +#include"mex.h" +#include + +#undef M_PI +#define M_PI 3.14159265358979 + +/** @biref Is real scalar? + ** + ** @return @c true if the array @a A is a real scalar. + **/ +int +uIsRealScalar(const mxArray* A) +{ + return + mxIsDouble(A) && + !mxIsComplex(A) && + mxGetNumberOfDimensions(A) == 2 && + mxGetM(A) == 1 && + mxGetN(A) == 1 ; +} + +/** @brief Is real matrix? + ** + ** The function checks wether the argument @a A is a real matrix. In + ** addition, if @a M >= 0, it checks wether the number of rows is + ** equal to @a M and, if @a N >= 0, if the number of columns is equal + ** to @a N. + ** + ** @param M number of rows. + ** @param N number of columns. + ** @return @c true if the array is a real matrix with the specified format. + **/ +int +uIsRealMatrix(const mxArray* A, int M, int N) +{ + return + mxIsDouble(A) && + !mxIsComplex(A) && + mxGetNumberOfDimensions(A) == 2 && + ((M>=0)?(mxGetM(A) == M):1) && + ((N>=0)?(mxGetN(A) == N):1) ; +} + +/** @brief Is real vector? + ** + ** The function checks wether the argument @a V is a real vector. By + ** definiton, a matrix is a vector if one of its dimension is one. + ** In addition, if @a D >= 0, it checks wether the dimension of the + ** vecotr is equal to @a D. + ** + ** @param D lenght of the vector. + ** @return @c true if the array is a real vector of the specified dimension. + **/ +int +uIsRealVector(const mxArray* V, int D) +{ + int M = mxGetM(V) ; + int N = mxGetN(V) ; + int is_vector = (N == 1) || (M == 1) ; + + return + mxIsDouble(V) && + !mxIsComplex(V) && + mxGetNumberOfDimensions(V) == 2 && + is_vector && + ( D < 0 || N == D || M == D) ; +} + + +/** @brief Is a string? + ** + ** The function checks wether the array @a S is a string. If + ** @a L is non-negative, it also check wether the strign has + ** length @a L. + ** + ** @return @a c true if S is a string of the specified length. + **/ +int +uIsString(const mxArray* S, int L) +{ + int M = mxGetM(S) ; + int N = mxGetN(S) ; + + return + mxIsChar(S) && + M == 1 && + (L < 0 || N == L) ; +} + +/** + ** + **/ + diff --git a/SD-VBS/benchmarks/sift/src/matlab/plotmatches.m b/SD-VBS/benchmarks/sift/src/matlab/plotmatches.m new file mode 100644 index 0000000..b6324e9 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/plotmatches.m @@ -0,0 +1,124 @@ +function h=plotmatches(I1,I2,P1,P2,matches,varargin) +% PLOTMATCHES Plot keypoint matches +% PLOTMATCHES(I1,I2,P1,P2,MATCHES) plots the two images I1 and I2 +% and lines connecting the frames (keypoints) P1 and P2 as specified +% by MATCHES. +% +% P1 and P2 specify two sets of frames, one per column. The first +% two elements of each column specify the X,Y coordinates of the +% corresponding frame. Any other element is ignored. +% +% MATCHES specifies a set of matches, one per column. The two +% elementes of each column are two indexes in the sets P1 and P2 +% respectively. +% +% The images I1 and I2 might be either both grayscale or both color +% and must have DOUBLE storage class. If they are color the range +% must be normalized in [0,1]. +% +% The function accepts the following option-value pairs: +% +% 'Stacking' ['h'] +% Stacking of images: horizontal [h], vertical [v], diagonal +% [h], overlap ['o'] +% +% See also PLOTSIFTDESCRIPTOR(), PLOTSIFTFRAME(), PLOTSS(). + +% AUTORIGHTS +% Copyright (c) 2006 The Regents of the University of California. +% All Rights Reserved. +% +% Created by Andrea Vedaldi +% UCLA Vision Lab - Department of Computer Science +% +% Permission to use, copy, modify, and distribute this software and its +% documentation for educational, research and non-profit purposes, +% without fee, and without a written agreement is hereby granted, +% provided that the above copyright notice, this paragraph and the +% following three paragraphs appear in all copies. +% +% This software program and documentation are copyrighted by The Regents +% of the University of California. The software program and +% documentation are supplied "as is", without any accompanying services +% from The Regents. The Regents does not warrant that the operation of +% the program will be uninterrupted or error-free. The end-user +% understands that the program was developed for research purposes and +% is advised not to rely exclusively on the program for any reason. +% +% This software embodies a method for which the following patent has +% been issued: "Method and apparatus for identifying scale invariant +% features in an image and use of same for locating an object in an +% image," David G. Lowe, US Patent 6,711,293 (March 23, +% 2004). Provisional application filed March 8, 1999. Asignee: The +% University of British Columbia. +% +% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY +% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND +% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN +% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF +% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE +% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +% -------------------------------------------------------------------- +% Check the arguments +% -------------------------------------------------------------------- + +stack='h' ; + +for k=1:2:length(varargin) + switch varargin{k} + case 'Stacking' + stack=varargin{k+1} ; + end +end + +% -------------------------------------------------------------------- +% Do the job +% -------------------------------------------------------------------- + +[M1,N1,K1]=size(I1) ; +[M2,N2,K2]=size(I2) ; + +switch stack + case 'h' + N3=N1+N2 ; + M3=max(M1,M2) ; + oj=N1 ; + oi=0 ; + case 'v' + M3=M1+M2 ; + N3=max(N1,N2) ; + oj=0 ; + oi=M1 ; + case 'd' + M3=M1+M2 ; + N3=N1+N2 ; + oj=N1 ; + oi=M1 ; + case 'o' + M3=max(M1,M2) ; + N3=max(N1,N2) ; + oj=0; + oi=0; +end + +I=zeros(M3,N3,K1) ; +I(1:M1,1:N1,:) = I1 ; +I(oi+(1:M2),oj+(1:N2),:) = I2 ; + +axes('Position', [0 0 1 1]) ; +imagesc(I) ; colormap gray ; hold on ; axis image ; axis off ; +drawnow ; + +K = size(matches, 2) ; +nans = NaN * ones(1,K) ; + +x = [ P1(1,matches(1,:)) ; P2(1,matches(2,:))+oj ; nans ] ; +y = [ P1(2,matches(1,:)) ; P2(2,matches(2,:))+oi ; nans ] ; + +h = line(x(:)', y(:)') ; +set(h,'Marker','.','Color','g') ; diff --git a/SD-VBS/benchmarks/sift/src/matlab/plotsiftdescriptor.m b/SD-VBS/benchmarks/sift/src/matlab/plotsiftdescriptor.m new file mode 100644 index 0000000..2f4af50 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/plotsiftdescriptor.m @@ -0,0 +1,169 @@ +function h=plotsiftdescriptor(d,f) +% PLOTSIFTDESCRIPTOR Plot SIFT descriptor +% PLOTSIFTDESCRIPTOR(D) plots the SIFT descriptors D, stored as +% columns of the matrix D. D has the same format used by SIFT(). +% +% PLOTSIFTDESCRIPTOR(D,F) plots the SIFT descriptors warped to the +% SIFT frames F, specified as columns of the matrix F. F has +% the same format used by SIFT(). +% +% H=PLOTSIFTDESCRIPTOR(...) returns the handle H to the line drawing +% representing the descriptors. +% +% REMARK. Currently the function supports only descriptors with 4x4 +% spatial bins and 8 orientation bins (Lowe's default.) +% +% See also PLOTSIFTFRAME(), PLOTMATCHES(), PLOTSS(). + +% AUTORIGHTS +% Copyright (c) 2006 The Regents of the University of California. +% All Rights Reserved. +% +% Created by Andrea Vedaldi +% UCLA Vision Lab - Department of Computer Science +% +% Permission to use, copy, modify, and distribute this software and its +% documentation for educational, research and non-profit purposes, +% without fee, and without a written agreement is hereby granted, +% provided that the above copyright notice, this paragraph and the +% following three paragraphs appear in all copies. +% +% This software program and documentation are copyrighted by The Regents +% of the University of California. The software program and +% documentation are supplied "as is", without any accompanying services +% from The Regents. The Regents does not warrant that the operation of +% the program will be uninterrupted or error-free. The end-user +% understands that the program was developed for research purposes and +% is advised not to rely exclusively on the program for any reason. +% +% This software embodies a method for which the following patent has +% been issued: "Method and apparatus for identifying scale invariant +% features in an image and use of same for locating an object in an +% image," David G. Lowe, US Patent 6,711,293 (March 23, +% 2004). Provisional application filed March 8, 1999. Asignee: The +% University of British Columbia. +% +% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY +% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND +% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN +% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF +% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE +% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +lowe_compatible = 1 ; + +% -------------------------------------------------------------------- +% Check the arguments +% -------------------------------------------------------------------- + +if(size(d,1) ~= 128) + error('D should be a 128xK matrix (only standard descriptors accepted)') ; +end + +if nargin > 1 + if(size(f,1) ~= 4) + error('F should be a 4xK matrix'); + end + + if(size(f,2) ~= size(f,2)) + error('D and F must have the same number of columns') ; + end +end + +% Descriptors are often non-double numeric arrays +d = double(d) ; +K = size(d,2) ; +if nargin < 2 + f = repmat([0;0;1;0],1,K) ; +end + +maginf = 3.0 ; +NBP=4 ; +NBO=8 ; + +% -------------------------------------------------------------------- +% Do the job +% -------------------------------------------------------------------- + +xall=[] ; +yall=[] ; + +for k=1:K + SBP = maginf * f(3,k) ; + th=f(4,k) ; + c=cos(th) ; + s=sin(th) ; + + [x,y] = render_descr(d(:,k)) ; + xall = [xall SBP*(c*x-s*y)+f(1,k)] ; + yall = [yall SBP*(s*x+c*y)+f(2,k)] ; +end + +h=line(xall,yall) ; + +% -------------------------------------------------------------------- +% Helper functions +% -------------------------------------------------------------------- + +% Renders a single descriptor +function [x,y] = render_descr( d ) + +lowe_compatible=1; +NBP=4 ; +NBO=8 ; + +[x,y] = meshgrid(-NBP/2:NBP/2,-NBP/2:NBP/2) ; + +% Rescale d so that the biggest peak fits inside the bin diagram +d = 0.4 * d / max(d(:)) ; + +% We have NBP*NBP bins to plot. Here are the centers: +xc = x(1:end-1,1:end-1) + 0.5 ; +yc = y(1:end-1,1:end-1) + 0.5 ; + +% We swap the order of the bin diagrams because they are stored row +% major into the descriptor (Lowe's convention that we follow.) +xc = xc' ; +yc = yc' ; + +% Each bin contains a star with eight tips +xc = repmat(xc(:)',NBO,1) ; +yc = repmat(yc(:)',NBO,1) ; + +% Do the stars +th=linspace(0,2*pi,NBO+1) ; +th=th(1:end-1) ; +if lowe_compatible + xd = repmat(cos(-th), 1, NBP*NBP ) ; + yd = repmat(sin(-th), 1, NBP*NBP ) ; +else + xd = repmat(cos(th), 1, NBP*NBP ) ; + yd = repmat(sin(th), 1, NBP*NBP ) ; +end +xd = xd .* d(:)' ; +yd = yd .* d(:)' ; + +% Re-arrange in sequential order the lines to draw +nans = NaN * ones(1,NBP^2*NBO) ; +x1 = xc(:)' ; +y1 = yc(:)' ; +x2 = x1 + xd ; +y2 = y1 + yd ; +xstars = [x1;x2;nans] ; +ystars = [y1;y2;nans] ; + +% Horizontal lines of the grid +nans = NaN * ones(1,NBP+1); +xh = [x(:,1)' ; x(:,end)' ; nans] ; +yh = [y(:,1)' ; y(:,end)' ; nans] ; + +% Verical lines of the grid +xv = [x(1,:) ; x(end,:) ; nans] ; +yv = [y(1,:) ; y(end,:) ; nans] ; + +x=[xstars(:)' xh(:)' xv(:)'] ; +y=[ystars(:)' yh(:)' yv(:)'] ; diff --git a/SD-VBS/benchmarks/sift/src/matlab/plotsiftframe.m b/SD-VBS/benchmarks/sift/src/matlab/plotsiftframe.m new file mode 100644 index 0000000..984dfc9 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/plotsiftframe.m @@ -0,0 +1,119 @@ +function h=plotsiftframe(frames,labels) +% PLOTSIFTFRAME Plot SIFT frame +% H=PLOTSIFTFRAME(FRAMES) plots the SIFT frames FRAMES and returns +% and handle H to the resulting line set. FRAMES has the same format +% used by SIFT(). +% +% PLOTSIFTFRAME(FRAMES, LABELS) displays nearby the frame centers +% the indexes specified by the vector LABELS. This operation is slow +% for large sets of frames. +% +% A SIFT frame is denoted by a circle, representing its support, and +% one of its radii, representing its orientation. The support is a +% disk with radius equal to six times the scale SIGMA of the +% frame. If the standard parameters are used for the detector, this +% corresponds to four times the standard deviation of the Gaussian +% window that has been uses to estimate the orientation, which is in +% fact equal to 1.5 times the scale SIGMA. +% +% This function is considerably more efficient if called once on a +% whole set of frames as opposed to multiple times, one for each +% frame. +% +% See also PLOTMATCHES(), PLOTSIFTDESCRIPTOR(), PLOTSS(). + +% AUTORIGHTS +% Copyright (c) 2006 The Regents of the University of California. +% All Rights Reserved. +% +% Created by Andrea Vedaldi +% UCLA Vision Lab - Department of Computer Science +% +% Permission to use, copy, modify, and distribute this software and its +% documentation for educational, research and non-profit purposes, +% without fee, and without a written agreement is hereby granted, +% provided that the above copyright notice, this paragraph and the +% following three paragraphs appear in all copies. +% +% This software program and documentation are copyrighted by The Regents +% of the University of California. The software program and +% documentation are supplied "as is", without any accompanying services +% from The Regents. The Regents does not warrant that the operation of +% the program will be uninterrupted or error-free. The end-user +% understands that the program was developed for research purposes and +% is advised not to rely exclusively on the program for any reason. +% +% This software embodies a method for which the following patent has +% been issued: "Method and apparatus for identifying scale invariant +% features in an image and use of same for locating an object in an +% image," David G. Lowe, US Patent 6,711,293 (March 23, +% 2004). Provisional application filed March 8, 1999. Asignee: The +% University of British Columbia. +% +% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY +% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND +% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN +% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF +% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE +% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +% -------------------------------------------------------------------- +% Check the arguments +% -------------------------------------------------------------------- + +if size(frames,1) ~= 4 + error('FRAMES should be a 4xK matrix') ; +end + +K = size(frames,2) ; + +if nargin > 1 + putlabels = 1 ; +end + +% -------------------------------------------------------------------- +% Do the work +% -------------------------------------------------------------------- + +hold on ; +K=size(frames,2) ; +thr=linspace(0,2*pi,40) ; + +allx = nan*ones(1, 40*K+(K-1)) ; +ally = nan*ones(1, 40*K+(K-1)) ; + +allxf = nan*ones(1, 3*K) ; +allyf = nan*ones(1, 3*K) ; + +putlabel=0 ; + +for k=1:K + xc=frames(1,k) ; + yc=frames(2,k) ; + r=1.5*4*frames(3,k) ; + th=frames(4,k) ; + + x = r*cos(thr) + xc ; + y = r*sin(thr) + yc ; + + allx((k-1)*(41) + (1:40)) = x ; + ally((k-1)*(41) + (1:40)) = y ; + + allxf((k-1)*3 + (1:2)) = [xc xc+r*cos(th)] ; + allyf((k-1)*3 + (1:2)) = [yc yc+r*sin(th)] ; + + if putlabel + x=xc+r ; + y=yc ; + h=text(x+2,y,sprintf('%d',labels(k))) ; + set(h,'Color',[1 0 0]) ; + plot(x,y,'r.') ; + end + +end + +h=line([allx nan allxf], [ally nan allyf], 'Color','g','LineWidth',3) ; diff --git a/SD-VBS/benchmarks/sift/src/matlab/plotss.m b/SD-VBS/benchmarks/sift/src/matlab/plotss.m new file mode 100644 index 0000000..17868b6 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/plotss.m @@ -0,0 +1,68 @@ +function plotss(ss,field) +% PLOTSS Plot scale space +% PLOTSS(SS) plots all octaves of the scale space SS. +% +% See also GAUSSIANSS(), DIFFSS(). + +% AUTORIGHTS +% Copyright (c) 2006 The Regents of the University of California. +% All Rights Reserved. +% +% Created by Andrea Vedaldi +% UCLA Vision Lab - Department of Computer Science +% +% Permission to use, copy, modify, and distribute this software and its +% documentation for educational, research and non-profit purposes, +% without fee, and without a written agreement is hereby granted, +% provided that the above copyright notice, this paragraph and the +% following three paragraphs appear in all copies. +% +% This software program and documentation are copyrighted by The Regents +% of the University of California. The software program and +% documentation are supplied "as is", without any accompanying services +% from The Regents. The Regents does not warrant that the operation of +% the program will be uninterrupted or error-free. The end-user +% understands that the program was developed for research purposes and +% is advised not to rely exclusively on the program for any reason. +% +% This software embodies a method for which the following patent has +% been issued: "Method and apparatus for identifying scale invariant +% features in an image and use of same for locating an object in an +% image," David G. Lowe, US Patent 6,711,293 (March 23, +% 2004). Provisional application filed March 8, 1999. Asignee: The +% University of British Columbia. +% +% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY +% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND +% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN +% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF +% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE +% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +if nargin > 2 + error('Too many arguments.') ; +end + +omin = ss.omin ; +smin = ss.smin ; +nlevels = ss.smax-ss.smin+1 ; + +for oi=1:ss.O + for si=1:nlevels + tightsubplot(nlevels, ss.O, nlevels*(oi-1)+si) ; + s = si-1 + smin ; + o = oi-1 + omin ; + sigma = ss.sigma0 * 2^(s/ss.S + o) ; + F=squeeze(ss.octave{oi}(:,:,si)) ; + [M,N]=size(F) ; + imagesc(squeeze(ss.octave{oi}(:,:,si))) ; axis image ; axis off ; + h=text(M/10,N/20,sprintf('(o,s)=(%d,%d), sigma=%f',o,s,sigma)) ; + set(h,'BackgroundColor','w','Color','k') ; + end +end + + diff --git a/SD-VBS/benchmarks/sift/src/matlab/script_run_profile.m b/SD-VBS/benchmarks/sift/src/matlab/script_run_profile.m new file mode 100644 index 0000000..c157507 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/script_run_profile.m @@ -0,0 +1,23 @@ +function script_run_profile(dataDir, resultDir, type, common, tooldir) + +path(path,common); +sift_compile; + +I1=readImage([dataDir, '/1.bmp']) ; + +rows = size(I1,1); +cols = size(I1,2); +fprintf(1,'Input size\t\t- (%dx%d)\n', rows, cols); + +I1=I1-min(I1(:)) ; +I1=I1/max(I1(:)) ; + +%% Timing +start = photonStartTiming; +frames1 = sift( I1) ; +stop = photonEndTiming; +elapsed = photonReportTiming(start, stop); +photonPrintTiming(elapsed); + +fWriteMatrix(frames1, dataDir); + diff --git a/SD-VBS/benchmarks/sift/src/matlab/sift.m b/SD-VBS/benchmarks/sift/src/matlab/sift.m new file mode 100644 index 0000000..ee79371 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/sift.m @@ -0,0 +1,110 @@ +% Input: +% I the input image, with pixel values normalize to lie betwen [0,1]. +% +% Output: +% features a structure which contains the following fields: +% pos an n*2 matrix containing the (x,y) coordinates of the keypoints +% stored in rows. +% scale an n*3 matrix with rows describing the scale of each keypoint +% (i.e., first column specifies the octave, second column specifies the interval, and +% third column specifies sigma). +% orient a n*1 vector containing the orientations of the keypoints [-pi,pi). +% desc an n*128 matrix with rows containing the feature descriptors +% corresponding to the keypoints. + +function [frames]=sift(I) + +[M,N,C] = size(I) ; + +% Lowe's choices +S=3 ; +omin=-1 ; +O=floor(log2(min(M,N)))-omin-4 ; % Up to 16x16 images +sigma0=1.6*2^(1/S) ; +sigman=0.5 ; +thresh = 0.04 / S / 2 ; +r = 10 ; + +NBP = 4 ; +NBO = 8 ; +magnif = 3.0 ; + +% Parese input +compute_descriptor = 0 ; +discard_boundary_points = 1 ; +verb = 0 ; + +smin = -1; +smax = S+1; +intervals = smax - smin + 1; + + +% -------------------------------------------------------------------- +% Parameters +% -------------------------------------------------------------------- + +oframes = [] ; +frames = [] ; +descriptors = [] ; + +% -------------------------------------------------------------------- +% SIFT Detector and Descriptor +% -------------------------------------------------------------------- + +% Compute scale spaces +%if verb > 0, fprintf('SIFT: computing scale space...') ; end + +gss = gaussianss(I,sigman,O,S,omin,-1,S+1,sigma0) ; +dogss = diffss(gss) ; +frames = []; + +%% To maintain consistency with C code. Once C code is ready, this will be uncommented. +for o=1:O %for o=1:O + + % Local maxima of the DOG octave + % The 80% tricks discards early very weak points before refinement. + + idx = siftlocalmax( dogss.octave{o}, 0.8*thresh ) ; + idx = [idx , siftlocalmax( - dogss.octave{o}, 0.8*thresh)] ; + + K=length(idx) ; + [i,j,s] = ind2sub( size( dogss.octave{o} ), idx ) ; + + y=i-1 ; + x=j-1 ; + s=s-1+dogss.smin ; + oframes = [x(:)';y(:)';s(:)'] ; + +% fWriteMatrix(oframes, '../data/sim'); + + % Remove points too close to the boundary + if discard_boundary_points + oframes = filter_boundary_points(size(dogss.octave{o}), oframes ) ; + end + + % Refine the location, threshold strength and remove points on edges + oframes = siftrefinemx(... + oframes, ... + dogss.octave{o}, ... + dogss.smin, ... + thresh, ... + r) ; + + frames = [frames, oframes]; + +end +end + +%% -------------------------------------------------------------------- +%% Helpers +%% -------------------------------------------------------------------- +function oframes=filter_boundary_points(sz, oframes) + +sel=find(... + oframes(1,:) > 3 & ... + oframes(1,:) < sz(2)-3 & ... + oframes(2,:) > 3 & ... + oframes(2,:) < sz(1)-3 ) ; + +oframes=oframes(:,sel) ; +end diff --git a/SD-VBS/benchmarks/sift/src/matlab/sift_compile.m b/SD-VBS/benchmarks/sift/src/matlab/sift_compile.m new file mode 100644 index 0000000..78c0034 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/sift_compile.m @@ -0,0 +1,60 @@ +function sift_compile(type) +% SIFT_COMPILE Compile MEX files +% Compiling under Windows requires at least Visual C 6 or LCC. You +% might try other compilers, but most likely you will need to edit +% this file. + +siftroot = fileparts(which('siftcompile')) ; +opts = { '-O', '-I.' } ; +%opts = { opts{:}, '-v' } ; + +if nargin < 1 + type = 'visualc' ; +end + +switch computer + case 'PCWIN' + warning('NOTE: compiling has been tested only with Visual C 6-7 and LCC') ; + switch type + case 'visualc' + lib{1}=[matlabroot '\extern\lib\win32\microsoft\libmwlapack.lib'] ; + lib{2}=[matlabroot '\extern\lib\win32\microsoft\msvc60\libmwlapack.lib']; + lib{3}=[matlabroot '\extern\lib\win32\microsoft\msvc71\libmwlapack.lib']; + case 'lcc' + lib{1}=[matlabroot '\extern\lib\win32\lcc\libmwlapack.lib'] ; + end + found=0; + for k=1:length(lib) + fprintf('Trying LAPACK lib ''%s''\n',lib{k}) ; + found=exist(lib{k}) ; + if found ~= 0 + break ; + end + end + if found == 0 + error('Could not find LAPACK library. Please edit this M-file to fix the issue.'); + end + opts = {opts{:}, '-DWINDOWS'} ; + opts = {opts{:}, lib{k}} ; + + case 'MAC' + opts = {opts{:}, '-DMACOSX'} ; + opts = {opts{:}, 'CFLAGS=\$CFLAGS -faltivec'} ; + + case 'GLNX86' + opts = {opts{:}, '-DLINUX' } ; + + otherwise + error(['Unsupported architecture ', computer, '. Please edit this M-mfile to fix the issue.']) ; +end + +mex('imsmooth.c',opts{:}) ; +mex('siftlocalmax.c',opts{:}) ; +mex('siftrefinemx.c',opts{:}) ; +mex('siftormx.c',opts{:}) ; +mex('siftdescriptor.c',opts{:}) ; +mex('siftmatch.c',opts{:}) ; + + + + diff --git a/SD-VBS/benchmarks/sift/src/matlab/sift_demo2.m b/SD-VBS/benchmarks/sift/src/matlab/sift_demo2.m new file mode 100644 index 0000000..a6f0c66 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/sift_demo2.m @@ -0,0 +1,110 @@ +cd % SIFT_DEMO2 Demonstrate SIFT code (2) +% This is similar to SIFT_DEMO(). +% +% See also SIFT_DEMO(). + +% AUTORIGHTS +% Copyright (c) 2006 The Regents of the University of California. +% All Rights Reserved. +% +% Created by Andrea Vedaldi +% UCLA Vision Lab - Department of Computer Science +% +% Permission to use, copy, modify, and distribute this software and its +% documentation for educational, research and non-profit purposes, +% without fee, and without a written agreement is hereby granted, +% provided that the above copyright notice, this paragraph and the +% following three paragraphs appear in all copies. +% +% This software program and documentation are copyrighted by The Regents +% of the University of California. The software program and +% documentation are supplied "as is", without any accompanying services +% from The Regents. The Regents does not warrant that the operation of +% the program will be uninterrupted or error-free. The end-user +% understands that the program was developed for research purposes and +% is advised not to rely exclusively on the program for any reason. +% +% This software embodies a method for which the following patent has +% been issued: "Method and apparatus for identifying scale invariant +% features in an image and use of same for locating an object in an +% image," David G. Lowe, US Patent 6,711,293 (March 23, +% 2004). Provisional application filed March 8, 1999. Asignee: The +% University of British Columbia. +% +% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY +% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND +% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN +% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF +% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE +% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +I1=imreadbw('data/landscape-a.jpg') ; % I1=I1(1:2:end,:) ; +I2=imreadbw('data/landscape-b.jpg') ; % I2=I2(1:2:end,:) ; +I1c=double(imread('data/landscape-a.jpg'))/255.0 ; +I2c=double(imread('data/landscape-b.jpg'))/255.0 ; + +I1=imsmooth(I1,.1) ; +I2=imsmooth(I2,.1) ; + +I1=I1-min(I1(:)) ; +I1=I1/max(I1(:)) ; +I2=I2-min(I2(:)) ; +I2=I2/max(I2(:)) ; + +S=3 ; + +fprintf('Computing frames and descriptors.\n') ; +[frames1,descr1,gss1,dogss1] = sift( I1, 'Verbosity', 1, 'Threshold', ... + 0.005, 'NumLevels', S ) ; +[frames2,descr2,gss2,dogss2] = sift( I2, 'Verbosity', 1, 'Threshold', ... + 0.005, 'NumLevels', S ) ; + +figure(11) ; clf ; plotss(dogss1) ; colormap gray ; +figure(12) ; clf ; plotss(dogss2) ; colormap gray ; +drawnow ; + +figure(2) ; clf ; +tightsubplot(1,2,1) ; imagesc(I1) ; colormap gray ; axis image ; +hold on ; +h=plotsiftframe( frames1 ) ; set(h,'LineWidth',2,'Color','g') ; +h=plotsiftframe( frames1 ) ; set(h,'LineWidth',1,'Color','k') ; + +tightsubplot(1,2,2) ; imagesc(I2) ; colormap gray ; axis image ; +hold on ; +h=plotsiftframe( frames2 ) ; set(h,'LineWidth',2,'Color','g') ; +h=plotsiftframe( frames2 ) ; set(h,'LineWidth',1,'Color','k') ; + +fprintf('Computing matches.\n') ; +% By passing to integers we greatly enhance the matching speed (we use +% the scale factor 512 as Lowe's, but it could be greater without +% overflow) +descr1=uint8(512*descr1) ; +descr2=uint8(512*descr2) ; +tic ; +matches=siftmatch( descr1, descr2, 3 ) ; +fprintf('Matched in %.3f s\n', toc) ; + +figure(3) ; clf ; +plotmatches(I1c,I2c,frames1(1:2,:),frames2(1:2,:),matches,... + 'Stacking','v') ; +drawnow ; + +% Movie +figure(4) ; set(gcf,'Position',[10 10 1024 512]) ; +figure(4) ; clf ; +tightsubplot(1,1); +imagesc(I1) ; colormap gray ; axis image ; hold on ; +h=plotsiftframe( frames1 ) ; set(h,'LineWidth',1,'Color','g') ; +h=plot(frames1(1,:),frames1(2,:),'r.') ; +MOV(1)=getframe ; + +figure(4) ; clf ; +tightsubplot(1,1); +imagesc(I2) ; colormap gray ; axis image ; hold on ; +h=plotsiftframe( frames2 ) ; set(h,'LineWidth',1,'Color','g') ; +h=plot(frames2(1,:),frames2(2,:),'r.') ; +MOV(2)=getframe ; diff --git a/SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.css b/SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.css new file mode 100644 index 0000000..b9bd8e3 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.css @@ -0,0 +1,159 @@ +/** file: default.css + ** author: Andrea Vedaldi + ** description: Default CSS sylesheet for SIFT_GENDOC.PL + **/ + +/* AUTORIGHTS */ + +h1 +{ + color: #3a3a3a ; +} + +pre +{ + font-family: monaco, courier, monospace ; + font-size: 14px ; + color: #3a3a3a ; +} + +body +{ + margin: 10px ; + padding: 1em ; + right: 0px ; + font-family: arial, sans-serif ; + + color: black ; + background-color: #fffffa ; +} + +/* ------------------------------------------------------------------ + * Module + * --------------------------------------------------------------- */ + +div.module +{ + margin-bottom: 1em ; + //background-color: #ffffff ; +} + +div.module h1 +{ + margin: 0px ; + margin-bottom: 0.5em ; + padding: 0px ; + font-size: 1.5em ; + border-bottom: 2px #3a3a3a solid ; +} + +div.module pre +{ + padding-left: 1em ; +} + +div.module div.footer +{ + clear: both ; +} + +div.module div.footer :link +{ + color: white ; + text-decoration: none ; +} + +/* ------------------------------------------------------------------ + * Module index + * --------------------------------------------------------------- */ + +div.module div.index +{ + font-family: sans-serif ; + font-size: 0.8em ; + + width: 15em ; + float: right ; + border: 1px #ccc0c0 solid ; + background-color: #fcf0f0 ; +} + +div.module div.index h1 +{ + font-size: 1em ; + font-weight: bold ; + text-align: center ; + border: none ; + padding: 0 ; + margin: 0 ; +} + +div.module div.index ul +{ + list-style-type: square ; + list-style-position: inside ; + color: #3a3a3a ; + padding: 0 ; + margin: 0 ; + padding: 0.3em ; +} + +div.module div.index ul li +{ + margin-bottom: 0.1em ; +} + + +/* ------------------------------------------------------------------ + * Mfile + * --------------------------------------------------------------- */ + +div.mfile +{ + background-color: white ; + margin-bottom: 1em ; + border: 1px #aaaaaa solid ; +} + +div.mfile h1 +{ + margin: 0 ; + padding: 0 ; + padding-left: 10px ; + font-size: 1.3em ; + background-color: #f0f0ff ; +} + +div.mfile h1 span.name +{ + font-family: monaco, courier, fixed ; +} + +div.mfile h1 span.brief +{ + padding-left: 10px ; + font-size: 0.9em ; + font-weight: normal ; +} + +div.mfile pre +{ + padding-left: 1em ; +} + +div.mfile div.footer +{ + font-size: 0.8em ; + padding: 0.3em ; +} + +div.mfile div.footer a +{ + text-decoration: none ; + color: #777777 ; +} + +div.mfile div.footer a:hover +{ + text-decoration: underline ; +} diff --git a/SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.m b/SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.m new file mode 100644 index 0000000..417f9c5 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.m @@ -0,0 +1,50 @@ +function sift_gendoc +% SIFT_GENDOC Generate documentation +% This function extracts the documentation from the MEX files and +% creates an HTML manual. + +% AUTORIGHTS +% Copyright (c) 2006 The Regents of the University of California. +% All Rights Reserved. +% +% Created by Andrea Vedaldi +% UCLA Vision Lab - Department of Computer Science +% +% Permission to use, copy, modify, and distribute this software and its +% documentation for educational, research and non-profit purposes, +% without fee, and without a written agreement is hereby granted, +% provided that the above copyright notice, this paragraph and the +% following three paragraphs appear in all copies. +% +% This software program and documentation are copyrighted by The Regents +% of the University of California. The software program and +% documentation are supplied "as is", without any accompanying services +% from The Regents. The Regents does not warrant that the operation of +% the program will be uninterrupted or error-free. The end-user +% understands that the program was developed for research purposes and +% is advised not to rely exclusively on the program for any reason. +% +% This software embodies a method for which the following patent has +% been issued: "Method and apparatus for identifying scale invariant +% features in an image and use of same for locating an object in an +% image," David G. Lowe, US Patent 6,711,293 (March 23, +% 2004). Provisional application filed March 8, 1999. Asignee: The +% University of British Columbia. +% +% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY +% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND +% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN +% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF +% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" +% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE +% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +rootdir = fileparts(which('siftgendoc')) ; +d=pwd; +cd([rootdir]) ; +res = perl([rootdir '/siftgendoc.pl'],[rootdir '/dom/index.html']) ; +cd(d) ; +fprintf(res) ; diff --git a/SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.pl b/SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.pl new file mode 100755 index 0000000..6bc0b5e --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/matlab/sift_gendoc.pl @@ -0,0 +1,296 @@ +#!/usr/bin/perl -w +## file: sift_gendoc.pl +## author: Andrea Vedaldi +## description: Summarize MATLAB M-Files docs + +# AUTORIGHTS +# Copyright (c) 2006 The Regents of the University of California. +# All Rights Reserved. +# +# Created by Andrea Vedaldi +# UCLA Vision Lab - Department of Computer Science +# +# Permission to use, copy, modify, and distribute this software and its +# documentation for educational, research and non-profit purposes, +# without fee, and without a written agreement is hereby granted, +# provided that the above copyright notice, this paragraph and the +# following three paragraphs appear in all copies. +# +# This software program and documentation are copyrighted by The Regents +# of the University of California. The software program and +# documentation are supplied "as is", without any accompanying services +# from The Regents. The Regents does not warrant that the operation of +# the program will be uninterrupted or error-free. The end-user +# understands that the program was developed for research purposes and +# is advised not to rely exclusively on the program for any reason. +# +# This software embodies a method for which the following patent has +# been issued: "Method and apparatus for identifying scale invariant +