Vous êtes sur la page 1sur 31

Using OSSIM For Orthorectication

Stanislav Bobovych
University of Arkansas
sbobovyc@uark.edu
December 20, 2011
Stanislav Bobovych (U of A) GIS December 20, 2011 1 / 31
Outline
1
Introduction
2
Background
3
System
4
Setup
5
Tools
6
OSSIM + MPI
7
Performance
8
Razor PBS script
Stanislav Bobovych (U of A) GIS December 20, 2011 2 / 31
Outline
1
Introduction
2
Background
3
System
4
Setup
5
Tools
6
OSSIM + MPI
7
Performance
8
Razor PBS script
Stanislav Bobovych (U of A) GIS December 20, 2011 3 / 31
Introduction
Goals
Compiling OSSIM
Basic tools and usage
Parallel orthorectication
Stanislav Bobovych (U of A) GIS December 20, 2011 4 / 31
Outline
1
Introduction
2
Background
3
System
4
Setup
5
Tools
6
OSSIM + MPI
7
Performance
8
Razor PBS script
Stanislav Bobovych (U of A) GIS December 20, 2011 5 / 31
Background
Started in 1997 by ImageLinks Inc.
Team wanted to move away from expensive Sun and SGI workstations
and license software to cheap PCs and open source.
Evolved over the years.
Stanislav Bobovych (U of A) GIS December 20, 2011 6 / 31
Outline
1
Introduction
2
Background
3
System
4
Setup
5
Tools
6
OSSIM + MPI
7
Performance
8
Razor PBS script
Stanislav Bobovych (U of A) GIS December 20, 2011 7 / 31
System
Kernel
$ uname -r -s -i
Linux 3.0.0-13-generic x86_64
OS
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric
GCC
$ gcc --version
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Stanislav Bobovych (U of A) GIS December 20, 2011 8 / 31
Outline
1
Introduction
2
Background
3
System
4
Setup
5
Tools
6
OSSIM + MPI
7
Performance
8
Razor PBS script
Stanislav Bobovych (U of A) GIS December 20, 2011 9 / 31
Setup
OSSIM Trac
http://trac.osgeo.org/ossim/
OSSIM Dependencies
libjpeg, libti, libgeoti, libopenthreads
$ sudo apt-get install \
libjpeg62-dev libtiff4-dev libgeotiff-dev libopenthreads-dev
Correcting libjpeg
$ file /usr/lib/x86_64-linux-gnu/libjpeg.so
/usr/lib/x86_64-linux-gnu/libjpeg.so: symbolic link to libjpeg.so.62.0.0
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
Stanislav Bobovych (U of A) GIS December 20, 2011 10 / 31
Setup cont.
$ wget http://download.osgeo.org/ossim/src/ossim-1.8.4.tgz
$ tar zxf ossim-1.8.4.tgz
$ cd ossim-1.8.4/ossim
$ ./configure
$ make
$ sudo make install
$ ossim-info --version
ossim-info: error while loading shared libraries:
libossim.so.1: cannot open shared object file:
No such file or directory
$ sudo ldconfig
$ ossim-info --version
OSSIM Version 1.8.4 (20111211)
Stanislav Bobovych (U of A) GIS December 20, 2011 11 / 31
Elevation setup
Resources
http://trac.osgeo.org/ossim/wiki/orthoigen
http://trac.osgeo.org/ossim/wiki/ossimElevationSetup
http://trac.osgeo.org/ossim/wiki/ossimPreferenceFile
http://www.ossim.org/OSSIM/Articles/Entries/2007/3/6_
Elevation_Setup.html
http://dds.cr.usgs.gov/srtm/
We need...
Geoid grids
ossim-1.8.4/ossim_package_support/geoids/geoid1996/egm96.grd
Elevation cells
$ cd /home/sbobovyc/data/elevation/srtm/version1/South_America
$ wget -r -l 1 -A zip -nd http://dds.cr.usgs.gov/srtm/version1/South_America/
$ for z in *.zip; do unzip $z; done
Stanislav Bobovych (U of A) GIS December 20, 2011 12 / 31
Preference le
Template
ossim-1.8.4-ossim/etc/templates/ossim_preferences_template
or http://trac.osgeo.org/ossim/browser/trunk/ossim/etc/
templates/ossim_preferences_template
elevation_manager.elevation_source1.connection_string:
/home/sbobovyc/data/elevation/srtm/version1/South_America
elevation_manager.elevation_source1.type: srtm_directory
elevation_manager.elevation_source1.geoid.type: geoid1996
elevation.enabled: true
elevation.auto_sort.enabled: true
geoid_egm_96_grid: /home/sbobovyc/ossim-1.8.4/ossim_package_support/geoids/geoid1996/egm96.grd
Stanislav Bobovych (U of A) GIS December 20, 2011 13 / 31
Test elevation setup
$ ossim-height -P /home/sbobovyc/ossim_preferences 0 -52
Opened cell: /home/sbobovyc/data/elevation/srtm/version1/South_America/N00W052.hgt
MSL to ellipsoid delta: -24.1580009460449
Height above MSL: 97
Height above ellipsoid: 72.8419990539551
Geoid value: -24.1580009460449
Stanislav Bobovych (U of A) GIS December 20, 2011 14 / 31
Outline
1
Introduction
2
Background
3
System
4
Setup
5
Tools
6
OSSIM + MPI
7
Performance
8
Razor PBS script
Stanislav Bobovych (U of A) GIS December 20, 2011 15 / 31
Binary list
ossim-adrg-dump ossim-dump-ocg ossim-mosaic
ossim-applanix2ogeom ossim-ecg2ocg ossim-ogeom2ogeom
ossim-band-merge ossim-extract-vertices ossim-orthoigen
ossim-btoa ossim-foo ossim-pixelflip
ossim-chgkwval ossim-height ossim-prune
ossim-cmm ossim-icp ossim-rejout
ossim-computeSrtmStats ossim-igen ossim-senint
ossim-correl ossim-img2md ossim-space-imaging
ossim-create-cg ossim-img2rr ossim-swapbytes
ossim-create-histo ossim-img2vrr ossim-tfw2ogeom
ossim-deg2dms ossim-info
ossim-dms2deg ossim-modopt
Stanislav Bobovych (U of A) GIS December 20, 2011 16 / 31
Image info
$ ossim-info -i 06DEC05154503-P1BS-005650937010_01_P001.NTF
image0.band0.max_value: 2047
image0.band0.min_value: 1
image0.band0.null_value: 0
image0.entry: 0
image0.lr_x: 27551
image0.lr_y: 27503
image0.number_decimation_levels: 1
image0.number_input_bands: 1
image0.number_lines: 27504
image0.number_output_bands: 1
image0.number_samples: 27552
image0.radiometry: 11-bit
image0.ul_x: 0
image0.ul_y: 0
number_entries: 1
Stanislav Bobovych (U of A) GIS December 20, 2011 17 / 31
Working on the image
Scaling
$ ossim-orthoigen --geo -t 1024 \
06DEC05154503-P1BS-005650937010_01_P001.NTF scaled.jpg
Stanislav Bobovych (U of A) GIS December 20, 2011 18 / 31
1021x1024
Stanislav Bobovych (U of A) GIS December 20, 2011 19 / 31
Working on the image
Orthorectication
$ ossim-orthoigen -P /home/sbobovyc/ossim_preferences \
06DEC05154503-P1BS-005650937010_01_P001.NTF rect.jpg
Stanislav Bobovych (U of A) GIS December 20, 2011 20 / 31
1021x1024
Stanislav Bobovych (U of A) GIS December 20, 2011 21 / 31
Working?
$ compare scaled.jpg rect.jpg diff.jpg
1021x1024
Stanislav Bobovych (U of A) GIS December 20, 2011 22 / 31
Outline
1
Introduction
2
Background
3
System
4
Setup
5
Tools
6
OSSIM + MPI
7
Performance
8
Razor PBS script
Stanislav Bobovych (U of A) GIS December 20, 2011 23 / 31
Compiling OSSIM with MPI support
MPI Dependencies
OpenMPI
$ sudo apt-get install mpi-default-dev
Setup
Same as previous examples, except:
$ ./configure --with-mpi=1 --with-openmpi-flag=1
On razor, libraries are in non-standard locations, so:
./configure \
--with-openthreads=/home/sbobovyc/OpenThreads \
--with-mpi=1 --with-openmpi-flag=1 \
--with-mpi-lib=/share/apps/mpi/openmpi-1.5.1/gcc-4.1.2/lib \
--with-mpi-inc=/share/apps/mpi/openmpi-1.5.1/gcc-4.1.2/include/
Working on the image
$ mpirun -n 4 ossim-orthoigen -P /home/sbobovyc/ossim_preferences input.NTF out.png
Stanislav Bobovych (U of A) GIS December 20, 2011 24 / 31
Outline
1
Introduction
2
Background
3
System
4
Setup
5
Tools
6
OSSIM + MPI
7
Performance
8
Razor PBS script
Stanislav Bobovych (U of A) GIS December 20, 2011 25 / 31
Data
06DEC05154503-P1BS-005650937010 01 P001.NTF
27552x27504
1 band, unsigned int (16 bits)
1.5G
Stanislav Bobovych (U of A) GIS December 20, 2011 26 / 31
Outline
1
Introduction
2
Background
3
System
4
Setup
5
Tools
6
OSSIM + MPI
7
Performance
8
Razor PBS script
Stanislav Bobovych (U of A) GIS December 20, 2011 27 / 31
#PBS -N ossim-mpi.job
#PBS -q med
#PBS -o results/ossim-mpi.output.$PBS_JOBID
#PBS -j oe
#PBS -l nodes=1:ppn=12
#PBS -l walltime=10:00:00
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/sbobovyc/ossim-1.8.4-mpi/ossim/lib:/home/sbobovyc/OpenThreads/lib
IN_IMG=/scratch/sbobovyc/ortho/img/005650937010_01_P001_PAN/06DEC05154503-P1BS-005650937010_01_P001.NTF
OUT_IMG=/scratch/sbobovyc/out-mpi.tif
BIN_DIR=/home/sbobovyc/ossim-1.8.4-mpi/ossim/bin
PREFS=/home/sbobovyc/ossim_prefs
du -h $IN_IMG
for i in 2 4 6 8 10 12
do
mpirun -n $i -machinefile $PBS_NODEFILE $BIN_DIR/ossim-orthoigen -P $PREFS $IN_IMG $OUT_IMG
sleep 5
done
Stanislav Bobovych (U of A) GIS December 20, 2011 28 / 31
Razor run times
Stanislav Bobovych (U of A) GIS December 20, 2011 29 / 31
Callgraph
$ kcachegrind ~/ossim-tests/callgrind.out.26179
Stanislav Bobovych (U of A) GIS December 20, 2011 30 / 31
Questions?
Stanislav Bobovych (U of A) GIS December 20, 2011 31 / 31

Vous aimerez peut-être aussi