diff options
Diffstat (limited to 'SD-VBS/benchmarks/mser/src/matlab/script_run_profile.m')
-rwxr-xr-x | SD-VBS/benchmarks/mser/src/matlab/script_run_profile.m | 126 |
1 files changed, 0 insertions, 126 deletions
diff --git a/SD-VBS/benchmarks/mser/src/matlab/script_run_profile.m b/SD-VBS/benchmarks/mser/src/matlab/script_run_profile.m deleted file mode 100755 index ec06539..0000000 --- a/SD-VBS/benchmarks/mser/src/matlab/script_run_profile.m +++ /dev/null | |||
@@ -1,126 +0,0 @@ | |||
1 | function script_run_profile(dataDir, resultDir, type, common,toolDir) | ||
2 | |||
3 | mser_compile; | ||
4 | path(path, common); | ||
5 | |||
6 | % MSER_DEMO Demonstrates MSER | ||
7 | |||
8 | % AUTORIGHTS | ||
9 | % Copyright (C) 2006 Regents of the University of California | ||
10 | % All rights reserved | ||
11 | % | ||
12 | % Written by Andrea Vedaldi (UCLA VisionLab). | ||
13 | % | ||
14 | % Redistribution and use in source and binary forms, with or without | ||
15 | % modification, are permitted provided that the following conditions are met | ||
16 | % | ||
17 | % * Redistributions of source code must retain the above copyright | ||
18 | % notice, this list of conditions and the following disclaimer. | ||
19 | % * Redistributions in binary form must reproduce the above copyright | ||
20 | % notice, this list of conditions and the following disclaimer in the | ||
21 | % documentation and/or other materials provided with the distribution. | ||
22 | % * Neither the name of the University of California, Berkeley nor the | ||
23 | % names of its contributors may be used to endorse or promote products | ||
24 | % derived from this software without specific prior written permission. | ||
25 | % | ||
26 | % THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY | ||
27 | % EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
28 | % WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
29 | % DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY | ||
30 | % DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
31 | % (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
32 | % LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
33 | % ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
34 | % (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
35 | % SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
36 | |||
37 | which_image = 3 ; | ||
38 | |||
39 | % -------------------------------------------------------------------- | ||
40 | % Create data | ||
41 | % -------------------------------------------------------------------- | ||
42 | switch which_image | ||
43 | case 1 | ||
44 | I = rand(200,200) ; | ||
45 | I = imsmooth(I,10) ; | ||
46 | I = I-min(I(:)) ; | ||
47 | I = I/max(I(:)) ; | ||
48 | lev = 10 ; | ||
49 | I = uint8(round(I*lev)) ; | ||
50 | |||
51 | case 2 | ||
52 | I = zeros(200,200) ; | ||
53 | I(50:150,50:150)=5 ; | ||
54 | I = imsmooth(I,10) ; | ||
55 | I = uint8(round(I)) ; | ||
56 | |||
57 | case 3 | ||
58 | Files = dir([dataDir,'/1.bmp']); | ||
59 | I=readImage(fullfile(dataDir,Files(1).name)); | ||
60 | end | ||
61 | |||
62 | % -------------------------------------------------------------------- | ||
63 | % Compute MSERs | ||
64 | % -------------------------------------------------------------------- | ||
65 | |||
66 | %% Self check params | ||
67 | tol = 0.1; | ||
68 | elapsed = zeros(1,2); | ||
69 | |||
70 | rows = size(I,1); | ||
71 | cols = size(I,2); | ||
72 | |||
73 | fprintf(1,'Input size\t\t- (%dx%d)\n', rows, cols); | ||
74 | |||
75 | %% Timing | ||
76 | start = photonStartTiming; | ||
77 | |||
78 | [idx] = mser(uint8(I), 2) ; | ||
79 | |||
80 | %% Timing | ||
81 | stop = photonEndTiming; | ||
82 | |||
83 | temp = photonReportTiming(start, stop); | ||
84 | elapsed(1) = elapsed(1) + temp(1); | ||
85 | elapsed(2) = elapsed(2) + temp(2); | ||
86 | |||
87 | %% Self checking | ||
88 | writeMatrix(idx, dataDir); | ||
89 | |||
90 | %% Timing | ||
91 | photonPrintTiming(elapsed); | ||
92 | |||
93 | %% -------------------------------------------------------------------- | ||
94 | %% Plots | ||
95 | %% -------------------------------------------------------------------- | ||
96 | %[i,j] = ind2sub(size(I),idx) ; | ||
97 | % | ||
98 | %figure(100) ; clf ; imagesc(I) ; hold on ; | ||
99 | %set(gca,'Position',[0 0 1 1]) ; | ||
100 | %plot(j,i,'g*') ; colormap gray ; | ||
101 | % | ||
102 | %% swap x with y | ||
103 | %ell = ell([2 1 5 4 3],:) ; | ||
104 | % | ||
105 | %for k=1:size(ell,2) | ||
106 | % E = ell(:,k) ; | ||
107 | % c = E(1:2) ; | ||
108 | % A = zeros(2) ; | ||
109 | % A(1,1) = E(3) ; | ||
110 | % A(1,2) = E(4) ; | ||
111 | % A(2,2) = E(5) ; | ||
112 | % A = A + A' - diag(diag(A)) ; | ||
113 | % | ||
114 | % [V,D] = eig(A) ; | ||
115 | % A = 2.5*V*sqrt(D) ; | ||
116 | % | ||
117 | % X = A*[cos(linspace(0,2*pi,30)) ; sin(linspace(0,2*pi,30)) ;] ; | ||
118 | % X(1,:) = X(1,:) + c(1) ; | ||
119 | % X(2,:) = X(2,:) + c(2) ; | ||
120 | % | ||
121 | % plot(X(1,:),X(2,:),'r-','LineWidth',2) ; | ||
122 | % plot(c(1),c(2),'r.') ; | ||
123 | % plot(j(k),i(k),'g*') ; | ||
124 | %end | ||
125 | % | ||
126 | %line([j'; ell(1,:)],[i'; ell(2,:)],'color','b') ; | ||