summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/sift/src/matlab/plotsiftframe.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/sift/src/matlab/plotsiftframe.m')
-rw-r--r--SD-VBS/benchmarks/sift/src/matlab/plotsiftframe.m119
1 files changed, 119 insertions, 0 deletions
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 @@
1function h=plotsiftframe(frames,labels)
2% PLOTSIFTFRAME Plot SIFT frame
3% H=PLOTSIFTFRAME(FRAMES) plots the SIFT frames FRAMES and returns
4% and handle H to the resulting line set. FRAMES has the same format
5% used by SIFT().
6%
7% PLOTSIFTFRAME(FRAMES, LABELS) displays nearby the frame centers
8% the indexes specified by the vector LABELS. This operation is slow
9% for large sets of frames.
10%
11% A SIFT frame is denoted by a circle, representing its support, and
12% one of its radii, representing its orientation. The support is a
13% disk with radius equal to six times the scale SIGMA of the
14% frame. If the standard parameters are used for the detector, this
15% corresponds to four times the standard deviation of the Gaussian
16% window that has been uses to estimate the orientation, which is in
17% fact equal to 1.5 times the scale SIGMA.
18%
19% This function is considerably more efficient if called once on a
20% whole set of frames as opposed to multiple times, one for each
21% frame.
22%
23% See also PLOTMATCHES(), PLOTSIFTDESCRIPTOR(), PLOTSS().
24
25% AUTORIGHTS
26% Copyright (c) 2006 The Regents of the University of California.
27% All Rights Reserved.
28%
29% Created by Andrea Vedaldi
30% UCLA Vision Lab - Department of Computer Science
31%
32% Permission to use, copy, modify, and distribute this software and its
33% documentation for educational, research and non-profit purposes,
34% without fee, and without a written agreement is hereby granted,
35% provided that the above copyright notice, this paragraph and the
36% following three paragraphs appear in all copies.
37%
38% This software program and documentation are copyrighted by The Regents
39% of the University of California. The software program and
40% documentation are supplied "as is", without any accompanying services
41% from The Regents. The Regents does not warrant that the operation of
42% the program will be uninterrupted or error-free. The end-user
43% understands that the program was developed for research purposes and
44% is advised not to rely exclusively on the program for any reason.
45%
46% This software embodies a method for which the following patent has
47% been issued: "Method and apparatus for identifying scale invariant
48% features in an image and use of same for locating an object in an
49% image," David G. Lowe, US Patent 6,711,293 (March 23,
50% 2004). Provisional application filed March 8, 1999. Asignee: The
51% University of British Columbia.
52%
53% IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
54% FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
55% INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND
56% ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN
57% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF
58% CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
59% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
60% A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
61% BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE
62% MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
63
64% --------------------------------------------------------------------
65% Check the arguments
66% --------------------------------------------------------------------
67
68if size(frames,1) ~= 4
69 error('FRAMES should be a 4xK matrix') ;
70end
71
72K = size(frames,2) ;
73
74if nargin > 1
75 putlabels = 1 ;
76end
77
78% --------------------------------------------------------------------
79% Do the work
80% --------------------------------------------------------------------
81
82hold on ;
83K=size(frames,2) ;
84thr=linspace(0,2*pi,40) ;
85
86allx = nan*ones(1, 40*K+(K-1)) ;
87ally = nan*ones(1, 40*K+(K-1)) ;
88
89allxf = nan*ones(1, 3*K) ;
90allyf = nan*ones(1, 3*K) ;
91
92putlabel=0 ;
93
94for k=1:K
95 xc=frames(1,k) ;
96 yc=frames(2,k) ;
97 r=1.5*4*frames(3,k) ;
98 th=frames(4,k) ;
99
100 x = r*cos(thr) + xc ;
101 y = r*sin(thr) + yc ;
102
103 allx((k-1)*(41) + (1:40)) = x ;
104 ally((k-1)*(41) + (1:40)) = y ;
105
106 allxf((k-1)*3 + (1:2)) = [xc xc+r*cos(th)] ;
107 allyf((k-1)*3 + (1:2)) = [yc yc+r*sin(th)] ;
108
109 if putlabel
110 x=xc+r ;
111 y=yc ;
112 h=text(x+2,y,sprintf('%d',labels(k))) ;
113 set(h,'Color',[1 0 0]) ;
114 plot(x,y,'r.') ;
115 end
116
117end
118
119h=line([allx nan allxf], [ally nan allyf], 'Color','g','LineWidth',3) ;