CE 503 Q&A Fall 2004

Question 1.

  How to implement step 3(b)"initialize an output array" and
the '...,generte the XY-coordinate..."in step 4 in homework handout?
 I mean how to get the size of output array and how to generate the
XY-coord? Please advise. Thanks,

Answer:

see in the first part of the assignment it gives Xmin,
Ymin,Xmax,Ymax (same as Emin,Nmin,Emax,Nmax) and it also gives the
GSD (ground sample distance) = 0.5m. so you just divide the
range in Y by GSD to get the number of rows in the output, and
divide the range in X by the GSD to get the number of columns
in the output. these will be the dimensions of the image that
is produced as output. you cycle through the pixels in this
output image by something like:

               for i=1:number_rows
                 Y=Ymax - (i-1)*GSD
                 for j=1:number_columns
                   X=Xmin + (j-1)*GSD
                   (project, interpolate, store)
                   end
                 end

(note we want to write the image from the top row down, not the
bottom row up, since that is how images are stored)