Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 89 lines (75 sloc) 2.567 kB
15a5540 updates and mapping functions
zuliani authored
1 function SetPathLocal(base)
2
3 % SetPathLocal(base)
4 %
5 % DESC:
6 % sets the paths
7 %
8 % AUTHOR
9 % Marco Zuliani - marco.zuliani@gmail.com
10 %
11 % VERSION:
12 % 1.0.4
13 %
14 % INPUT:
15 % base = base directory (optional)
16 %
17 % SEE ALSO RANSAC_update.m
18
19 % HISTORY
20 % 1.0.0 ??/??/07 - intial version
21 % 1.0.1 ??/??/07 - add base directory parameter
22 % 1.0.2 11/08/07 - some improvements
23 % 1.0.3 06/26/08 - added seed global variable
24 % 1.0.4 11/25/10 - automatic addition of model directories
25
26 warning('off','MATLAB:dispatcher:pathWarning');
27
28 % save the seed for the random number generator.
29 % From matlab help:
30 % rand(method,s) causes rand to use the generator determined by method, and
31 % initializes the state of that generator using the value of s.
32 % The value of s is dependent upon which method is selected. If method is
33 % set to 'state' or 'twister', then s must be either a scalar integer value
34 % from 0 to 2^32-1 or the output of rand(method). If method is set to
35 % 'seed', then s must be either a scalar integer value from 0 to 2^31-2 or
36 % the output of rand(method).
37 global RANSAC_SEED;
38 RANSAC_SEED = 2222;
39
40 % if the base directory is not specified, then pick the current one
41 global RANSAC_ROOT;
42 if (nargin < 1) || isempty(base)
43 RANSAC_ROOT = pwd;
44 else
45 RANSAC_ROOT = base;
46 end;
47
48 if nargin < 1
49 fprintf('\nBase directory set to: %s\n', RANSAC_ROOT)
50 end;
51
52 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 % init Matlab directories
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 models_dir = '/Models/';
56 file_list = dir( sprintf('%s%s', RANSAC_ROOT, models_dir) );
57 nd = 1;
58 for h = 1:numel(file_list)
59 if ( file_list(h).isdir ) && ...
60 ( ~strcmp(file_list(h).name, '..') ) && ...
61 ( isempty(strfind(file_list(h).name, '.')) )
62 dirs{nd} = sprintf('%s%s', models_dir, file_list(h).name);
63 nd = nd + 1;
64 end;
65 end;
66
67 fprintf('\n%d models automatically added:\n', nd-1);
68 for h = 1:nd-1
69 fprintf('%s\n', dirs{h});
70 end;
71
72 dirs{nd} = '/Common';
73 dirs{nd+1} = '/.';
74
75 for h = 1:numel(dirs)
76 addpath(path, sprintf('%s%s', RANSAC_ROOT, dirs{h}));
77 end;
78
79 warning('off','MATLAB:dispatcher:pathWarning');
80
019598f general bug fixes
zuliani authored
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82 % if Octave take care of the windows server
83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84 if (exist('OCTAVE_VERSION') ~= 0)
85 setenv("GNUTERM", "x11")
86 end;
87
15a5540 updates and mapping functions
zuliani authored
88 return
Something went wrong with that request. Please try again.