View
216
Download
0
Category
Preview:
Citation preview
Remote Sensing Object Based Image Analysis
RSOBIA
Version 7.183
Dr Tim Le Bas
National Oceanography Centre, UK.
tim.lebas@noc.ac.uk
1. Installation
From the website www.codemap.eu/Outputs there are two files to download:
RSOBIA_setup.exe (about 138Mb) RSOBIA.esriaddin (about 350Kb)
It is most likely that the version of ArcMap you are using is set to 32bit. An easy check may be to see where it is installed: if the base directory name is “Program Files (x86) this is a 32 bit installation. 64 bit machines can run ArcGIS Pro and will therefore require RSOBIA_setup64.exe but has not been rigorously tested. Stage 1: Double click to run the RSOBIA_setup.exe Executable
• Accept the license agreement
• Enter the user information
• Install the software in C:\Python27
(default) or anywhere else if
required
• You may need about 450Mb of
diskspace
• A shortcut folder will be created on
the Start Menu called RSOBIA
• You may need about 450Mb of
diskspace
An uninstall executable is created too. Over 5000 files are installed in the selected folder. The next stage of the RSOBIA setup is the installation of a new version of python (Version 2.7.9). If you have an even newer version of python (e.g. 2.7.10) you may cancel this part of the installation (as long as the installation folder was set to Python27).
Python 2.7.9 setup
• It is recommended that python2.7.9 is installed
for all users
• Install the software in the same directory as
RSOBIA setup – both defaults are C:\Python27
• You have to accept overwriting of existing files
Once the Python installation is complete you should get:
If you were to see the change repair or remove python window instead of the initial setup, use the repair option.
• Finally click on the Finish button for Python 2.7.9 and RSOBIA
Stage 2: Double click the RSOBIA.esriaddin
• Install Add‐in • It is not digitally signed
Stage 3: Run ArcMap • Right click in the grey toolbar area and select the “RSOBIA Toolbar”
If you are re‐installing the toolbar with a newer version you will need to remove the older version
first. Reinstallation of the RSOBIA setup executable is not required.
Stage 1: Run ArcMap • From the Customize Tab select the Add‐in Manager… • Select the Python Addin called Remote Sensing OBIA • Click “Delete this Add‐in”. It has been noticed that occasionally that this has to be done more than once. • Right click in the grey toolbar area and deselect the “RSOBIA Toolbar” • Exit ArcMap
Stage 2: Double click the RSOBIA.esriaddin • Install Add‐in
For further installation problems please e‐mail tim.lebas@noc.ac.uk Please include as many error messages as possible together with details of the computer environment (such operating system, ArcMap version, computer type). It has been noticed that installations in languages other than English can cause issues. Please try changing the ArcMap license to English before connecting help.
This can be done via the ArcGIS Administrator. Changing the language of the user interface does not require administrator privileges on the Windows operating system.
1. Using the ArcGIS Administrator, click the ArcGIS node in the table of contents. 2. Click Advanced. 3. Select the language (English) and click Save. 4. Click Apply to set your changes without closing the ArcGIS Administrator or OK to apply
changes and close the ArcGIS Administrator.
Once running ArcMap you should see the RSOBIA toolbar.
Please Note: File names and Directory names should NOT include spaces. Use the underscore
character as a substitute if required.
2. Derivatives
The functions offered by the derivatives menu are essentially standard grid manipulation techniques
but brought together for ease of use, and in some cases modified to work more successfully with
partial coverage maps such as multibeam bathymetry. Input files must be single layered datafiles
(e.g. tif, img, jpg) with a projected coordinate system (e.g. UTM, Mercator, National Grid) preferably
in metres.
There are 7 derivative functions offered:
i) Slope: Calculates the maximum slope (in any direction) in degrees. Values are real
numbers between 0.0 and 90.0 but a value of ‐1.0 is used for areas of no data. Input is a
single layer file – not a geodatabase. Output is a single layer file and its default filename
is the input basename plus “Slope”. Format output is .img. This function differs from a
shaded relief which is a slope derivative from a particular direction. Slope maps are
occasionally used for pseudo‐3D display – using the greyscale slope map with the high
slope as black, and placed under a colour bathymetry map with partial transparency.
ii) Terrain Ruggedness (sometimes referred to as Rugosity): Calculates the variation in
bathymetry datasets within a neighbourhood. This technique combines the variability of
slope and aspect in an area. It is taken from the “Benthic Terrain Modeller” developed
by Shaun Wallbridge (Wright et al. 2012). It requires 2 parameters – a neighbourhood
size (in pixels) for which 5 is suggested and a workspace directory where temporary files
can be made and removed.
Output values are usually between 0.0 (meaning smooth) and 0.6 (meaning rough). .
Input is a single layer file – not a geodatabase. Output is a single layer file and its default
filename is the input basename plus “Rugged”. Format output is .img.
iii) Northness: This is the calculation of the aspect of the slope. Aspect is often calculated is
terms of the compass direction 0‐360 degrees. For terrain calculations the zero and 360
degree boundary can create issues and so the Northness is calculated being the cosine
of the aspect. Values are from 1.0 (fully north facing) to ‐1 (south facing). Output is a
single layer file and its default filename is the input basename plus “Cos”. Format output
is .img.
iv) Eastness: This is the complement to Northness being the sine of the Aspect. Values are
from 1.0 (fully east facing) to ‐1 (west facing). Output is a single layer file and its default
filename is the input basename plus “Sin”. Format output is .img.
v) Curvature: Calculates the curvature in the direction of maximum slope of a bathymetry
dataset. It is taken from the spatial analyst toolbox. This is useful for highlighting crests
and depressions. Values often are between 30.0 (convex crest) and ‐30.0 (concave
depressions).
vi) GLCM: This calculates Grey Level Co‐ocurrence Matrices for an image and can return
values for Contrast, Dissimilarity, Homogeneity, Energy, Correlation or ASM (Angular
Second Momentun) – see Chapter 9 for more information
vii) Polygon GLCM: Instead of calculating GLCMs for a whole image mean values of GLCMs
can be calculated from imagery within individual polygons. Only GLCM values that are
calculated from entirely within the polygon are used. This removes polygon edge
effects.
3. Layering
The layering function is a preparation step for segmentation. This function can combine many single
layered files as required and create a multi‐layered raster image. The output filename is the first
input file basename plus “Layered”. Format output is .img. Layer order is not important but all
layers must have the same projection and datum. Files can be added by the drop‐down arrow or
explicitly by the browse directory function. The tool also requires a workspace directory where
temporary files can be made and removed. Different coverages are accepted though not
recommended as the segmentation process will find areas of no data and classify them as significant
classes
Viewing of the output of the layering process can be difficult as each layer may have differing ranges
and statistics (e.g. Terrain Ruggedness). In addition there may be more than 3 layers in the Layered
output but the display only allows 3 layers in a RGB composite display. Computationally this is not
an issue for segmentation.
Do note the order of the layers added as this may be required to understand the segmentation
output. Once segmentation has been done each polygon can be attributed will the layer statistics of
mean and standard deviation of each layer for each polygon.
4. Segmentation
Segmentation is a method to aggregate pixels together to create a thematic map. The segmentation
process is a licensed tool taking a multi‐layered image and creates a set of polygons defined by the
statistics associated with the layered image. Clusters of the imagery pixels are created in n‐
dimensional space and created into classes. Aggregation into geographic regions (polygons) is done
according to a minimum polygon size rule, and clustering rules. Input is a single multi‐layered file –
not a geodatabase. Output is a single polygon vector shapefile and its default filename is the same
as the input basename but with a different filetype. Format output is .shp (plus its associated
companion files).
There are 4 parameters required:
i. Number of Clusters: This is the most important parameter and depends on the complexity
of the data. Estimates of the number of clusters can be done by the user judging the
number of classes that can be seen manually in the imagery, or the number of classes that
are hoped to be seen in the imagery or simply a guess. Often a high number of clusters will
be reduced when calculations are done finding less classes than expected due to small (and
possibly insignificant) cluster sizes. Default value is 30.
ii. Minimum Object Size: This is the minimum size of any output polygon in terms of pixels.
Again this is a very important parameter and depends of the level of aggregation required.
Knowledge of the pixel resolution is key. For more detailed interpretation polygons lower
values can be used, whereas higher values provide more regional interpretation. Default
value is 2000 pixels (approximately equivalent to a circle of 25 pixels radius).
iii. Layer Weights: During the standard segmentation process each layer is given equal
weighting regardless of the differing units used on each layer. Generally the minimum and
maximum of each layer are found and data scaled to a common standard. The user can
provide their own layer weights if, for example, one layer is deemed to provide more
important or better imagery. A second example might be if two layers are inextricably
correlated that to give equal weighting would give undue prominence to one data source.
Default is 1,1,1 (i.e. equal weighting). Examples of other weighting might be 1,1,2 or 1,1,3,1.
If layers weights are omitted (e.g. more than 3 layers) the system will assume a value of 1
unless defined explicitly. Layer weights must have integer values between 1 and 32. At least
one layer should have a weighting factor of 1.
iv. Temporary Workspace: A directory where temporary files can be made and removed.
Default is the directory of the Input file. All temporary files should be deleted automatically
on completion of the segmentation process. Should segmentation fail these files will remain
and should be deleted manually.
The segmentation process uses a technique of k‐means clustering and uses the iterative removal of
outliers (Shepherd et al., 2014). This technique is incorporated in a large software library RSGISLib
(Bunting et al., 2014). Currently the library is defined to be in the directory C:/RSGIS and is accessed
directly by the RSOBIA toolbar to the directory name.
The resulting shapefile of polygons may take a minute or two to create, the time depending on the
data complexity, filesize, and number of clusters. Each polygon will have attributes of:
(1) ID Consecutive number of polygon (useful for identification)
(2) AREA Size of polygon (in units of the original imagery – possibly square metres)
(3) MEAN Average of classes of all pixels in polygon (useful for finding outliers)
(4) STD Standard deviation of classes of all pixels in polygon (low values show good
cluster correspondence)
(5) SUM Sum of all classes of all pixels I polygon
(6) MAJORITY Most common class of all pixels in polygon (this is the main class for
interpretation. If the class distribution is skewed, this could give a false class).
When displaying the data the default symbology is a single symbol feature. This should be changed
to Categories of Unique values and where the Value Field is set to MAJORITY. Add all the values to
the categories and use a distinct colour palette of your choice.
Example:
Layered Imagery (4 layers, 1,2,3 in RGB) Segmented map (10 classes)
The choice of number of clusters is often difficult. To this end a optimisation process is available
using a modified Calinski‐Harabasz calculation (Calinski and Harabasz, 1974). If a value of 0 is entered
for the number of clusters, the software will attempt to evaluate the optimal number of classes.
The Calinski‐Harabasz criterion value is then maximised. It is a ratio of the overall between‐cluster
variance and the internal‐cluster variance. Well defined clusters have a large between‐cluster
variance and a small within‐cluster variance. The larger the ratio, the better the data partition. The
method calculates a series of cluster values and attempt to find a maximum value. Changing the
minimum object size will also affect the ratio and so will require recalculation.
If the segmentation results are not pleasing to the eye or seem to omit features, set the parameters
differently and try again. The system will not allow overwriting of output files and thus the user will
have to edit output filenames too.
0
0.5
1
1.5
2
2.5
3
3.5
0 5 10 15 20 25
Calinski‐Harabasz Ratio
Number of Clusters
5. Adding of Attributes
Following segmentation, the attributes for each polygon only relate to the polygon shape and class.
It is often required to view and use the values of initial raster layers. These can be aggregated for
each polygon as an attribute value of the mean and standard deviation of the pixel values within the
polygon for each layer.
Inputs required are the original multi‐layered raster imagery file and the segmented polygon
shapefile and a directory where temporary files can be made and removed. Default is the directory
of the Input file. Output is a shapefile with a default filename made from the input basename plus
“Attrib”. Format output is .shp. This process can be a bit slower than segmentation and is the reason
why it is not included in the segmentation process (especially if segmentation is trialled several
times).
The attribute table will have several extra columns with labels of Layer1, Layer2 etc. It is here where
it is important to know the layer order that was used in the layering process, so that understanding
of the meaning of the values.
6. Adding of Groundtruth Samples
The attributes for each polygon can be extended if groundtruth point data is available. This is a very
simple join of two datasets and effectively adds the attributes of a groundtruth data point to the
relevant polygon. In this way the samples may be utilised to characterise the class type. Some
polygons may not have groundtruth samples and will therefore be left blank. Hopefully enough of
the polygons will have groundtruth points to inform the class descriptions.
7. Multibeam Echosounder (MBES) Wizard
A specific wizard is available for multibeam echosounder bathymetry and backscatter imagery. It is
designed to carry out a series of operations that are all available in the RSOBIA toolbar. The
advantage of this is an easier and quicker method for the novice user and does not clutter up disk
space with intermediate files such as derivatives, a layered file, or without attributes. The wizard
tool has been designed to have as few input parameters are possible:
(1) Input Bathymetry grid (Single layer format .tif or .img)
(2) Input Backscatter grid (Single layer format .tif or .img)
(3) Number of Clusters – (see section 4 for details – default is 20 clusters)
(4) Minimum Object size – (see section 4 for details – default is 10000 pixels)
(5) Output Segment Polygon file (format .shp)
The wizard is programmed to work at any pixel resolution and will produce results at the resolution
of the largest pixel of the two input files. The units of both input files are not important as the
imagery will be scaled to get best differentiation of features. Geographic projection of the two
datafiles must be identical. The filesizes of the input files are not restricted but successful processing
will depend on the size of the computer’s memory. Initial trials are suggested at the 5‐10 million
pixels filesize, to test the results against expectations.
Processing in the wizard is as follows:
1) Calculation of slope from the bathymetry data
2) Calculation of Terrain roughness from the bathymetry data (assumes a neighbouthood area of 5
pixels)
3) Layering of the slope data, roughness data and backscatter data
4) Segmentation of the layered data using a layer weighting of (1,1,2) i.e. giving the backscatter
data the same weighting as the combined two datasets of slope and roughness (because both
are derivatives of the bathymetry), which would otherwise give the bathymetric data undue
prominence.
5) Attributes of the slope (layer 1), roughness (layer 2) and backscatter (layer 3) are added to the
segment polygons.
As with the other tools the wizard does create several intermediate files and this it places in the
same directory as the bathymetry data. All the files have “tmp” in their names and are deleted on
successful completion of the process.
8. Classification
A manual classification tool is available for labelling polygons with a class name (e.g. Sandy Mud). In
the Data pulldown select the shape file you wish to add classification interpretation. This will be the
segmented polygon shapefile.
Next either choose one of the pre‐defined classification classes or type in your own class name.
This is now ready for “painting”. Use the paintbrush icon to draw a square (Click and Drag) on the
map and each polygon selected by the square will be attributed the classification name (e.g. Sandy
Mud). The attribute will be given to the appropriate polygon in an attribute called “Class”. The paint
brush can be used as many times as required.
If a new class is required, type the new name and continue painting. The previous class name is
retained and can be used when required.
9. GLCMs (Grey Level Co-occurrence Matrices)
Texture measurement such as GLCMs (Haralick et al., 1973) are very useful for image analysis. They
are a statistical calculation designed to “look” at imagery in a similar way that the human eye can
discern differences in pictures. For example a speckly texture will have large differences between
high and low points, whereas a smooth texture will have only small differences between high and
low points. The distance between points (in pixel space) must also be considered, as the texture also
depends on the level of amalgamation (scale) that is being used.
GLCMs are calculated using the pixel values and a kernel window over which the variable is
calculated. This is because GLCMs are second order texture calculations and consider pixel
neighbour relationships. It is therefore required to define the offset between pixels and a window
to measure the texture over. The combination of pixels is defined in a matrix for the defined
window and then normalised giving the probability of occurrence.
There are3 main independent groups of measures of texture using GLCMs:
i) Contrast ‐ The Contrast group measures weighted related to distance between pixels.
Three values are available: Contrast, Dissimilarity and Homogeneity
ii) Orderliness or regularity – The group measures how orderliness or regularity of the
image pixels spatial arrangement. Two values are available: ASM and Energy
iii) Statistical – This group measures statistics derived from the GLC matrix. One value is
available – Correlation.
Contrast – weighting is measured exponentially with distance. A value of zero would be an entirely
uniform image.
Dissimilarity – weighting is measured linearly with distance
Homogeneity (sometimes known as Inverse Difference Moment) and weighs values by the inverse of
the contrast weights
ASM (Angular Second Moment) uses a weighting of itself rather than a distance. Maximum value of
1 is when all pixels in the window are identical.
Energy is a measure of uniformity or order of an image. It is the square root of ASM.
Correlation measures the linear dependency of pixel values on neighbouring pixels. Zero value
means uncorrelated or value 1 is perfectly correlated.
10. Troubleshooting
The toolbar has been tested on several platforms but issues can still arise. The following are
solutions for a variety of error messages found by users:
1) Make sure the workspace area has been cleared of previous temporary intermediate files
(usually have “tmp” in the name)
2) Spatial Analyst Extension not licensed – Click “Customise” and then “Extensions…” and turn
Spatial Analyst off and on.
3) Check re‐installation guide (see section 1) if a newer version is installed.
4) Filename not found – Remove spaces in directory names and filenames
5) When combining files make sure they have the same geographic projection and datum. The files
may look the same projection in the display window but may have been transformed “on‐the‐
fly”.
6) Bad allocation – This usually means you have run out of memory ‐ try smaller files.
11. References
Bunting, P.; Clewley, D.; Lucas, R.M.; Gillingham, S. The Remote Sensing and GIS Software Library (RSGISLib). Comput. Geosci. 2014, 62, 216–226.
Calinski, T., and J. Harabasz. "A dendrite method for cluster analysis." Communications in Statistics.
Vol. 3, No. 1, 1974, pp. 1–27.
Haralick, R.M., K. Shanmugam and I. Dinstein. Textural Features for Image Classification. IEEE Transactions on Systems, Man and Cybernetics. 1973 SMC vol. 3, no. 6, pp.610‐620.
Shepherd, J.D.; Bunting, P.; Dymond, J.R., Operational large‐scale segmentation of imagery based on iterative elimination. J. Appl. Remote Sens. 2014, in press.
Wright, D.J., Pendleton, M., Boulware, J., Walbridge, S., Gerlt, B., Eslinger, D., Sampson, D., and
Huntley, E. 2012. ArcGIS Benthic Terrain Modeler (BTM), v. 3.0, Environmental Systems Research
Institute, NOAA Coastal Services Center, Massachusetts Office of Coastal Zone Management.
Available online at http://esriurl.com/5754.
Recommended