source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/BlueCCal/MultiCamSelfCal/MartinecPajdla/fill_mm/subseq_longest.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 744 bytes
Line 
1%subseq_longest Find the longest continuous subsequences in columns of MM.
2%
3%  Put the initial image of the longest continuous subsequence of known
4%  points in column ``p'' to ``b(p)''.
5%
6%  [b, len] = subseq_longest(I)
7%
8%    Parameters:
9%      len  ... len(p) is length of the longest continuous
10%               subsequence of known points in column ``p''
11
12function [b, len] = subseq_longest(I)
13
14[m n]      = size(I);
15
16b(n)       = 0;  % memory allocation
17len(n) = 0;  % "               "
18
19for p = 1:n
20  seq(1:m) = 0;
21  l        = 1;
22  for i = 1:m
23    if I(i,p)
24      seq(l) = seq(l) +1;
25    else
26      l      = i+1;
27    end
28  end
29  len(p)     = max(seq);
30  best       = find(seq == len(p));
31  b(p)       = best(1);
32end
33
34%b(:) = 1;  % debug
Note: See TracBrowser for help on using the repository browser.