
Figure 5.5: Input images
The second page of the Metria CityModeler Wizard asks for input images. Supported formats are TIFF and BIL.
When you press the Add... button, you get a file selection dialog. Browse to the image files you want to use and click on Open. You can choose both images in the same directory, by pressing Shift (for image files in succession) or Ctrl (for separate image files) while clicking on multiple file names. The filenames will appear in the list.
You can deselect an image by clicking on the file name in the list and then pressing Delete. Of course, this does not delete the image file - only its presence in your city modeling project.
A summary of the selected image in the list is displayed below the list. For a more comprehensive summary, including the sensor model, click the link below the summary. This will open a window with detailed information about the image. An HTML file, named *_info.html where * is the image file name, is also created in the same directory as the image. The HTML contains the same information as the information window.
To quickly see the location of an image, select the image in the list box and click on "Show image location in Google Maps". Your default browser will be launched and the image location will be shown in Google Maps.

Figure 5.6: Example of image location in Google Maps using Firefox 8.0.
The order in which you put the two images may be important: You will always make your measurements in the first image in the list. If there is a significant difference in image quality between the two images or if one of the image is multispectral, it may thus be a good idea to add the image with the best quality first.
The image data are not read at this point.
Supported image types
Image resampling
Rational function sensor model
Polynomial sensor model
Images may have one (grayscale) or more (multispectral) samples per pixel. They must have 16 bits per sample. Images may be stored in strips or tiles. Multi band images must be stored in separate plans, i.e. band by band. For an RGB image, this means that the data is stored RRR...GGG...BBB. If an image is stored in contiguous format (for an RGB image: RGBRGBRGB...), you have to restore the image into separate bands first.
Metria CityModeler uses a version of libtiff named BigTIFF which allows TIFF files to be more than 2^32 bytes (4 Gb). BigTIFF is not an official release of libtiff, but has been submitted for a future update of the TIFF standard. Metria CityModeler is currently based on libtiff version 4.0.0beta6 which includes BigTIFF and can be downloaded from ftp://ftp.remotesensing.org/pub/libtiff.
You will get a warning if the supplied images do not fullfill the requirements for Metria CityModeler. These requirements are listed below for the two valid sensor models.
Always make security backups of your images before using them in Metria CityModeler. You as a user of Metria CityModeler take the full responsibility for loss of data, read more here.
Images from different sensors can be combined to form a stereo pair. For example, you can load an Ikonos image as the first image and a QuickBird image as the second image.

Figure 5.7: Orientation and/or scale differ.
Choose "yes" to resample the secondary image so that it gets oriented and scaled as the primary image. (Hint: Choose the image with the best resolution as the secondary image - this image will be downsampled to the resolution of the primary image, which is faster than upsampling a low resolution image.) When you have selected "yes" a progress dialog will be displayed. Note that the time estimates are constantly updated - it is common that the time remaining increases for quite some time before it decreases again. To get a quick check of a mixed stereo pair, you can choose not to resample the images, but for convinient measurements we recommend you to do the resampling.
The resampled image may not have copied all the TIFF tags from the original image!
Rational functions is an approximations of the physical sensor. Intrisic and extrinsic orientation elements are not modelled explicitly, but rather by quotients of polynomials. The sensor geometry for a particular scene is defined by the coefficients of these polynomials.
This is the sensor model provided for Ikonos, QuickBird and WorldView stereo registrations. The rational functions refer pixels to latitude, longitude, height. Metria CityModeler will also export measured buildings in latitude, longitude, and height. To maintain a coordinate system with Y pointing north and X pointing east, latitude is interpreted as the object Y axis and longitude is interpreted as the object X axis.
The two images should be stored in two TIFF files. Each pixel has a radiometric resolution of 11 bits, but should be stored as 16 bit unsigned shorts. Images may be stored in strips or tiles.
The coefficients of the rational functions should be stored in accompanying files named filename_rcp.txt for Ikonos, filename.RPB for QuickBird and WorldView scenes or filename.rpc for Eros scenes.
If there is a rational polynom, but it is independent of Z, then the image is likely an ortho photo. A warning will be issued to make you aware of this. You may however still be able to derive 3D information if the other image is not also an ortho image. The quality may however suffer, depending on the quality of the digital surface model which was used to create the ortho photo.
| Identifier | Explanation |
| LINE_OFF: | offset for line (x) [pixels] |
| SAMP_OFF: | offset for sample (y) [pixels] |
| LAT_OFF: | offset for latitude (Y) [degrees] |
| LONG_OFF: | offset for longitude (X) [degrees] |
| HEIGHT_OFF: | offset for height (Z) [meters] |
| LINE_SCALE: | scale for line (x) [pixels] |
| SAMP_SCALE: | scale for sample (y) [pixels] |
| LAT_SCALE: | scale for latitude (Y) [degrees] |
| LONG_SCALE: | scale for longitude (X) [degrees] |
| HEIGHT_SCALE: | scale for height (Z) [meters] |
| LINE_NUM_COEFF_1: to LINE_NUM_COEFF_20: | coefficients for numerator of line rational function |
| LINE_DEN_COEFF_1: to LINE_DEN_COEFF_20: | coefficients for denominator of line rational function |
| SAMP_NUM_COEFF_1: to SAMP_NUM_COEFF_20: | coefficients for numerator of sample rational function |
| SAMP_DEN_COEFF_1: to SAMP_DEN_COEFF_20: | coefficients for denominator of sample rational function |
| Identifier | Explanation |
| lineOffset | offset for line (x) [pixels] |
| sampOffset | offset for sample (y) [pixels] |
| latOffset | offset for latitude (Y) [degrees] |
| longOffset | offset for longitude (X) [degrees] |
| heightOffset | offset for height (Z) [meters] |
| lineScale | scale for line (x) [pixels] |
| sampScale | scale for sample (y) [pixels] |
| latScale | scale for latitude (Y) [degrees] |
| longScale | scale for longitude (X) [degrees] |
| heightScale | scale for height (Z) [meters] |
| lineNumCoef | 20 coefficients for numerator of line rational function |
| lineDenCoef | 20 coefficients for denominator of line rational function |
| sampNumCoef | 20 coefficients for numerator of sample rational function |
| sampDenCoef | 20 coefficients for denominator of sample rational function |
Offset and scale parameters are used to increase the numerical stability of the models. Pixel and object coordinates are normalized with these values before the rational polynomials are applied. All in all 80 (4 times 20) coefficients are read from the file.
Note, that degrees are given in decimal, base 10 format.
As the rational functions model, the polynomial sensor model is an approximation of the physical sensor.
The two images should be stored in two 16-bit BIL files. The orientation parameters must be in a complemetary header file named *.hdr.
The two images should be named filename.bil. Each image should have a header file, filename.hdr. The header files must contain the following information:
| Identifier | Required value |
| METADATA_FORMAT | DIMAP |
| NCOLS | columns |
| NROWS | rows |
| NBANDS | 1 |
| NBITS | 16 |
| BYTEORDER | M or I |
| ULXMAP | X upper left |
| ULYMAP | Y upper left |
| XDIM | pixel x size in [M] |
| YDIM | pixel y size in [M] |
| N_PARALLAX_COEFS | 10 |
| PARALLAX_X0 | parallax origin in X |
| PARALLAX_Y0 | parallax origin in Y |
| PARALLAX_X(n) n=1..10 | parallax coeffs in X |
| PARALLAX_Y(n) n=1..10 | parallax coeffs in Y |