Commit 79657b4e355fc3f8c681c574928279b076ef4846

Authored by Paul Nicot
1 parent 5872298f
Exists in master

prise en compte des dates lors du traitements des images.

Showing 1 changed file with 25 additions and 6 deletions   Show diff stats
r_interp_pitle_2016.m
1   -function r_interp_pitle_2016(cam,iFirst,iNum)
  1 +function r_interp_pitle_2016(cam,iBegin,iSkip,iEnd)
2 2 % R_INTERP_OPC - Uses the rectification data to interpolate RGB values on a
3 3 % regular grid and save it to an image. It is specifically adapted to
4 4 % images taken from the Observatoire du Pic Champlain (OPC)
5 5  
6 6 rootdir = '/share/archives/dumoda01/data/photogrammetry/pitle/2016/';
7 7  
8   -%
  8 +%% image repertory
  9 +
  10 +imfiles = dir([rootdir,cam,'/original/2016*']);
  11 +
  12 +%% area masking
9 13 if cam == 'heroE'
10 14 lon1 = -77.4398; lon2 = -76.2889;
11 15 lat1 = 72.7179; lat2 = 72.9484;
... ... @@ -36,11 +40,13 @@ elseif cam == 'erikH'
36 40 elseif cam == 'guysB'
37 41 lon1 = -76.8429; lon2 = -75.7753;
38 42 lat1 = 72.5978; lat2 = 72.8511;
39   - mask = ones(5184,3456);
  43 + mask = ones(5517,3979);
40 44 mask(:,1:1500) = NaN;
41 45 mask(:,2300:end) = NaN;
  46 + imfiles = dir([rootdir,cam,'/original/2016*_rotated.jpg']);
42 47 end
43 48  
  49 +%% x/y resolution
44 50 dx = 0.0008; dy = 0.0002;
45 51 x1vec = lon1:dx:lon2;
46 52 y1vec = lat1:dy:lat2;
... ... @@ -50,6 +56,8 @@ ypolyvec = [lat1 lat2 lat2 lat1];
50 56  
51 57 [X1,Y1] = meshgrid(x1vec,y1vec);
52 58  
  59 +
  60 +%% data loading
53 61 load([ rootdir cam '/work/g_rect_' cam '_20160630.mat']);
54 62  
55 63 LON = mask.*LON;
... ... @@ -57,10 +65,21 @@ LAT = mask.*LAT;
57 65  
58 66 x1 = LON(:); x2 = LON(:);
59 67 y1 = LAT(:);
60   -imfiles = dir([rootdir,cam,'/original/2016*']);
61   -%nFiles = size(imfiles,1);
62 68  
63   -for n = iFirst:(iFirst + iNum)
  69 +%% time retreaving
  70 +for i = 1:length(imfiles)
  71 + imfiles(i).N = datenum(imfiles(i).name(1:15),'yyyymmdd_HHMMSS');
  72 +end
  73 +
  74 +nBegin = datenum(num2str(iBegin),'yyyymmddHHMM');
  75 +nEnd = datenum(num2str(iEnd),'yyyymmddHHMM');
  76 +
  77 +N = [imfiles.N];
  78 +N = find(N>nBegin & N<nEnd);
  79 +
  80 +
  81 +%% image processing loop
  82 +for n = N(1):iSkip:N(end)
64 83 imfilename = imfiles(n).name;
65 84 imNumber = imfilename(1:15);
66 85  
... ...