diff options
Diffstat (limited to 'SD-VBS/benchmarks/multi_ncut/src')
| -rwxr-xr-x | SD-VBS/benchmarks/multi_ncut/src/matlab/script_run_profile.m | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/SD-VBS/benchmarks/multi_ncut/src/matlab/script_run_profile.m b/SD-VBS/benchmarks/multi_ncut/src/matlab/script_run_profile.m deleted file mode 100755 index 7624137..0000000 --- a/SD-VBS/benchmarks/multi_ncut/src/matlab/script_run_profile.m +++ /dev/null | |||
| @@ -1,78 +0,0 @@ | |||
| 1 | % MNcutDemo.m | ||
| 2 | % created by song, 06/13/2005 | ||
| 3 | % an exmaple of how to use and display MNcut | ||
| 4 | |||
| 5 | |||
| 6 | function script_run_profile(dataDir, resultDir, type, common, toolDir) | ||
| 7 | |||
| 8 | %% Input parameters | ||
| 9 | |||
| 10 | if(nargin == 0) | ||
| 11 | data_set='test'; | ||
| 12 | end | ||
| 13 | if(nargin <=2) | ||
| 14 | imageSize = 100; | ||
| 15 | end | ||
| 16 | |||
| 17 | num_segs = 20; | ||
| 18 | if(strcmp(type, 'test')) | ||
| 19 | num_segs = 1; | ||
| 20 | elseif(strcmp(type, 'sim_fast')) | ||
| 21 | num_segs = 1; | ||
| 22 | elseif(strcmp(type, 'sim')) | ||
| 23 | num_segs = 2; | ||
| 24 | elseif(strcmp(type, 'sqcif')) | ||
| 25 | num_segs = 3; | ||
| 26 | elseif(strcmp(type, 'qcif')) | ||
| 27 | num_segs = 4; | ||
| 28 | elseif(strcmp(type, 'cif')) | ||
| 29 | num_segs = 8; | ||
| 30 | elseif(strcmp(type, 'vga')) | ||
| 31 | num_segs = 13; | ||
| 32 | elseif(strcmp(type, 'wuxga')) | ||
| 33 | num_segs = 32; | ||
| 34 | end | ||
| 35 | |||
| 36 | path(path, [toolDir,'/MultiNcut']); | ||
| 37 | path(path, common); | ||
| 38 | |||
| 39 | img_filename = [dataDir, '/1.bmp']; | ||
| 40 | %I=imread(img_filename); | ||
| 41 | %I = rgb2gray(I); | ||
| 42 | |||
| 43 | I = readImage(img_filename); | ||
| 44 | |||
| 45 | %% Self check params | ||
| 46 | tol = 0.1; | ||
| 47 | elapsed = zeros(1,2); | ||
| 48 | rows = size(I,1); | ||
| 49 | cols = size(I,2); | ||
| 50 | fprintf(1,'Input size\t\t- (%dx%d)\n', rows, cols); | ||
| 51 | |||
| 52 | %% Timing | ||
| 53 | start = photonStartTiming; | ||
| 54 | |||
| 55 | [SegLabel,eigenVectors,eigenValues]= MNcut(I,num_segs); | ||
| 56 | |||
| 57 | %% Timing | ||
| 58 | stop = photonEndTiming; | ||
| 59 | |||
| 60 | temp = photonReportTiming(start, stop); | ||
| 61 | elapsed(1) = elapsed(1) + temp(1); | ||
| 62 | elapsed(2) = elapsed(2) + temp(2); | ||
| 63 | |||
| 64 | %% Self checking | ||
| 65 | writeMatrix(SegLabel, dataDir); | ||
| 66 | |||
| 67 | %% Timing | ||
| 68 | photonPrintTiming(elapsed); | ||
| 69 | |||
| 70 | for j=1:size(SegLabel,3), | ||
| 71 | [gx,gy] = gradient(SegLabel(:,:,j)); | ||
| 72 | bw = (abs(gx)>0.1) + (abs(gy) > 0.1); | ||
| 73 | |||
| 74 | figure(1);clf; J1=showmask(double(I),bw); imagesc(J1);axis image; axis off; | ||
| 75 | set(gca, 'Position', [0 0 1 1]); | ||
| 76 | end | ||
| 77 | |||
| 78 | |||
