Leica ADSL1SDK UserManual v1.1.0-11 en
Leica ADSL1SDK UserManual v1.1.0-11 en
User Manual
Version 1.1
English
Copyright and Remarks
Copyright Without prior permission in writing by Leica Geosystems AG (Switzerland), this docu-
ment shall not be reproduced as a whole or in part, by mechanical, photographic, elec-
tronic, or other means (including into or transmission in machine-readable form);
stored in any retrieval system; used for any purpose other than that/those for which
it is intended; nor made accessible or communicated in any form to any third party not
expressly authorized by Leica Geosystems AG to have access thereto.
Symbols The symbols used in our manuals have the following meanings.
Type Description
Such agreement is provided together with all products and can also be found at the
Leica Geosystems home page at http://www.leica-geosystems.com/swlicense or your
Leica Geosystems dealer.
You must not install or use the software unless you have read and accepted the terms
and conditions of the Leica Geosystems Software License Agreement. Installation or
use of the software or any part thereof, is deemed to be an acceptance of all the
terms and conditions of such license agreement. If you do not agree to all or some of
the terms of such license agreement, you may not download, install or use the soft-
ware and you must return the unused software together with its accompanying docu-
mentation and the purchase receipt to the dealer from whom you purchased the
product within ten (10) days of purchase to obtain a full refund of the purchase price.
Available
Name of docu-
documentation
mentation Description
Leica ADS L1 All instructions required in order to operate the product to a basic
SDK level are contained in this User Manual. Provides an overview of the
User Manual system together with technical data and safety directions.
2
Table of Contents
1 About Leica ADS L1 SDK 5
2 Leica ADS L1 SDK Introduction 7
2.1 What's New 8
2.2 Naming Conventions 9
3 Installation 11
4 Leica ADS L1 Sensor Model 13
4.1 Math Model 13
4.1.1 Image to Ground Transformation for Level 0 Imagery 13
4.1.2 Image to Ground (LSR) Transformation for Level 1 Imagery 13
4.2 Interior Orientation 14
4.2.1 Camera Calibration 14
4.2.2 IMU Misalignment 14
4.3 Exterior Orientation 15
4.4 Rectification 15
5 Selected Ground Processing supplied by Leica Geosystems 17
5.1 Downloading 17
5.2 Positioning Post-Processing 17
5.3 Level 1 Creation 18
6 Meta Data Information 19
6.1 Support File 19
6.2 Image 20
6.3 Camera Calibration 21
6.4 Orientation Data 23
7 Coordinate Systems 25
7.1 Image Coordinate System 25
7.2 Focal Coordinate System 26
7.3 Ground Coordinate System LSR 26
8 Usage of the SDK 27
8.1 Getting Data 27
8.2 Usage of the SDK for native 64-bit Software 28
8.3 Usage of the SDK for native 32-bit Software 30
To the full extent permissible by applicable law, Leica Geosystems AG disclaims all
warranties, express or implied, including, but not limited to, implied warranties of
merchantability and fitness for a particular purpose.
Leica Geosystems AG will not be liable for any damages of any kind arising from the
use of this software development kit (SDK), including, but not limited to direct, indi-
rect, incidental, punitive, and consequential damages.
References Tempelmann U., Börner A., Chaplin B., Hinsken L., Mykhalevych B., Miller S., Recke U.,
Reulke R., Uebbing R., 2000. Photogrammetric Software for the LH Systems ADS40
Airborne Digital Sensor, XIXth ISPRS Congress, Amsterdam.
Internet For more information visit our websites:
http://www.leica-geosystems.com
http://www.ziimaging.com
Email: [email protected]
Support
Region Contact e-mail
Americas [email protected]
U.S.A., Canada, Central & South America
Asia / Pacific [email protected]
(including Australia, China, Japan and Korea)
Europe, Middle East & Africa [email protected]
The Leica ADS is a multiple Digital Line Sensor, built on the three-line principle,
recording continuously as the aircraft moves, Figure 1. The produced imagery can be
viewed in stereo and used for all further photogrammetric processes, for example DTM
generation, orthophoto production, feature extraction and image analysis. For a more
detailed discussion of the characteristics of the sensor and the ground processing
software, please refer to Tempelmann et al, 2000. For an overview of the ground
processing flow see Figure 2.
Leica XPro 6.3 correct this by smoothing the external orientation parameters (EOP)
and using a DEM for the processing of L1 images instead of a flat surface. These
changes results in a new SDK and also a new plugin for Socet Set 5.6.
To get the full performance a global elevation model is needed. It is necessary to use
the same elevation source in the SDK as it was used for generating the Leica ADS L1
image with the product generator. For example you can use the 30 m "SRTM" data, for
example:
http://dds.cr.usgs.gov/srtm/version2_1/SRTM30/
It might be necessary to update the xpro.ini file from Leica XPro (bin\xpro.ini):
The following table shows the areas where changes might be necessary, especially for
setting path to SRTM data which is not done automatically:
[GTopo]
; location and filename for the GTopo global elevation database file
; default is $etc_folder/dem/gtopoDem_ell.jptf
datafile = T:/testdata/runtime_data/dem/gtopoDem_ell.jptf
[SRTM]
datapath = U:/corelibs/dsmtools/SRTM3_unittests
[Persistence]
; location and filename for the schema file
; default is $etc_folder/schemas/persschema.xml
; commented out by default
; schemafile = $etc_folder/schemas/persschema.xml
Note: Use slash "/" instead backslash "\". Otherwise the path will not be set correctly.
Both, the digital frame sensor model and the Leica ADS sensor model, are based on
the collinearity equations, there are significant differences in handling the data and
performing image matching (required for triangulation). The following table gives an
overview of the differences between the digital frame sensor and Leica ADS sensor
models:
Where
m is the rectification scale (keyword RECT_SCALE)
xoffset is the rectification offset in x (RECT_XOFFSET)
yoffset is the rectification offset in y (RECT_YOFFSET)
α is the rectification rotation angle (RECT_ROTATION
height is the rectification height (RECT_HEIGHT)
p1s image coordinate in image width/sample direction, origin of the
coordinate system is mid of upper left pixel, unit is [Pixel]
pl1 image coordinate in image height/line direction, origin of the coordinate
system is mid of upper left pixel, unit is [Pixel]
lines Number of lines / rows of L1 image
1. Convert the raw attitude data into the local frame system used by Leica IPAS. This
step is performed by standard Leica IPAS Pro software. The output is the attitude
given as raw, pitch and yaw angles.
2. Transformation of the local frame system into LSR systems. The LSR systems are
the object spaces used for photogrammetric processing. To define this system an
anchor point in WGS84 must be established. Also the time synchronization is done
in this step. The output is a set of orientation data (X, Y, Z, omega, phi, kappa) for
each scan line of the image.
4.4 Rectification
Owing to the movements of the aircraft the resulting level 0 image (L0) will be not
matched. Also, stereo viewing and feature extraction are usually not possible with L0
imagery. To generate (rectified imagery that fulfils the requirements for data
processing mentioned above, L1 rectifiers (disk-to-disk or disk-to-viewer "on the fly")
are included in the Leica ADS ground processing packages. This program rectifies the
image content on the horizontal plane in object space by usage of orientation data,
camera calibration and L0 image. The resulting images can be viewed in stereo (any
combination of two lines), assuming the user has access to an adequate system. Also,
image matching could be applied afterwards.
5.1 Downloading
To provide the files described in detail below it is necessary to run low-level software
that reads out the Leica ADS Mass Memory (MM) and separates the data stream into
readable files (download step in Figure 2). These files can be categorized into meta-
files (session, take, image information), image data files and positioning data files.
Figure 4 - Downloading
Figure 5 - L0 creation
Figure 6 - L1 creation
Keyword Description
Support_file Version number of the support file. Currently set to d.
IMAGE_ID Base name of the image, do not contain any extensions or other
information.
IMAGE_FILE_NAME x Concrete file name of an image with a given minification level (overviews)
The x value starts with one and doubles always for the next minification
LINES
levels (2,4,8,16,32,…). If the overviews are included, only one file is given.
SAMPLES If external overviews are used, several files will be set. This parameter
comes always with LINES and SAMPLES showing the size of the image.
IMAGE_LEVEL Indicates the image level. The SDK can handle only L1 images. Therefore
this parameter must be set to 1.
MEAN_TERRAIN_HEIGHT Mean terrain height of the project given in project units.
LINE_STAGGERED Indicates whether the output is in high res mode (staggered lines) or not
(True/False).
VIEW_OF_LINE Indicates the view of the CCD-line, could be NADIR, FORWARD, BACKWARD
RADIOMETRIC_PROPERTY Indicates the bands used for this image. Depending on the sensor system it
could be RGB, PANCHROMATIC, RED, GREEN, BLUE,
NEAR_INFRARED,FAR_INFRARED.
IMAGE_DATE Date of image recording
ANCHOR_LATITUDE Latitude of anchor point using WGS84, geographical coordinate system
units in radians Latitude is measured from the equator, positive to the
north.
ANCHOR_LONGITUDE Longitude of anchor point using WGS84,. Longitude is measured from
Greenwich Meridian to the east, Unit is radians.
NUMBER_SCAN_LINES Number of original scan lines, is normally not equal with image width of the
L1 image.
SENSOR_ROTATON Flag to indicate whether sensor has rotated at installation, normally FALSE
otherwise TRUE.
ORIGINAL_ORIENTATION Name of the original orientation file (ODF-Format). Not given for ADS100
L1 images with DEM correction. Here the files recorded by the sensor
system (EOP Files) are used.
ADJUSTED_ORIENTATION Name of the orientation file after bundle adjustment (ODF-Format). Not
given for ADS100 L1 images with DEM correction. Here the adjusted EOP
files are used.
CALIBRATION For all none L1 images with DEM the file is given in CAM-Format. For L1
images with DEM a calibration folder is given only. While for ADS100 the
folder has XML files for all other systems the CAM format is used.
ADJUSTED_CALIBRATION Same as for calibration, but containing corrected calibration parameter
after bundle adjustment (“Self-Calibration”).
SENSOR_TYPE Showing the used Sensor Type. The new SDK is listening to:
Keyword Description
RECT_SCALE Rectification Scale, (inverse GSD)
RECT_ROTATION Rotation angle used for rectification, given in radians
RECT_XOFFSET X offset between coordinate origin of LSR and origin of Level 1 image
RECT_YOFFSET Y offset between coordinate origin of LSR and origin of Level 1 image
RECT_HEIGHT Height of the rectification plane, given in project units. Calling Function
image2ground of the SDK will use this height if no other height is given.
The next few entries are only visible for L1 images with DEM corrections:
Keyword Description
MODEL_INFORMATION Path to information to calculate the mapping between L1 image and ground.
Use only for ADS100 L1 images with DEM corrections.
REFERENCE_BAND Master band of multispectral image (e.g. RGB image). The calibration of this
band is used. Only available for L1 images with DEM corrections.
MODEL_METHOD Showing used method, available only for L1 images with DEM corrections.
Should be STEREO_DSM.
ELEVATION_SOURCE DEM to correct L1 images. Currently only global DSM (parameter: GlobalDEM)
with SRTM (parameter SRTMElevationSource) or GTopo (parameter
GTopoElevationSource) is used. In general:
6.2 Image
Description Imagery can be stored and read with either 8-bit or 16-bit pixel depth. The actual
image format depends on the option set by the user at processing time. A variety of
formats are supported by Leica XPro. Cause of compatible reasons with as many
systems as possible, it is recommended to use TIFF tiled format for 8 and 16-bit
imagery (optionally JPEG compressed for 8-bit imagery). Downloaded raw images are
normally stored in proprietary formats, which use hardware compression method.
Due to the nature of the Leica ADS imagery, typically spanning over multiple gigabytes
for output products, a Leica ADS file format was developed. This format is discussed
in detail below.
Leica ADS file Due to the limitations of popular formats, such as TIFF (4GB), it was necessary to
format define a new format to extend them. The aim was to retain the underlying format, but
to allow limitless image file sizes. The notion of sub-blocking was introduced where
the format would define a number of images that were butt matched.
The Leica ADS file is a simple ASCII header that describes the sub-image blocks sizes
and how the images are arranged. The image handling software has to be coded to
handle the butt matched sub-image blocks. In the example dataset the RGB L1 image
was created with 3 sub-blocks with a maximal sub-block size of 2GB. This size is
selectable in.
The following is the full listing of the Leica ADS file for the RGB L1 image. Note, it
consists of six sub images.
ADS_HEADER 1
BANDS 3
DEPTH 2
BITS 16
LINES 12640
SAMPLES 57008
TILE_Y 400
TILE_X 400
HARDWARE_COMPRESSED 0
LINES_PER_BLOCK 12640
SAMPLES_PER_BLOCK 24400
BLOCK_DATA 0 0 L106260944RGBF16A_0_0.tif
BLOCK_DATA 0 1 L106260944RGBF16A_0_1.tif
BLOCK_DATA 0 2 L106260944RGBF16A_0_2.tif
The camera calibration is stored in an ASCII text file or XML File for Leica ADS100 L1
images with DEM correction. The next section gives an overview of the format.
CAM-Format The file contains a header with exactly 9 lines and shows the following:
Keyword Description
ADS_CALIBRATION_FILE Version number of the calibration file
CALIBRATION_SOURCE Name of the calibration source
CAMERA_NAME Name of the camera
SENSOR_LINE Line identifier
CALIBRATION_DATE Date of calibration
FOCAL_LENGTH_MM Focal length in mm
NUM_PIXELS Number of calibrated pixel
PIXEL_SIZE Pixel size in mm
PAV_Z_OFFSET Offset from the PAV to the lens node (m)
RADIOMETRIC_GAIN Radiometric gain
IRRADIANCE_GAIN Irradiance gain
LEFTSIDE_GAIN Left side gain
START_XY Indicator that the following is calibration data
END_XY End of the calibration data
Note: The order of lines 2 through 8 is not fixed. Although the above order is written
in the order above, the reader should never rely on this order.
The coordinate system of the sensor focal plane is defined as the x axis in the direction
of the flight, the z axis pointing to the earth and the y axis complementing a right-
handed system. The first pixel of a scan line is the point with the smallest Y value and
corresponds to the left edge of the L0 image. So, the first pixel of the first scan line
will correspond to the upper left pixel of the image.
XML-Format For compatibility reasons with old SDK implementation, the XML format is used only
for Leica ADS100 L1 images with DEM correction. The calibration folder contains
corrections for PRNU and DSNU as well as for the geometric correction. The next figure
shows an excerpt.
Example geometric calibration, example contains only data of one sensor. Normally
data for all sensors are given.
The coordinate system is an LSR system. Its origin is a specified latitude and longitude
in WGS84 with a height of 0 (anchor point). The direction of the X axis is East, the Y
axis points towards North, and the Z axis is perpendicular to the plane defined by X
and Y complementing a right handed coordinate system.
The orientation file holds the exterior orientation for each scanned image line from
the Leica ADS. The orientation file has exactly one set of orientation per image line in
the L0 image. Additionally to the actual orientation (x, y, z, omega, phi, kappa) also
the GPS time and the standard deviations for the positions and angles are stored in
this file.
The orientation is crucial for geo-referencing any kind of Leica ADS imagery and plays
a central role in the triangulation process. The orientation data is stored in a binary
file with an ASCII header and has an "ODF" (orientation data file) extension. Its header
has a size of 512 Byte:
The binary part of the file contains the actual orientation data. The amount of orien-
tation sets and scan lines are exactly the same within one image. Each orientation set
has a size of 40 bytes and contains the following binary structure:
EOP Format The EOP file can be found in the folder /strips after Leica ADS100 L1 images with DEM
correction have been calculated.
Compared to the ODF it is not directly synchronized with the L1 image. Therefor an
interpolation with the data is needed getting the correct orientation for each scan line
of L1 images.
In general the origin of the Socet Set Coordinate system is shifted by ½ pixel in x- and
y-direction in respect to the image mid. x-axis and y-axis have the same direction as
the image coordinate system.
In the focal plane each pixel gets a physical location expressed in a coordinate system
defined by the nadir line. The y-axis is defined by the nadir scan line and the x axis is
perpendicular to the y axis going through the center of the scan line. Positive x follows
the flight direction and y complements a right-handed system.
Note: The sensor might be rotated by 180 degrees. This can be checked by the
keyword "SENSOR_ROTATION". See chapter 6.1 "Support File".
The SDK comes also with Microsoft Visual Studio project (VS 2010). The software is
only tested and verified with this compiler.
The figure below in Leica XPro shows a typical data set where a DEM is used. Only with
this settings L1 images with DEM correction will be calculated. Setting "Minifications"
to External Overviews (Socet Set Format) is also recommended if you want to use the
Socet Set 5.6 plugin (optional).
The output is split into two views of processed stereo images. Folders like "Backward"
and "Nadir" contain all necessary information about image sets. The first level contains
the image data (including overviews) as well as the support file. Two sub folders, one
(SHxx_yyyyy) contains the calibration data and the other one ("strips") is having infor-
mation about the flight parameters like exterior orientation.
All given paths in the support file are relative paths in respect to the location of the
support file for the output. Because of this, the whole folder structure can be moved
to any location without changing paths inside the support file.
std::auto_ptr<L1SensorAds> sensorModel;
try {
sensorModel.reset(L1SensorAds::create(parseCmd.supportFile.c_str()));
}
catch (std::exception& e)
{
std::cerr << "Error during sensor model init: " << e.what() << std::endl;
return -1;
}
The code fragment above gets the support file name from a parser of the command
line (std::string) and creates a new sensor model (see also delivered project example).
In case of failure an exception will be thrown showing up the reason.
Afterwards the SDK can be used for example to map an image coordinate, given in
Socet Set Coordinate System (see chapter 7 "Coordinate Systems") to a ground given
in LSR:
try {
sensorModel->imageToGround(image[0], image[1],ground[0],ground[1],ground[2]);
dataOut.Add(data,3);
}
catch (std::exception& e) {
std::cerr << "Point : " << image[0] << "/" << image[1] << ": " << e.what() << std::endl;
}
The example above maps the image coordinate {0,0} to LSR, where the height is set
to the rectification height automatically. The following section is describing all func-
tions in detail:
/// Maps image Socet Set coordinates to LSR Ground on a given height
/// @param xIm coordinate [Pixel], origin image mid, x-direction (=image col,sample)
/// from left to right (image width)
/// @param yIm coordinate [Pixel], origin image mid, y-direction (=image row,lines)
/// from top to bottom (image height)
/// @param z [m] ground height to map image coordinates
/// @param x [m] x value on ground, mapped to Ground LSR
/// @param y [m] y value on ground, mapped to Ground LSR
virtual void imageToGround(const double xIm, const double yIm, const double height,
double &x, double &y, double &z) const = 0;
/// Maps image Socet Set coordinates to LSR Ground using rectification height
/// @param xIm coordinate [Pixel], origin image mid, x-direction (=image col,sample)
/// from left to right (image width)
/// @param yIm coordinate [Pixel], origin image mid, y-direction (=image row,lines)
/// from top to bottom (image height
/// @param x [m] x value on ground, mapped to Ground LSR
/// @param y [m] y value on ground, mapped to Ground LSR
virtual void imageToGround(const double xIm, const double yIm,
double &x, double &y, double &z) const = 0;
While native 64-bit calls get directly interpreted by Leica XPro functions, 32-bit calls
will be mapped to the 64-bit environment. This is done by the 32-bit SDK through calls
via "adsl-sharedmem.exe". Such mapping cost processing time if 32-bit application
uses the SDK.
Following the acquisition of Intergraph by Hexagon in 2010, the newly formed Geospatial
Solutions Division has brought together Leica Geosystems Airborne Sensors and Z/I Imaging.
Committed to continued innovation on all major product lines, the combined airborne sensor
portfolio includes the widest range of medium and large format imaging as well as LIDAR
technologies and offers a choice of sensor for every application. A full suite of software from
flight planning to post-processing provides end-to-end workflow for high accuracy
orthophoto generation, feature extraction and map production. In addition, Hexagon
Geosystems operates a global network of customer service and support centers to ensure
highest productivity around the clock.
Illustrations, descriptions and technical specifications are not binding and may change.
Printed in Switzerland - Copyright Leica Geosystems AG, Heerbrugg, Switzerland, 2015.
Version 1.1.0en - 1.11
Leica Geosystems AG
Heinrich-Wild-Strasse
CH-9435 Heerbrugg
Switzerland
Phone +41 71 727 31 31
www.leica-geosystems.com 31