diff options
Diffstat (limited to 'SD-VBS/benchmarks/sift/src/matlab/diffss.m')
-rw-r--r-- | SD-VBS/benchmarks/sift/src/matlab/diffss.m | 72 |
1 files changed, 72 insertions, 0 deletions
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 @@ | |||
1 | function dss = diffss(ss) | ||
2 | % DIFFSS Difference of scale space | ||
3 | % DSS=DIFFSS(SS) returns a scale space DSS obtained by subtracting | ||
4 | % consecutive levels of the scale space SS. | ||
5 | % | ||
6 | % In SIFT, this function is used to compute the difference of | ||
7 | % Gaussian scale space from the Gaussian scale space of an image. | ||
8 | % | ||
9 | % See also GAUSSIANSS(), PDF:SIFT.USER.SS. | ||
10 | |||
11 | % AUTORIGHTS | ||
12 | % Copyright (c) 2006 The Regents of the University of California. | ||
13 | % All Rights Reserved. | ||
14 | % | ||
15 | % Created by Andrea Vedaldi | ||
16 | % UCLA Vision Lab - Department of Computer Science | ||
17 | % | ||
18 | % Permission to use, copy, modify, and distribute this software and its | ||
19 | % documentation for educational, research and non-profit purposes, | ||
20 | % without fee, and without a written agreement is hereby granted, | ||
21 | % provided that the above copyright notice, this paragraph and the | ||
22 | % following three paragraphs appear in all copies. | ||
23 | % | ||
24 | % This software program and documentation are copyrighted by The Regents | ||
25 | % of the University of California. The software program and | ||
26 | % documentation are supplied "as is", without any accompanying services | ||
27 | % from The Regents. The Regents does not warrant that the operation of | ||
28 | % the program will be uninterrupted or error-free. The end-user | ||
29 | % understands that the program was developed for research purposes and | ||
30 | % is advised not to rely exclusively on the program for any reason. | ||
31 | % | ||
32 | % This software embodies a method for which the following patent has | ||
33 | % been issued: "Method and apparatus for identifying scale invariant | ||
34 | % features in an image and use of same for locating an object in an | ||
35 | % image," David G. Lowe, US Patent 6,711,293 (March 23, | ||
36 | % 2004). Provisional application filed March 8, 1999. Asignee: The | ||
37 | % University of British Columbia. | ||
38 | % | ||
39 | % IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY | ||
40 | % FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, | ||
41 | % INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND | ||
42 | % ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN | ||
43 | % ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF | ||
44 | % CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT | ||
45 | % LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
46 | % A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" | ||
47 | % BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE | ||
48 | % MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | ||
49 | |||
50 | dss.smin = ss.smin ; | ||
51 | dss.smax = ss.smax-1 ; | ||
52 | dss.omin = ss.omin ; | ||
53 | dss.O = ss.O ; | ||
54 | dss.S = ss.S ; | ||
55 | dss.sigma0 = ss.sigma0 ; | ||
56 | |||
57 | for o=1:dss.O | ||
58 | % Can be done at once, but it turns out to be faster | ||
59 | % this way | ||
60 | [M,N,S] = size(ss.octave{o}) ; | ||
61 | dss.octave{o} = zeros(M,N,S-1) ; | ||
62 | for s=1:S-1 | ||
63 | dss.octave{o}(:,:,s) = ... | ||
64 | ss.octave{o}(:,:,s+1) - ss.octave{o}(:,:,s) ; | ||
65 | end | ||
66 | end | ||
67 | |||
68 | % for i=1:32 | ||
69 | % for j=1:32 | ||
70 | % fprintf(1, '%f\n', dss.octave{1}(i,j,1)); | ||
71 | % end | ||
72 | % end | ||