Está en la página 1de 71

Chip Manager &

Chip Toolkit Reference

Version 8.2

PCI Geomatics
50 West Wilmot Street, Richmond Hill, Ontario, Canada, L4B 1M5
Phone: (905) 764-0614
www.pcigeomatics.com
Fax: (905) 764-9604
November 16, 2001

Geomatica, EASI/PACE, ImageWorks, GCPWorks,


GeoGateway, PCI OrthoEngine, PCI Author, PCI Modeler,
GeoAnalyst, AGROMA, RADARSOFT, ACE, and FLY!
are registered trademarks of PCI Geomatics.
Other brands and product names are
trademarks of their respective owners.

The information in this document is subject to change without notice and should
not be construed as a commitment by PCI Geomatics. PCI Geomatics assumes no
responsibility for any errors that may appear in this document.
The software described in this document is furnished under a license and may only
be used or copied in accordance with the terms of such license. No responsibility
is assumed for the use or reliability of the information that is derived through the
use of PCI Geomatics software.
c by PCI Geomatics. All rights reserved worldwide. This publication
Copyright
is protected by Copyright law. Purchasers of PCI Geomatics licenses are given
limited permission to reproduce this manual provided such copies are for their use
with licensed PCI Geomatics software only, and are not sold or distributed to
third parties. All such copies must contain the title page and this notice page in
their entirety.

Printed in Canada
November 16, 2001
This document was produced using LATEX.

Contents

Preface

1 Chip Graphical Manager

1.1

ChipManager Chip Library Manager . . . . . . . . . . . . . . . .

2 Chip Functions
2.1

2
11

CDBByteChanIO Image Transfer From Image Chip Using Byte


Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12

2.2

CDBChanType Check Channel Type in an Image Chip . . . . . .

14

2.3

CDBCheckWin Check Image Chip Window Value(s) . . . . . . .

15

2.4

CDBCheckChan Check Image Chip Channel Values . . . . . . . .

16

2.5

CDBClose Close Image Chip Database File . . . . . . . . . . . . .

17

2.6

CDBCreate Create Image Chip Database File . . . . . . . . . . .

18

2.7

CDBDeleteChip Delete Image Chip . . . . . . . . . . . . . . . . .

19

2.8

CDBFileHeaderIO Read/Write Image Chip Database File Header

20

2.9

CDBChipHeaderIO Read/Write Image Chip Headers . . . . . . .

21

2.10 CDBChipPointerIO Read/Write on Image Chip Pointers . . . . .

22

2.11 CDBInsertChip Insert Image Chip into Image Chip Database File

23

2.12 CDBIntChanIO Image Transfer From Image Chip Using Buffer .

24

2.13 CDBMerge Merge Image Chip Databases . . . . . . . . . . . . . .

26

2.14 CDBSavingAfterPack Disk Space Savings Report . . . . . . . . .

27

iii

2.15 CDBOpen Open Image Chip Database File . . . . . . . . . . . . .

28

2.16 CDBPixelSize Read/Write Pixel Size in Image Chip . . . . . . . .

29

2.17 CDBRealChanIO Image Transfer From Image Chip Using Real


Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

2.18 CDBSearch Search Image Chips . . . . . . . . . . . . . . . . . . .

32

2.19 CDBUpdateChip Update Image Chip . . . . . . . . . . . . . . . .

34

2.20 CDBUpdateChipInfo Update Image Chip Header . . . . . . . . .

35

3 Chip Matching

37

3.1

AUTOGEO AUTOMATIC GEOCODING . . . . . . . . . . . . .

38

3.2

CHIPEXT Chip Extract . . . . . . . . . . . . . . . . . . . . . . .

42

3.3

CHIPMAT Image Chip Match for GCPs . . . . . . . . . . . . . .

47

3.4

GCPREFN GCP Refinement . . . . . . . . . . . . . . . . . . . . .

51

4 Image Chip Database Layout

57

4.1

File Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

57

4.2

Image Chip Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . .

58

4.3

Image Chip Header . . . . . . . . . . . . . . . . . . . . . . . . . . .

61

4.4

Image Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

63

iv

Preface

Intended Audience
The Chip Manager & Chip Toolkit Reference is intended for users who wish to
manage their chip databases using the functions provided in the Chip package.

Conventions Used In This Manual


For each function, the name is given, followed by a short description of the purpose
of the function. The calling sequence is given, followed by a detailed description of
the meaning of each passed argument.

Release Notes
This manual has been updated for version 8.2.

Introduction
The Chip Manager & Chip Toolkit manual is intended for programmers who wish to
manage their chip databases, using chip functions provided with the PCI software.

vi

Chapter 1

Chip Graphical Manager

A GUI application for managing Image Chip Libraries.

1.0.1

Copyright
A GUI application for managing Image Chip Libraries.
ChipManager, Version 8.2, Release date: October, 2001
COPYRIGHT
Software copyrighted (c) by PCI Geomatics, 50 West Wilmot St., Richmond Hill,
Ontario, CANADA, L4B 1M5. Tel: (905) 764-0614
RESTRICTED RIGHTS
CANADIAN GOVERNMENT
Use, duplication, or disclosure is subject to restrictions as set forth in DSS 9400-18
General Conditions - Short Form - Licensed Software.
U.S. GOVERNMENT
Use, duplication, or disclosure is subject to restrictions as set forth in FAR clause
52.227-19 Commercial Computer Software - Restricted Rights and in subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer Software Clause at
DFARS 52.227-7013.

CHAPTER 1. CHIP GRAPHICAL MANAGER

1.1

ChipManager Chip Library Manager


1.1.1

Main Panel
The main panel allows you to insert, search/view, update, and delete image chips
in an image chip database. It also allows you to merge two imagery chip database
files.
Three command line options are available:
chip <chip database name> for opening a chip database.
image <new chip image source> for loading an imagery database to extract
new chips.
dem <new chip dem source> for loading a DEM database to extract new
chips.
Open/Close an Image Chip Database
To create an image chip database, select the New.. option from the File menu
bar and enter the database name in the text field of the pop up panel. If the
database already exists, you are given the option of either deleting the existing
database and proceeding with the file creation, or aborting the process.
To open an image chip database, select the Open... option from the File menu
bar and enter the database name in the file selector panel. You must close any open
image chip databases before another image chip database can be opened.
After a database is opened, the Image Chips Manager will show the first available
chip in the database.
To close an image chip database file, select the Close option from the File menu
bar.
See Also: Image Chip Viewing, Image Chip Manager States
Changing GCP location in chips
The Ground Control Point (GCP) location in an image chip can be changed by:
moving the cursor in main panel. After the cursor has been moved to the
desired location of the GCP, click Use cursor location as GCP to use the
cursor location (georeferenced position of cursor) as the GCP location of the
chip.
entering values directly into the textfields of the main panel.
The supported georeferencing units for chips are Lat/Long and UTM with a zone
number. The supported elevation units are Metres and Feet. The units can be
toggled back and forth using the corresponding option menus in the main panel.

PCI Geomatics

1.1. CHIPMANAGER CHIP LIBRARY MANAGER

Changes made to the current chip are not saved to the database until you click the
Save chip button in the main panel. Changes made to the current chip can be
undone (in the context that changes havent been committed to the database using
the Save chip button) by clicking on the Cancel button in the main panel.
See Also: Image Chip Manager States
Image Chip Insertion
An image chip can be extracted in one of two ways:
Cutting it from an imagery database file by loading the imagery using the
Image... option from the File menu. After the chip is cut, import the
chip into main panel by clicking on the New chip button.
Importing the chip from existing GCPs stored in the file, using the Use GCP
segment option from the Utilities menu.
You must fill key chip fields before the chip can be inserted into the database:
Chip ID
Sensor Type
Viewing Angle (degrees)
Acquisition Date of Imagery (dd-mmm-yyyy)
Ground Control Point Location information: (x, y) georeferenced location in
Lat/Long or UTM with a zone number, and GCP elevation in metres/feet.
You can default values for some of the fields, such as Sensor, Viewing Angle,
Acquisition Date, General ID, Scene ID; the values are copied from the corresponding fields in the default setting panel.
An extracted image chip can be inserted into an image chip database file by clicking
the Save chip button in the main panel. On successful saving of an image chip,
the message New chip accepted will appear on the status bar at the top of the
main panel, and the state will change to View.
See Also: Open/Close an Image Chip Database, Image Chip Manager States, Image Chip Cutting, Undo of changes made, Importing Chip From GCP,
Default Values Setting
Image Chip Searching
The following list contains search criteria for finding image chips from an image
chip database:
Chip ID: Identifier for the chip.

Version 8.2 / November 16, 2001

CHAPTER 1. CHIP GRAPHICAL MANAGER

Sensor Type: Type of satellite which provided the imagery from which the
chip is extracted.
Viewing Angle (degrees): The viewing angle of the satellite which provided
the imagery from which the chip is extracted. You can specify a range of
viewing angles.
Resolution: Pixel/Line resolution of the chip.
Acquisition Date (dd-mmm-yyyy): The date at which the chip is extracted
or the date at which the imagery is taken. You can specify a range of dates
for searching purposes.
Region of Interest (Lat/Long or UTM with a zone number): The upper left
hand corner and lower right hand corner delimit the region from which the
chips are to be found.
Elevation of chips at GCP (Metres or Feet): An elevation interval can be
specified.
Once the search criteria are entered, click the Do Search button. If no search
criteria is entered, all chips in the image chip database are returned as found.
Clicking the Restore Defaults button will cancel the previous search criteria and
return all chips in the database as found.
The chips found in the search are displayed in a list under the List of Chips
matching Search Condition title bar in the following form:
Chip <number>: <Chip id> <Sensor Date> <Time/Date of imagery acquisition>
Clicking on one of the chips in this list will load the chip into the main panel.
Clicking on the Default ROI to Image button will use the orbital data from an
uncorrected image database(if it exists) to estimate the Region of Interest part of
the search criteria with a 50% margin of error.
If 3 or more GCPs have been collected, they are used to generate an affine model
for the uncorrected image which is then used to estimate the Region of Interest part
of the search criteria with a 25% margin of error.
See Also: Saving search results
Saving search results
Chips found in a search can be saved into a new database by using the Create New
Database panel. This panel is popped up by clicking on the New from search list...
option from the Utilities file menu in the main panel.
You can enter the new database name directly in text field provided or you can select
the database name through a file selector by clicking on the Select... button.
Click on the Create Database... button. If there is already an image chip database
with the same name, creation will not proceed. You must either select another
database name, or delete the existing database; the delete utility can be popped
up by clicking on the Delete... option from the Utilities file menu in the main
panel.

PCI Geomatics

1.1. CHIPMANAGER CHIP LIBRARY MANAGER

Image Chip Viewing


There are two ways to select which chip to view. You can use directional buttons
(analogous to video cassette recorder buttons):
|< : Gives the first chip found in the previous search made.
< : Gives the chip before the current chip viewed.
> : Gives the chip after the current chip viewed.
>| : Gives the last chip found in the previous search made.
You can also click on one of the chips found in the list of Chips Matching Search
Conditions in the Search panel. The Search panel can be popped up by selecting
the Search Image chips... option from the Utilities menu bar.
If the database is in a modified state and you attempt to view another chip, a modal
dialog is popped up with three options:
Save it Now: Save the modified chip before loading the requested chip.
Continue: Proceed directly with the loading of the requested chip. Changes
made in the modified chip is lost.
Cancel: Cancel the request to view another chip.
See Also: Image Chip Searching
Image Chip Update
Information about the currently viewed chip can be modified. Once a change is
made to one of the fields, the state of the database is changed to Modified. The
changes to the chip can be saved permanently by clicking the Save chip button.
On successful update of a chip, the message Chip modified appears on the status
bar at the top of the main panel and the state of the database changes to View.
See Also: Image Chip Viewing, Image Chip Manager States, Undo of changes
made
Undo of changes made
The changes made to an existing image chip or to a newly loaded chip (when the
database is in a modified state) can be undone by clicking on Cancel. The Image
Chip Manager will load the previously loaded chip (if any).
Image Chip Delete
The image chip can be deleted by clicking the Delete chip button in the main
panel. A confirmation dialog is popped up to make sure that you really want to
delete the chip.

Version 8.2 / November 16, 2001

CHAPTER 1. CHIP GRAPHICAL MANAGER

Upon successful deletion of the chip, the message Chip deleted will appear on the
status bar at the top of main panel. If the database is nonempty after deletion, the
Image Chip Manager will load the next chip found in the search list; the state of the
database becomes View. Otherwise, the state of the database becomes empty.
See Also: Image Chip Viewing, Image Chip Searching, Image Chip Manager States
Image Chip Manager States
There are three possible states for an image chip database.
Empty: no chips are loaded in the opened database.
View: the viewed chip is unchanged from its copy in the database.
Modified: the viewed chip has been modified from its copy in the database;
either the chip is a new chip or some fields of an existing chip have been
modified.
The current state is shown at the top of the title bar labelled Current Chip Info.
Utilities in main panel
The Imagery option menu allows an image chip to be viewed in one of the following
modes:
RGB Red gun assigned to chip channel 1, Green gun assigned to chip channel
2, Blue gun assigned to chip channel 3.
B&W1 View chip channel 1 in black and white.
B&W2 View chip channel 2 in black and white.
B&W3 View chip channel 3 in black and white.
The Enhance option menu allows you to apply different enhancements to the
viewed image chip.
The Zoom option menu allows you to view the chip at different zoom levels.
The Full Res. chip... option will clone the viewed image chip at full resolution,
in a separate window.
The Accept GCP from cursor option will use the cursor location as the GCP of
the viewed chip.
The Cancel button will revert the information about a chip to the previously
saved value.
See Also: Image Chip Searching, Saving search results, Chip reports, Image
Chip Databases Merging, Image Chip Database Deletion, Image Chip
Database Packing, Importing Chip From GCP, Default Values Setting

PCI Geomatics

1.1. CHIPMANAGER CHIP LIBRARY MANAGER

Image Chip Database Deletion


This utility allows you to specify a whole database for deletion. Only a non-opened
image chip database can be deleted.
Colour Selection
The Chip Cursor Colour option menu allows you to change the colour of the
cursor.
The Chip GCP Colour option menu allows you to change the colour of GCP
cursor.

1.1.2

Image Chip Cutting


You can manually cut a chip from an image/dem database file:
Load the image from which the image chips are to be extracted.
Pop up the chip sizing panel by clicking on the Chip Size.. button.
The image chip outline can be set in one of three ways:
Direct entry of pixels and lines. The default chip size is 256x256 pixels; the
maximum chip size is 512x512.
Dragging out a square image chip by clicking on the Drag out square on
image button.
Dragging out a rectangular image chip by clicking on the Drag out rectangle
on image button.
The cursor is at the centre of the outlined chip and is used as the Ground
Control Point of the extracted image chip.
You can automatically cut a chip from a GCP segment in a PCIDSK database file
using the import utility; the import utility pops up when you select the Use GCP
segment option from the Utilities file menu in the main panel.
The Enhance option allows you to view the imagery with different enhancements.
The Zoom level option allows you to view the imagery at different zoom levels.
The cut image chip is loaded into the main panel by clicking the New chip button
in the main panel.
See Also: Elevation channel setting, Importing Chip from GCP

1.1.3

Elevation channel setting


The elevation channel can be entered directly into the text box provided or selected
from the list of available channels from the image database.

Version 8.2 / November 16, 2001

CHAPTER 1. CHIP GRAPHICAL MANAGER

The value of the channel at the cursor location is used as the elevation value at the
ground control point.

1.1.4

Chip Reports
Two kinds of report can be generated: Header and Selected Chip.
The Header report provides useful information about the whole image chip database
(for example, creation and last update date and time, database name, and the
number of chips of each type of sensor in the database).
The Selected Chip report provides information about the currently viewed chip:
Chip ID, Sensor type, View Angle, Acquisition Date, Scene ID, General ID, GCP
location and elevation, Chip Size, Resolution, Number of image channels, data type
of image channels, source file from which the chip is extracted, etc. If the chip has
not been saved since the last update, the Image Chip Manager will not generate
the report.
The report can be saved to a file by clicking on the Save to File... button. The
name of report can be entered in the file selector panel. If the specified report
file already exists, you are given the option of overwriting the existing report file,
appending the report to the end of the report file, or aborting the save operation.

1.1.5

Image Chip Databases Merging


The 1st chip database and 2nd chip database fields should contain the names
of the image chip databases to be merged. The Merged chip database field should
contain the name of the resulting merged database.
These names can either be entered directly or selected via the file selector panel,
which is popped up by clicking the Select ... button to the left of these fields.
Click on the Perform Merge button.
The merge utility can also be used to compact an image chip database by entering
its name in 1st chip database and the desired name of the compacted database
in Merged chip database.

1.1.6

Default Values Setting


Sensor Type, Viewing Angle, Acquisition Date of Imagery, Scene ID, and General
ID can have default values assigned to them. These values are set automatically if
the chip source database is a PCIDSK database and has an ORBIT segment in it.
Also, you could key in these values manually in this panel. Setting of default values
speeds up the image chip creation/insertion process since chips extracted from the
same source database will have the same values for these fields in most cases.

PCI Geomatics

1.1. CHIPMANAGER CHIP LIBRARY MANAGER

1.1.7

Image Chip Database Packing


This utility allows you to pack an existing image chip database. Deletion of image
chips from an image chip database will leave holes in the database. Packing of an
image chip database will reduce the amount of disk space occupied by it, especially
if the database has undergone many Delete chip operations.

1.1.8

Importing Chip from GCP


This utility is selectable only if an image chip database has been opened and a
PCIDSK image database has been loaded.
If the opened PCIDSK database has more than one GCP segment, a panel is popped
up allowing you to select which GCP segment to use to import the GCP. Clicking
on one of these segments will pop up the GCP selection panel. Only those GCP
segments that contain a pair of UTM coordinates and Pixel/Line coordinates can
be used in this import panel.
The GCPs in the selected segment are shown under the GCP List title bar
in the following format: <GCP Id> <Geocoded X coordinate> <Geocoded Y
coordinate> <Elevation at GCP in metre> <Pixel coordinate> <Line coordinate>
The chip is imported using the selected GCP by clicking on the Use Selected GCP
as chip button. The GCP Id becomes the Chip Id of the imported chip. Geocoded
coordinates and elevation of the imported GCP are copied over and an image chip
of the size set in Chip Sizing panel is loaded into the main panel.
If the database is in a modified state and you attempt to import another chip using
GCP, a modal dialog is popped up with three options:
Save it Now: Save the modified chip before importing the requested chip.
Continue: Proceed directly with the importing of the requested chip. Changes
made in the modified chip are lost.
Cancel: Cancel the request to import the GCP chip, and pop down the GCP
selection panel.
The GCP selection panel is associated with a PCIDSK image database. Closing of
the loaded imagery database by loading another image will cause any popped up
GCP selection panel to pop down.

Version 8.2 / November 16, 2001

CHAPTER 1. CHIP GRAPHICAL MANAGER

10

PCI Geomatics

Chapter 2

Chip Functions

This chapter contains an alphabetical listing of general purpose chip functions.


These functions are all resident in the object library pcilib.

11

CHAPTER 2. CHIP FUNCTIONS

2.1

CDBByteChanIO Image Transfer From Image Chip


Using Byte Buffer
CDBByteChanIO() allows access to the imagery data for a particular chip (or its
overview chip) of the image chip database file.

2.1.1

CALL SEQUENCE
void

12

CDBByteChanIO( FILE, *fpCDB, int, nFunc, int, nChip no,


TBool, bIsOverview, int, nXOff, int, nYOff,
int, nXSz, int, nYSz, uchar, achImgBuf[ ],
int, nBufXSz, int, nBufYSz, int, nChn, int,
anChnMap[ ] );

FILE

*fpCDB;
File pointer to chip database.

int

nFunc;
Function to perform, CDB READ to read the database into
achImgBuf[ ], or CDB WRITE to write to the database from
achImgBuf[ ].

int

nChip no;
Chip number to perform IO.

TBool

bIsOverview;
Flag to indicate if the image is overview chip image.

int

nXOff;
X (pixel) offset to imagery window in file.

int

nYOff;
Y (line) offset to imagery window in file.

int

nXSz;
X (pixel) size of imagery window in file.

int

nYSz;
Y (line) size of imagery window in file.

uchar

achImgBuf[ ];
Buffer of byte to image data to read/write. On a read, this buffer
receives the imagery data read from the file. On a write, this
buffer contains the imagery data to write into the file. The image
held in achImgBuf[ ] has dimensions nBufYSz lines, each line is
made up of nBufXSz pixels, each pixel having nChn channels.

int

nBufXSz;
X (pixel) size of imagery window in buffer.

int

nBufYSz;
Y (line) size of imagery window in buffer.

PCI Geomatics

2.1. CDBBYTECHANIO IMAGE TRANSFER FROM IMAGE CHIP USING BYTE BUFFER

2.1.2

int

nChn;
Number of channel values in pnChnMap[ ].

int

anChnMap[ ];
Channel mapping buffer.

EXAMPLE
Reading the first 3 channels of image chip 1.
...
FILE *fpCDB;
unsigned char imagry[240000];
int anChnMap[3];
...
fpCDB = CDBOpen("testimagechip", "r");
...
anChnMap[0] = 1;
anChnMap[1] = 2;
anChnMap[2] = 3;
CDBByteChanIO(fpCDB, CDB_READ, 1, FALSE, 0, 0, 100, 100, imagry,
100, 100, 3, anChnMap);

Version 8.2 / November 16, 2001

13

CHAPTER 2. CHIP FUNCTIONS

2.2

CDBChanType Check Channel Type in an Image Chip


CDBChanType() returns the type of channels held in a particular chip of a CHIPDB
file.

2.2.1

CALL SEQUENCE
CDBChanType( FILE, *fpCDB, int, nChip no );

int
FILE

*fpCDB;
fpCDB file pointer to perform IO.

int

nChip no;
Chip number within the chip database.

CDBChanType() returns an integer type indicator. Possible values are:


CHN_UNKNOWN
CHN_8U
CHN_16S
CHN_16U
CHN_32R

2.2.2

(0):
(1) :
(2) :
(3) :
(4) :

Unknown channel
8 bit unsigned integer
16 bit
signed integer
16 bit unsigned integer
32 bit real

EXAMPLE
Reading channel type in image chip #3
FILE *fpCDB;
int nChanType;
...
fpCDB = CDBOpen("imagechiptest", "r+");
...
nChanType = CDBChanType(fpCDB, 3);

14

PCI Geomatics

2.3. CDBCHECKWIN CHECK IMAGE CHIP WINDOW VALUE(S)

2.3

CDBCheckWin Check Image Chip Window Value(s)


CDBCheckWin() checks whether a user requested selection of window is within
bounds of a particular chip of the image chip database file. CDBCheckWin() routine
will also default a window specification to be the entire image chip if X Size and/or
Y size are zero.

2.3.1

CALL SEQUENCE
void

2.3.2

CDBCheckWin( FILE, *fpCDB, int, nChip no, char, *aszListName, int, *aszWindow );

FILE

*fpCDB;
File pointer to chip database.

int

nChip no;
Chip number to do checking.

char

*aszListName;
Literal name of array holding window. Used in error messages.

int

*aszWindow;
Array holding window specification.
If window[2] == 0,
window[2] will be set to database/display X size - window[0] if
window[3] == 0, window[3] will be set to database/display Y size
- window[1]

EXAMPLE
FILE *fpCDB;
int anArray[4];
fpCDB = CDBOpen("testchips.cdb", "w");
...
checking window size in chip #6, having X offset eqaul to 30,
Y offset equal to 50, X image size equal to 220, Y image size
equal to 200
anArray[0] = 30;
anArray[1] = 50;
anArray[2] = 220;
anArray[3] = 200;
CDBCheckWin(fpCDB, 6, "DBIW", anArray);

Version 8.2 / November 16, 2001

15

CHAPTER 2. CHIP FUNCTIONS

2.4

CDBCheckChan Check Image Chip Channel Values


CDBCheckChan() also checks for duplicate channel numbers in the list.

2.4.1

CALL SEQUENCE
void

2.4.2

CDBCheckChan( FILE, *fpCBD, int, nChip no, char, *aszListName, int, *pnChnList, in, nCountList
);

FILE

*fpCDB;
File pointer to chip database.

int

nChip no;
chip number to do checking.

char

*aszListName;
Literal name of array holding channel(s). Used in error messages.

int

*pnChnList;
Array containing channel list.

int

nCountList;
Count of channels in pnChnList. if nCountList is negative, duplicate check is done, and the number of channels is taken to be
absolute value of nCountList.

EXAMPLE
FILE
int
char

*fpCDB;
dbic[16];
aszFile[65];

Determine CHIPDB filename (aszFile), user requested channels


(dbic), and the number of requested channels (argcnt[n]).
...
fpCDB = CDBOpen(aszFile, "r+");
CDBCheckChan(fpCDB, "DBIC", dbic, -argcnt[n]);

16

PCI Geomatics

2.5. CDBCLOSE CLOSE IMAGE CHIP DATABASE FILE

2.5

CDBClose Close Image Chip Database File


CDBClose() closes CHIPDB database files which were opened using subroutine
CDBOpen().

2.5.1

CALL SEQUENCE
void CDBClose( FILE, *fpCDB );
FILE

2.5.2

*fpCDB;
File pointer for CHIPDB file to be closed.

EXAMPLE
This example closes an image chip database file:
FILE

*fpCDB;

fpCDB = CDBOpen("testimagechip", "r");


...
operate on the file
...
CDBClose(fpCDB);

Version 8.2 / November 16, 2001

17

CHAPTER 2. CHIP FUNCTIONS

2.6

CDBCreate Create Image Chip Database File


CDBCreate() creates a new image database chip file.

2.6.1

CALL SEQUENCE
FILE

*CDBCreate( char, *pszFileName );

char

2.6.2

*pszFileName;
Name of database file to be created. If there is no extension,
.cdb will be appended.

EXAMPLE
FILE *fpCDB;
fpCDB = CDBCreate("imagechiptest");
...
application code
...
CDBClose(fpCDB);

18

PCI Geomatics

2.7. CDBDELETECHIP DELETE IMAGE CHIP

2.7

CDBDeleteChip Delete Image Chip


CDBDeleteChip() deletes an image chip in the chip database.

2.7.1

CALL SEQUENCE
void

2.7.2

CDBDeleteChip( FILE, *fpCDB, int, nChip no );

FILE

*fpCDB;
FILE pointer to image chip database.

int

nChip no;
Chip number within the database to be deleted.

EXAMPLE
Delete nChip no chip in image chip database.
FILE *fpCDB;
fpCDB = CDBOpen("testimage", "r+");
...
CDBDeleteChip(fpCDB, nChip_no);

Version 8.2 / November 16, 2001

19

CHAPTER 2. CHIP FUNCTIONS

2.8

CDBFileHeaderIO Read/Write Image Chip Database


File Header
CDBFileHeaderIO() performs Read/Write IO on File Header of an Image chip
database.

2.8.1

CALL SEQUENCE
void

CDBFileHeaderIO( FILE, *fpCDB, int, nFunction,


Header t, *psImageHeader );

FILE

*fpCDB;
fpCDB file pointer to perform IO.

int

nFunction;
CDB READ for reading, CDB WRITE for writing.

ICFile-

ICFileHeader t
*psImageHeader;
ICFileHeader t is the record FH in database definition.

2.8.2

EXAMPLE
FILE *fpCDB; ICFileHeader t *psImageHeader;
fpCDB = CDBOpen(imagechiptest, r);
...
CDBFileHeaderIO(fpCDB, CDBRead, psImageHeader);

20

PCI Geomatics

2.9. CDBCHIPHEADERIO READ/WRITE IMAGE CHIP HEADERS

2.9

CDBChipHeaderIO Read/Write Image Chip Headers


CDBChipHeaderIO() performs Read/Write operation on Image Chip Headers of an
image chip database.

2.9.1

CALL SEQUENCE
void

CDBChipHeaderIO( FILE,
*fpCDB,
int, nFunction, int, nChip no, ImageChipHeader t, *, psChanHeader );

FILE

*fpCDB;
fpCDB file pointer to perform IO.

int

nFunction;
CDB READ for reading, CDB WRITE for writing.

int

nChip no;
chip number to perform IO.

ImageChipHeader t
*psChanHeader;
psChanHeader is the record ICi in database definition document.

2.9.2

EXAMPLE
Read image chip header of image chip #1.
FILE *fpCDB;
ImageChipHeader_t sChanHeader;
fpCDB = CDBOpen("testimagechip", "r+");
...
CDBChipHeaderIO(fpCDB, CDB_READ, 1, &sChanHeader);

Version 8.2 / November 16, 2001

21

CHAPTER 2. CHIP FUNCTIONS

2.10

CDBChipPointerIO Read/Write on Image Chip Pointers


CDBChipPointerIO() performs Read/Write operation on Image Chip Pointers of
an image chip database.

2.10.1

CALL SEQUENCE
void

CDBChipPointerIO( FILE, *fpCDB, int, nFunction, ImageChipPointer t, **pasICPointer, ImageChipPointer t, ***ppasICPointerRead );

FILE

*fpCDB;
fpCDB file pointer to perform IO.

int

nFunction;
CDB READ for reading, CDB WRITE for writing.

ImageChipPointer t
**pasICPointer;
Pointer to array of image chip pointers to be written (ie. array
of record IPi in database definition.) List of image chip pointer
is terminated by a NULL pointer
ImageChipPointer t
***ppasICPointerRead;
Pointer to pointer of array of image chip pointers read. List of
image chip is terminated by a NULL pointer

2.10.2

EXAMPLE
FILE *fpCDB; ImageChipPointer t **pasICPointer;
fpCDB = CDBOpen(imagechiptest, r);
...
CDBChipPointerIO(fpCDB, CDBRead, NULL, &pasICPointer);
...
CDBChipPointerIO(fpCDB, CDBWrite, pasICPointer, NULL);

22

PCI Geomatics

2.11. CDBINSERTCHIP INSERT IMAGE CHIP INTO IMAGE CHIP DATABASE FILE

2.11

CDBInsertChip Insert Image Chip into Image Chip


Database File
CDBInsertChip() inserts an image chip to the image chip database,
an down sampled overview may be inserted as well.

2.11.1

CALL SEQUENCE
int

CDBInsertChip( FILE,
*fpCDB,
ImageChipPointer t,
*psICPointer, ImageChipHeader t, *psICHeader, void, *pImage, void, *pImageOView );

FILE

*fpCDB;
FILE pointer to image chip database.

ImageChipPointer t
*psICPointer;
Pointer to Image chip pointer of the to be inserted image chip.
ImageChipHeader t
*psICHeader;
Pointer to Image chip header of the to be inserted image chip.
void

*pImage;
Pointer to the buffer holding image chip.

void

*pImageOView;
Pointer to the buffer holding overview image chip. If it is not
supplied, use NULL.

Return the position at which the chip is inserted.

2.11.2

EXAMPLE
FILE *fpCDB;
ImageChipPointer_t sICPointer;
ImageChipHeader_t sICHeader;
void
*pImagery;
void
*pImageryOView;
int
nInsertPos;

FILE *fpCDB;
fpCDB = CDBOpen("testimage", "r+");
...
nInsertPos = CDBInsertChip(fpCDB, &sICPointer, &sICHeader, pImagery, pImageryOVi

Version 8.2 / November 16, 2001

23

CHAPTER 2. CHIP FUNCTIONS

2.12

CDBIntChanIO Image Transfer From Image Chip


Using Buffer
CDBIntChanIO() allows access to the imagery data for a particular chip of the
image chip database file.

2.12.1

CALL SEQUENCE
void

24

CDBIntChanIO( FILE, *fpCDB, int, nFunc, int, nChip no,


TBool, bIsOverview, int, nXOff, int, nYOff,
int, nXSz, int, nYSz, int32, aszImgBuf[ ],
int, nBufXSz, int, nBufYSz, int, nChn, int,
anChnMap[ ] );

FILE

*fpCDB;
File pointer to chip database.

int

nfunc;
Function to perform, CDB READ to read the database into
aszImgBuf[ ], or CDB WRITE to write to the database from
aszImgBuf[ ].

int

nChip no;
Chip number to perform IO.

TBool

bIsOverview;
Flag to indicate if the image is overview chip image.

int

nXOff;
X (pixel) offset to imagery window in file.

int

nYOff;
Y (line) offset to imagery window in file.

int

nXSz;
X (pixel) size of imagery window in file.

int

nYSz;
Y (line) size of imagery window in file.

int32

anImgBuf[ ];
Buffer of byte to image data to read/write. On a read, this buffer
receives the imagery data read from the file. On a write, this
buffer contains the imagery data to write into the file. The image
held in aszImgBuf[ ] has dimensions nBufYSz lines, each line is
made up of nBufXSz pixels, each pixel having nChn channels.

int

nBufXSz;
X (pixel) size of imagery window in buffer.

int

nBufYSz;
Y (line) size of imagery window in buffer.

PCI Geomatics

2.12. CDBINTCHANIO IMAGE TRANSFER FROM IMAGE CHIP USING BUFFER

2.12.2

int

nChn;
Number of channel values in pnChnMap[ ].

int

anChnMap[ ];
Channel mapping buffer.

EXAMPLE
Read the first 3 channels of image chip 1.
...
FILE *fpCDB;
int32 imagry[80000];
int anChnMap[3];
...
fpCDB = CDBOpen("testimagechip", "r");
...
anChnMap[0] = 1;
anChnMap[1] = 2;
anChnMap[2] = 3;
CDBByteChanIO(fpCDB, CDB_READ, 1, FALSE, 0, 0, 100, 100, imagry,
100, 100, 3, anChnMap);

Version 8.2 / November 16, 2001

25

CHAPTER 2. CHIP FUNCTIONS

2.13

CDBMerge Merge Image Chip Databases


CDBMerge() merges two image chip databases into a new image chip database.

2.13.1

CALL SEQUENCE
void

2.13.2

CDBMerge( char, *psz1stDB, char, *psz2ndDB, char,


*pszMergedDB );

char

*psz1stDB;
First image chip database file.

char

*pszDBIF2;
Second image chip database file.

char

*pszMergedDB;
Merged image chip database file.

EXAMPLE
Merge testchip1.cdb and testchip2.cdb into MergeChip.cdb.
char *psz1stDB = "testchip1.cdb";
char *psz2ndDB = "testchip2.cdb";
char *pszMergedDB = "MergeChip.cdb";
CDBMerge(psz1stDB, psz2ndDB, pszMergedDB);
Compacting testchip1.cdb into testchipC.cdb
CDBMerge("testchip1.cdb", NULL, "testchipC.cdb");

26

PCI Geomatics

2.14. CDBSAVINGAFTERPACK DISK SPACE SAVINGS REPORT

2.14

CDBSavingAfterPack Disk Space Savings Report


CDBSavingAfterPack() returns the amount of disk space in MBytes that will be
saved and percentage of disk space freed after packing.

2.14.1

CALL SEQUENCE
void

CDBSavingAfterPack( FILE, *fpCDB, float, *fMByte, float, *fPercentSave );

FILE

*fpCDB;
File pointer to image chip database.

float

*fMByte;
Mega byte of space freed after packing.

float

*fPercentSave;
Percentage of disk space freed after packing.

Version 8.2 / November 16, 2001

27

CHAPTER 2. CHIP FUNCTIONS

2.15

CDBOpen Open Image Chip Database File


CDBOpen() opens an existing CHIPDB image chip database file. CHIPDB database
files should only be opened using CDBOpen(). Other file opening routines such as:
IDBOpen(), DKOpen() and TextOpen() are for other types of files.
The parameter DBDISK is prefixed to the database name passed if it is a relative,
rather than an absolute pathname and DBDISK is available.
If IMPInit is not already been called, CDBOpen() will call it with the arguments
Unknown and IMPFL QUIET | IMPFL TRAP FATAL.
See Also: CDBCreate(), CDBClose()

2.15.1

CALL SEQUENCE
FILE

*CDBOpen( char, *pszChipDBName, char, *pszAccess


);

char

*pszChipDBName;
CHIPDB file to open.

char

*pszAccess;
Access method - r for read access, or r+ for read/update
access.

Returns the file pointer for the file opened. The actual filename of the file opened
may be recovered by using fp2filename() on the FILE * returned by CDBOpen().
If the CHIPDB file does not exist, a fatal error is generated.

2.15.2

EXAMPLE
Open a file name testimagechip.cdb for read/write. Note that the default extension .cdb is added by CDBOpen() if the file testimagechip does not exist.
...
FILE
*fpCDB;
...
fpCDB = CDBOpen("testimagechip", "r+");
...
application code
...
CDBClose(fpCDB);
...

28

| Open CHIPDB file

| Close file

PCI Geomatics

2.16. CDBPIXELSIZE READ/WRITE PIXEL SIZE IN IMAGE CHIP

2.16

CDBPixelSize Read/Write Pixel Size in Image Chip


CDBPixelSize() reads or writes the pixel size on a CHIPDB database file.

2.16.1

CALL SEQUENCE
void

2.16.2

CDBPixelSize( FILE, *fpCDB, int, nFunc, int, nChip no,


float, *pfXSz, float, *pfYSz, char, *pszPxUnit );

FILE

*fpCDB;
FILE pointer to image chip database.

int

nFunc;
Flag indicating whether to write the passed pixel size to the
database(CDB WRITE), or return the pixel size currently stored
on the database(CDB READ).

int

nChip no;
Image chip involved.

float

*pfXSz;
Pixel ground X-size in pszPxUnit units.

float

*pfYSz;
Pixel ground Y-size in pszPxUnit units.

char

*pszPxUnit;
Pixel Size Units buffer. On a read, this buffer must be at least 9
bytes long. Currently, the only valid pixel size unit is METRE.

EXAMPLE
The following code prints out the current pixel size information, and then sets the
pixel size to 1 metre by 1 metre for chip #1.
FILE
*fpCDB;
float
fXSize, fYSize;
char
aszPixelUnit[9];
...
CDBPixelSize(fpCDB, CDB_READ, 1, &fXSize, &fYSize, aszPixelUnit);
printf("Pixel Size was %g x %g %s\n",
fXSize, fYSize, aszPixelUnit);
fXSize = 1;
fYSize = 1;
CDBPixelSize(fpCDB, CDB_WRITE, 1, fXSize, fYSize, "METRE");
...

Version 8.2 / November 16, 2001

29

CHAPTER 2. CHIP FUNCTIONS

2.17

CDBRealChanIO Image Transfer From Image Chip


Using Real Buffer
CDBRealChanIO() allows access to the imagery data for a particular chip of the
image chip database file.

2.17.1

CALL SEQUENCE
void

30

CDBRealChanIO( FILE, *fpCDB, int, nFunc, int, nChip no,


TBool, bIsOverview, int, nXOff, int, nYOff, int, nXSz, int, nYSz, float, fImgBuf[ ],
int, nBufXSz, int, nBufYSz, int, nChn, int,
anChnMap[ ] );

FILE

*fpCDB;
File pointer to chip database.

int

nfunc;
Function to perform, CDB READ to read the database into
aszImgBuf[ ], or CDB WRITE to write to the database from
aszImgBuf[ ].

int

nChip no;
Chip number to perform IO.

TBool

bIsOverview;
Flag to indicate if the image is overview chip image.

int

nXOff;
X (pixel) offset to imagery window in file.

int

nYOff;
Y (line) offset to imagery window in file.

int

nXSz;
X (pixel) size of imagery window in file.

int

nYSz;
Y (line) size of imagery window in file.

float

fImgBuf[ ];
Buffer of byte to image data to read/write. On a read, this buffer
receives the imagery data read from the file. On a write, this
buffer contains the imagery data to write into the file. The image
held in aszImgBuf[ ] has dimensions nBufYSz lines, each line is
made up of nBufXSz pixels, each pixel having nChn channels.

int

nBufXSz;
X (pixel) size of imagery window in buffer.

int

nBufYSz;
Y (line) size of imagery window in buffer.

PCI Geomatics

2.17. CDBREALCHANIO IMAGE TRANSFER FROM IMAGE CHIP USING REAL BUFFER

2.17.2

int

nChn;
Number of channel values in pnChnMap[ ].

int

anChnMap[ ];
Channel mapping buffer.

EXAMPLE
Read the first 3 channels of image chip 1.
...
FILE *fpCDB;
float imagry[30000];
int anChnMap[3];
...
fpCDB = CDBOpen("testimagechip", "r");
...
anChnMap[0] = 1;
anChnMap[1] = 2;
anChnMap[2] = 3;
CDBRealChanIO(fpCDB, CDB_READ, 1, FALSE, 0, 0, 100, 100, imagry,
100, 100, 3, anChnMap);

Version 8.2 / November 16, 2001

31

CHAPTER 2. CHIP FUNCTIONS

2.18

CDBSearch Search Image Chips


CDBSearch() will return a list of chip ID numbers (terminated by -1) that satisfy
the search criteria.

2.18.1

CALL SEQUENCE
int

*CDBSearch( FILE,
*fpCDB,
*psSearchSpace );

FILE

CDBCriteria,

*fpCDB;
FILE pointer to image chip database.

CDBCriteria
*psSearchSpace;
Gives the search criteria to be used.
CDBSearch will return a list of chip ID numbers (terminated by -1) that satisfy the
search criteria.
typedef struct {
TBool
char
char
TBool
double
double
double
double
TBool
double
double
TBool
char
char
TBool
char
TBool
double
double
TBool
double
double

bChipId;
aszChipId[21];
Identifier for image chip
aszGCPUnit[16]; Geocoding system of GCP
bBoundFlg;
Bounding rect. in which GCP is located
dGCPXLocUL;
dGCPYLocUL;
dGCPXLocLR;
dGCPYLocLR;
bElevationFlag; Range of elevation at GCP in metre
dGCPElevMin;
dGCPElevMax;
bTimeFlag;
Time frame during which imagery is taken
aszStartDate[10];
aszEndDate[10];
bSensorType;
Type of sensor used
aszSensor[17];
bResolution;
Average Resolution of imagery
dResMin;
dResMax;
bViewAngle;
Viewing Angle
dViewAngleMin;
dViewAngleMax;

} CDBCriteria;

2.18.2

EXAMPLE
Do a search for chips that are in between (117d4608.86 W, 33d4047.58N) and
(117d3610.62 W, 33d3641.53 N), having a chip identifier of Irvine*. The desired

32

PCI Geomatics

2.18. CDBSEARCH SEARCH IMAGE CHIPS

elevation is between 1 and 50 metres; the sensor type is Landsat; and the imagery is
acquired between 1-Jan-94 and 25-Jan-94. The desired pixel resolution is between
50 and 300.
FILE *fpCDB;
CDBCriteria sICCriteria;
int *pnArray;
fpCDB = CDBOpen("testchips.cdb", "r");
sICCriteria.bChipId = TRUE;
strcpy(sICCriteria.aszChipId, "Irvine*");
sICCriteria.bBoundFlag = TRUE;
DMSToDec("117d4608.86\" W", &sICCriteria.dGCPXLocUL);
DMSToDec("33d4047.58\" N", &sICCriteria.dGCPYLocUL);
DMSToDec("117d3610.62\" W", &sICCriteria.dGCPXLocLR);
DMSToDec("33d3641.53\" N", &sICCriteria.dGCPYLocLR);
strcpy(sICCriteria.aszGCPUnit, "Lat/Long");
sICCriteria.bElevationFlag = TRUE;
sICCriteria.dGCPElevMin = 1;
sICCriteria.dGCPElevMax = 50;
sICCriteria.bTimeFlag = TRUE;
strcpy(sICCriteria.aszStartDate, "1-Jan-94");
strcpy(sICCriteria.aszEndDate, "25-Jan-95");
sICCriteria.bSensorType = TRUE;
strcpy(sICCriteria.aszSensor, "Landsat");
sICCriteria.bResolution = TRUE;
sICCriteria.dResMin = 30;
sICCriteria.dResMax = 300;
sICCriteria.bViewAngle = TRUE;
sICCriteria.dViewAngleMin = 70;
sICCriteria.dViewAngleMax = 70;
pnArray = CDBSearch(fpCDB, &sICCriteria);
Do something with the search result
...
Free up memory associated with it
HFree(pnArray);

Version 8.2 / November 16, 2001

33

CHAPTER 2. CHIP FUNCTIONS

2.19

CDBUpdateChip Update Image Chip


CDBUpdateChip() update an image chip in the chip database.

2.19.1

CALL SEQUENCE
void

CDBUpdateChip( FILE, *fpCDB, int, nChip no, ImageChipPointer t,


*psICPointer, ImageChipHeader t, *psICHeader, void, *pImage );

FILE

*fpCDB;
FILE pointer to image chip database.

int

nChip no;
Chip number within the database to be updated.

ImageChipPointer t
*psICPointer;
Pointer to Image chip pointer of the to updated image chip.
ImageChipHeader t
*psICHeader;
Pointer to Image chip header of the to updated image chip.
void

2.19.2

*pImage;
Pointer to the buffer holding image chip.

EXAMPLE
FILE *fpCDB;
ImageChipPointer_t sICPointer;
ImageChipHeader_t sICHeader;
void
*pImagery;
FILE *fpCDB;
fpCDB = CDBOpen("testimage", "r+");
...
CDBUpdateChip(fpCDB, &sICPointer, &sICHeader, pImagery);

34

PCI Geomatics

2.20. CDBUPDATECHIPINFO UPDATE IMAGE CHIP HEADER

2.20

CDBUpdateChipInfo Update Image Chip Header


CDBUpdateChipInfo() update an image chip in the chip database.

2.20.1

CALL SEQUENCE
void

CDBUpdateChipInfo( FILE, *fpCDB, int, nChip no, ImageChipPointer t,


*psICPointer, ImageChipHeader t, *psICHeader );

FILE

*fpCDB;
FILE pointer to image chip database.

int

nChip no;
Chip number within the database to be updated.

ImageChipPointer t
*psICPointer;
Pointer to Image chip pointer of the to updated image chip.
ImageChipHeader t
*psICHeader;
Pointer to Image chip header of the to updated image chip.

2.20.2

EXAMPLE
FILE *fpCDB;
ImageChipPointer_t sICPointer;
ImageChipHeader_t sICHeader;
FILE *fpCDB;
fpCDB = CDBOpen("testimage", "r+");
...
CDBUpdateChipInfo(fpCDB, &sICPointer, &sICHeader);

Version 8.2 / November 16, 2001

35

CHAPTER 2. CHIP FUNCTIONS

36

PCI Geomatics

Chapter 3

Chip Matching

This chapter contains an alphabetical listing of chip matching functions.

37

CHAPTER 3. CHIP MATCHING

3.1

AUTOGEO AUTOMATIC GEOCODING


AUTOGEO is a EASI+ script to perform automatic geocoding
See Also: CHIPEXT, CHIPMAT, GCPREFN, SMODEL, SORTHO

3.1.1

PARAMETERS
AUTOGEO is controlled by the following global parameters:
Name

Prompt

Count

Type

FILI
ORBIT
GEOFILE
FILO
CLOUDTHR
REPORT

Database Input File Name


Orbit Segment Number
Database Geocoded File Name
Database Output File Name
Cloud Rejection Threshold
Report Mode: TERM/OFF/filename

1-64
0-1
1-64
1-64
0-2
0-64

Char
Int
Char
Char
Real
Char

FILI
Specifies the filename of the PCIDSK image database containing the uncorrected
image.
EASI>FILI="filespec"

ORBIT
Optionally specifies the orbit segment number on the image. The orbit number
should be read by using on of the SATORTHO tape or CD reading programs.
EASI>ORBIT= | no orbit number
EASI>ORBIT=n | orbit number in segment n

GEOFILE
Specifies the filename of the reference geocoded image database.
EASI>GEOFILE="filespec"

FILO
Specifies the filename of the rectified image of FILI. This file will be created and
georeferenced automatically if it does not exist.
EASI>FILO="filespec"

38

PCI Geomatics

3.1. AUTOGEO AUTOMATIC GEOCODING

CLOUDTHR
Optionally specifies the minimum gray level value to be treated as clouds inside an
extracted chip and the percentage of cloud content in which the extracted chip will
be rejected. Default is gray level value of 255 and 100% cloud content for rejection.
EASI>CLOUDTHR=60,5

EASI>CLOUDTHR=

|
|
|
|

Any gray level value over 60 is treated


as cloud and if there are more than 5%
cloud content, the chip will be rejected
Use default value of 255 and 100

For Landsat images, recommend values are 50 and 5. For SPOT images, recommend
values are 200 and 5.
REPORT
Specifies the file to which the model report should be appended.
EASI>REPORT="filename"
EASI>REPORT=
| defaults to terminal output
Note: The following names have special meaning:
EASI>REPORT="TERM"
EASI>REPORT="DISK"
EASI>REPORT="OFF"

3.1.2

| generates reports on your terminal


| generates reports on file "IMPRPT.LST"
| cancels report generation

DETAILS
AUTOGEO is a script to perform automatic geocoding of an uncorrected image.
AUTOGEO calls several programs to perform automatic geocoding: CHIPEXT,
CHIPMAT, GCPREFN, chipman, GCPWRIT, GCPPRO, SMODEL, and SORTHO.
Input to this script is an uncorrected image and a georeferenced image
AUTOGEO uses some default values internally. The user can modify the values if
necessary.
There must be some overlap region between the uncorrected image (FILI) and the
georeferenced image (GEOFILE). The uncorrected image must have approximate
geocoding available. This can take the form of an orbit segment, a GCP segment,
or if it is approximately georeferenced. The user can define the orbit or GCP
segment number using the ORBIT parameter. This is used to establish approximate
geocoding for the raw scene (FILE) so that the program can establish an overlap
region on the georeferenced image (GEOFILE) that should be used for extraction.
If ORBIT is set to the number of an ORBIT segment that orbit segment will be
used. The orbit segment should be created by one of the SATORTHO tape or
CD reading program. If it is set to the number of a GCP segment, then the GCP
segment will be used to establish an approximate geocoding. If the parameter is
defaulted the program will look for the first ORBIT segment on the file. If none

Version 8.2 / November 16, 2001

39

CHAPTER 3. CHIP MATCHING

are found, it will attempt to use the geocoding information in the georeferencing
segment.
If GCPs, or a georeferencing segment are used then the georeferencing system must
be a true projection that can be converted to Long/Lat, not a local unit system like
METRE, FOOT, or UTM without a zone.
AUTOGEO will correct FILI and store the results in FILO. If FILO does not exist,
it will be created and geocoded automatically.
It is quite common for the satellite image to contain clouds. The clouds can cause
mismatch during the matching procedure. It is advisable to specify a cloud threshold
(CLOUDTHR) to eliminate. areas with clouds. CLOUDTHR has two values: the
minimum gray level value to be treated as clouds and the percentage of cloud
content inside a match area to reject a GCP . For Landsat values of 50 and 5 are
recommended. For SPOT values of 200 and 5 are recommended. Default values are
255 and 100, i.e., accept all values.
Due to different seasons, clouds, and other factors, the resulting rectified image
may be off by several pixels or more. If the results are not satifactory, the user
can run GCPWorks to fix some of the GCPs and run SMODEL and SORTHO
program again. The points around the edges of the uncorrected image are the most
important for proper correction of the entire image. Hence, the user should make
sure those points are correct.
AUTOGEO will save the matching results into a report.

3.1.3

ALGORITHM
This section describes the method used in the automatic geocoding process. An
user has a georeferenced image and a lot of uncorrected images of approximately
the same areas of the same satellite sensor. The user first reads in the uncorrected
images using one of the PCI SATORTHO programs. An ORBIT segment is created
for each file.
After reading in all the images, the user run the EASI script AUTOGEO. AUTOGEO first extracts a number of geocoded chips from the georeferenced image and
saves it into a chip library. The program used is CHIPEXT (Chip Extract).
The next step for AUTOGEO is to run the CHIPMAT (Chip Match) program.
This is a program which does automatic matching between the geocoded chips and
areas on the uncorrected image using the cross-correlation method. The output
of this program is a GCP segment which contains all the GCPs. The problem in
automatic matching is to find corresponding areas on the uncorrected image. This
can be done by using the ORBIT segment stored on the uncorrected image. The
ORBIT segment contains the approximate geographic locations of the four corners.
From the four corners it is possible to estimate the positions and perform automatic
matching.
After running CHIPMAT program, AUTOGEO will run GCPREFN (GCP Refinement) program to remove GCPs with large errors. The errors may come from scenes
from different seasons, clouds, water etc. Removed GCPs are saved as check points.
GCPREFN will save the modified GCPs and satellite model into the uncorrected

40

PCI Geomatics

3.1. AUTOGEO AUTOMATIC GEOCODING

file.
The last step is to run SORTHO on the uncorrected file to create a georeference
file. SORTHO will create and geocode the output file automatically.
After creating the output image, the user can compare the results with the original
georeferenced image. It is not surprise to have small differences between the two
georeferenced images. The differences are mostly due to the GCPs. If the differences
are unacceptable, the user can run GCPWorks to modify the GCPs and SMODEL
and SORTHO again. It is important to have correct GCPs around the boundary
of the uncorrected images.

3.1.4

EXAMPLE
The user has an uncorrected Landsat satellite image raw.pix which contains an
ORBIT segment and a geocoded reference image geo.pix. The output image will
be created and georeferenced automatically.
EASI>FILI="raw.pix"
EASI>ORBIT=2
EASI>GEOFILE="georef.pix"
EASI>FILO="ortho.pix"
EASI>CHIPSENS="TM"
EASI>CLOUDTHR=50,5
EASI>REPORT=
EASI>R AUTOGEO

Version 8.2 / November 16, 2001

41

CHAPTER 3. CHIP MATCHING

3.2

CHIPEXT Chip Extract


Automatically extract image gcp chips from a geocoded image, optionally limiting
the area of extraction to overlap another scene.
See Also: CHIPMAT, CHIPMAN, GCPREFN

3.2.1

PARAMETERS
CHIPEXT is controlled by the following parameters:
Name

Prompt

Count

Type

FILE
ORBIT
GEOFILE
DBIC
BACKVAL
CHIPSENS
CHIPDATE
CHIPFILE
NUMCHIPS
CHIPSIZE
CHIPSIGM
FILEDEM
DBEC
CLOUDTHR

Input Raw Satellite Scene


Orbit segment number
Geocoded file
Database Input Channels
Background Value of Channels
Sensor Origin of GEOFILE
Date string(dd-mmm-yyyy)
Name of Image Chip Database
Max. Number of chips to extract
Size of chip in pixel and line
Threshold of variance for rej.
Database DEM File Name
Database Elevation Channel List
Cloud Rejection Threshold

0-64
0-1
1-64
0-3
0-3
0-16
0-16
1-64
1-1
2-2
1-1
0-64
0-1
0-2

Char
Int
Char
Int
Int
Char
Char
Char
Int
Int
Real
Char
Int
Real

Int

The following parameter receives output:


IMSTAT

Image Statistics

FILE
Specifies the PCIDSK database containing the Input Raw Satellite Scene. The raw
scene is optional, but if supplied it will be assumed to define a region of interest on
the geocoded image for which the user want to extract chips. In order to be useful,
the raw scene must have approximate geocoding available. This can take the form
of an orbit segment, a GCP segment, or if it is approximately georeferenced.
EASI>FILE=
EASI>FILE="filespec"

| No raw file specified


| Specify a raw file name

ORBIT
Specifies the orbit, or GCP segment that contain ephemeris data for the Input Raw
Satellite Scene. This is used to establish approximate geocoding for the raw scene

42

PCI Geomatics

3.2. CHIPEXT CHIP EXTRACT

(FILE) so that the program can establish an overlap region on the geocoded image
(GEOFILE) that should be used for extraction.
If ORBIT is set to the number of an ORBIT segment that orbit segment will be
used. If it is set to the number of a GCP segment, then the GCP segment will
be used to establish an approximate geocoding. If the parameter is defaulted the
program will look for the first ORBIT segment on the file. If none are found, it will
attempt to use the geocoding information in the georeferencing segment.
If GCPs, or a georeferencing segment are used then the georeferencing system must
be a true projection that can be converted to Long/Lat, not a local unit system like
METER, FOOT, or UTM without a zone.
EASI> ORBIT = orb_seg
EASI> ORBIT = gcp_seg
EASI> ORBIT =

|
|
|
|

Use Orbit segment


Use GCP segment
Look for orbit segment, and if one
isnt found use georeferencing info.

GEOFILE
Specifies the name of geocoded file from which to extract image chips.
EASI>GEOFILE="geocodedFileName"

DBIC
Specifies the database input channels on the georeferenced file (GEOFILE) to extract chips from. This may be one, or three channels.
EASI>DBIC=1
EASI>DBIC=1, 2, 3

| One channel
| Three channels

BACKVAL
Specifies the background, or no-data value, of the geocoded file (GEOFILE). This
may be default if all pixels are considered to be valid data. Selected chips will never
contain any pixels of the no data value.
EASI>BACKVAL=
EASI>BACKVAL=i
EASI>BACKVAL=i, j, k

| No background value
| Background value in first channel
| Background values in three channels

CHIPSENS
Specifies Sensor Origin of GEOFILE. This is a free format sensor name used later
to select only appropriate chips to attempt to match to. The sensor name should
be at most 16 characters.
EASI>CHIPSENS="sensorName"

Version 8.2 / November 16, 2001

43

CHAPTER 3. CHIP MATCHING

CHIPDATE
Specifies date of geocoded file (dd-mmm-yyyy) when its acquired. This is used
later to select only chips from an appropriate time period.
EASI>CHIPDATE="dateAcqusition"
CHIPFILE
Specifies name of image chip database to insert the extracted chips. If the chip
database doesnt already exist it will be created. Chip databases normally have the
extension .cdb.
EASI>CHIPFILE="imageChipDatabaseName"
NUMCHIPS
Specifies maximum number of chips to extract.
EASI>NUMCHIPS=n
CHIPSIZE
Specifies size of each chip in pixels and lines.
EASI>CHIPSIZE=m, n
CHIPSIGM
Specifies threshold of variance for chip rejection. Any chip with a variance of less
than the provided threshold will be discarded. The variance is the average difference
in pixel grey level between the chip mean, and the chip pixel values. If the variance
is very low (eg. less than two) then the chip is nearly a constant value.
EASI>CHIPSIGM=s
FILEDEM
Optionally specifies a DEM file to extract the elevation value of the extracted chip.
If this parameter is not specified, no elevation value will be extracted.
EASI>FILEDEM="filespec"
EASI>FILEDEM=

| No DEM provided

DBEC
Optionally specifies the channel held in the file FILEDEM which contains the elevation data (DEM) to be extracted.
EASI>DBEC=i
EASI>DBEC=

44

| Use channel i in FILEDEM


| No elevation data available

PCI Geomatics

3.2. CHIPEXT CHIP EXTRACT

CLOUDTHR
Optionally specifies the minimum gray level value to be treated as clouds inside an
extracted chip and the percentage of cloud content in which the extracted chip will
be rejected. Default is gray level value of 255 and 100% cloud content for rejection.
EASI>CLOUDTHR=60,5

EASI>CLOUDTHR=

|
|
|
|

Any gray level value over 60 is treated


as cloud and if there are more than 5%
cloud content, the chip will be rejected
Use default value of 255 and 100

IMSTAT
The IMSTAT parameter is assigned values by CHIPEXT indicating how many chips
where successfully extracted, and how many chips where considered but rejected
because they had background valued pixels, or because the variance was to low.
IMSTAT[1] gives number of chips extracted
IMSTAT[2] gives number of chips rejected

3.2.2

MONITOR
Program progress can be monitored by printing the percentage of completed processing in odometer fashion. A system parameter, MONITOR, controls this activity:
EASI>MONITOR="ON"
EASI>MONITOR="OFF"

3.2.3

| turn monitor ON (default)


| turn monitor OFF (recommended if
| running in batch/background mode)

DETAILS
CHIPEXT is a program to extract geocoded image chips from a geocoded file (GEOFILE). The extracted chips are stored inside a chip library (CHIPFILE). The chip
library can be used for future image tie down or automatic geocoding.
After running this program, the user can proceed to run CHIPMAT program to
extract GCPs from a raw file.
The user has the option to specify a raw PCIDSK database file (FILE). If this file
is specified, CHIPEXT will extract image chips from the overlap area between the
raw file and the geocoded file. In order to be find the overlap area, the raw scene
must have approximate geocoding available. This can take the form of an orbit
segment (ORBIT), a GCP segment, or if it is approximately georeferenced.
DBIC specifies the number of channels to be extracted from the geocoded file.
This can be 1 channel or 3 channels. If there are background values inside the

Version 8.2 / November 16, 2001

45

CHAPTER 3. CHIP MATCHING

geocoded image, the user should specify the background value (BACKVAL). Chips
with background values will be ignored.
The user has the option to specify chip sensor (CHIPSENS) and date of the geocoded
file (CHIPDATE). This information is useful for automatic geocoding. The extracted chips are stored inside chip library (CHIPFILE). The user can view the
contents of the chips using chipman program.
The user can specify the number of chips to be extracted using the NUMCHIPS
parameter. CHIPSIZE specifies the size of the chip extracted. Default values are
256x256. In order to be able to perform automatic geocoding, the chip should
contain enough heterogeneous contents. This can be controlled by specifying the
minimum variance inside the chip using the CHIPSIGM parameter. Default if 0.
Any chip with variance less than the CHIPSIGM value will be rejected.
If the user wants to perform orthorectification, it is necessary to extract the elevation
of the GCP inside the chip. This can be done by specifying a DEM file (FILEDEM)
with an elevation channel (DBEC).
It is quite common for satellite images to contain clouds. Clouds can cause failure
in automatic geocoding. A cloud rejection threshold (CLOUDTHR) can be used
to reject chips with clouds. CLOUDTHR allows the user to specify the minimum
gray level value to be treated as clouds inside a chip and the percentage of cloud
content in which the extracted chip will be rejected. Default is gray level value of
255 and 100% cloud content for rejection.

3.2.4

EXAMPLE
The user has a geocoded image and a raw image in PCIDSK format and wants to
extract chips from the overlap area.
EASI>FILE="raw.pix"
EASI>ORBIT=2
EASI>GEOFILE="geocoded.pix"
EASI>DBIC=2
EASI>BACKVAL=
EASI>CHIPSENS="TM"
EASI>CHIPDATE=
EASI>NUMCHIPS=64
EASI>CHIPSIZE=256,256
EASI>CHIPSIGM=2
EASI>FILEDEM=
EASI>DBEC=
EASI>CLOUDTHR=
EASI>R CHIPEXT

46

| no background value
| TM sensor

| use default cloud threshold value

PCI Geomatics

3.3. CHIPMAT IMAGE CHIP MATCH FOR GCPS

3.3

CHIPMAT Image Chip Match for GCPs


Automatic GCP collection from a raw image using geocoded image chips. The
results are stored inside a GCP segment.
See Also: CHIPEXT, ChipManager, GCPREFN

3.3.1

PARAMETERS
CHIPMAT is controlled by the following parameters:
Name

Prompt

Count

Type

FILE
ORBIT
DBIC
CHIPFILE
CHIPSENS
CHIPDATE
CHIPDBIC
CHIPSCOR
LLMARGIN
CLOUDTHR

Input Raw Satellite Scene


Orbit segment number
Input channel to use in correlation
Name of Chip Database
Sensor of chips to extract from CHIPFIL
Date range string for scenes
Input channel of chip to use
Minimum score (in %) for rejection
Lat/Long margin around raw scene
Cloud Rejection Threshold

1-64
1-1
1-1
1-64
1-16
10-21
1-1
0-1
0-2
0-2

Char
Int
Int
Char
Char
Char
Int
Int
Float
Float

Int

The following parameters receive output:


LASC

Last Database Segment Created

FILE
Specifies the PCIDSK database containing the Input Raw Satellite Scene.
EASI>FILE="filespec"
ORBIT
Specifies the orbit segment that contains ephemeris data for the Input Raw Satellite
Scene. This is usually 2.
EASI>ORBIT=i
Segment must be type 160 (SEG ORB).
DBIC
Specifies the database input channels in Raw Satellite Scene for use in correlation.
EASI>DBIC=i

Version 8.2 / November 16, 2001

47

CHAPTER 3. CHIP MATCHING

CHIPFILE
Name of Chip Database from which to retrieve chips for correlation.
EASI>CHIPFILE="imageChip.cdb"

CHIPSENS
Optionally specifies the sensor from chip library to be used to matching. Default is
all.
EASI>CHIPSENS=
EASI>CHIPSENS="Sensor"

| Use all chips


| Use chips with "Sensor" ID

CHIPDATE
Regular expression for chip dates that will be considered acceptable. If defaulted,
all dates will be considered a match.
EASI>CHIPDATE="*-1996"
EASI>CHIPDATE="*-Jan-*"
EASI>CHIPDATE="01-Jan-1996"

| Any chips from 1996


| Any chips from January
| Chips from Jan 1, 1996

CHIPDBIC
Input channel of chip to use.
EASI>CHIPDBIC=i

CHIPSCOR
Minimum score (in %) for rejection. Default is 75%.
EASI>CHIPSCOR=i
EASI>CHIPSCOR=

| Minimum score of i%
| Use default value of 75%.

LLMARGIN
This parameter specifies the lat/long margin for searching. Default is 0,0. The larger
the values, the larger the searching area on the raw image will be used for matching
of each point. This is needed when the orbital information of the raw image is very
inaccurate, for example, off by 100 to 200 pixels from the approximate positions.
EASI>LLMARGIN=
EASI>LLMARGIN=i,j

48

| Use default value of 0,0


| Use default value of i,j

PCI Geomatics

3.3. CHIPMAT IMAGE CHIP MATCH FOR GCPS

CLOUDTHR
Optionally specifies the minimum grey level value to be treated as clouds and the
percentage of cloud content in which the matching area of the raw image will be
rejected. Default is grey level 255 and 100% cloud content for rejection.
EASI>CLOUDTHR=i,j

EASI>CLOUDTHR=

|
|
|
|
|

Any grey level value over i is


treated as cloud; if there is
more than j% cloud content, the
matching area will be rejected
Use default value of 255 and 100

LASC
The segment number of the newly created GCP segment is saved in this output
parameter for use by other EASI procedures.

3.3.2

MONITOR
Program progress can be monitored by printing the percentage of completed processing in odometer fashion. A system parameter, MONITOR, controls this activity:
EASI>MONITOR="ON"
EASI>MONITOR="OFF"

3.3.3

| turn monitor ON (default)


| turn monitor OFF (recommended if
| running in batch/background mode)

DETAILS
CHIPMAT is a program to perform automatic GCP collection. Input to this program is a raw satellite image (FILE) with an orbit segment (ORBIT) and an image
channel (DBIC). A chip database (CHIPFILE) is required to perform the automatic
matching procedure. The chip database should be created using the CHIPEXT program. The result of this program is a GCP segment stored inside the raw image.
The Correlation score is stored in the elevation field of the SET 1 GCPs on the
GCP segment. You can use the program GCPREFN to remove GCPs with large
errors.
You can specify the chip sensor type using CHIPSENS. You can specify the date
range of the chips using CHIPDATE. You can specify the chip channel to use for
matching, using CHIPDBIC. CHIPSCOR can be used to reject matched GCPs with
low matching scores. The range is 0 to 100. The default value is 75.
LLMARGIN allows the user to specify the searching range. This is needed only if
the raw image has an inaccurate orbit segment, for example, off by 100 to 200 pixels
in the approximate positions.
CLOUDTHR allows the user to specify the minimum grey level value to be treated
as clouds and the percentage of cloud content in which the matching area of the
raw image will be rejected. Default is grey level 255 and 100% cloud content for
rejection.

Version 8.2 / November 16, 2001

49

CHAPTER 3. CHIP MATCHING

3.3.4

EXAMPLE
The user has extracted a chip database using CHIPEXT program and the chips are
stored inside geochip.cdb and would like to use it to collect GCPs from a raw
image raw.pix.
EASI>FILE="raw.pix"
EASI>ORBIT=2
EASI>DBIC=1
EASI>CHIPFILE="geochip.cdb"
EASI>CHIPSENS=
EASI>CHIPDATE=
EASI>CHIPDBIC=1
EASI>CHIPSCOR=
EASI>LLMARGIN=
EASI>CLOUDTHR=
EASI>R CHIPMAT

50

|
|
|
|
|
|

Use
Use
Use
Use
Use
Use

all chips
all dates
channel 1
default score of 75
default of 0,0
default of 50 and 5

PCI Geomatics

3.4. GCPREFN GCP REFINEMENT

3.4

GCPREFN GCP Refinement


Automatically refines GCP by eliminating those with large residual errors using
different modelling methods.

3.4.1

PARAMETERS
GCPREFN is controlled by the following parameters:
Name

Prompt

Count

Type

FILE
DBGC
ORBIT
MODELTYP
REJECT
ELLIPS
REPORT

Input Raw Satellite Scene


Database GCP Segment
Orbit segment number
Model Type: 0:SRIT 1-5:Polynomial order
Rejection criteria: mode param1, parm2
Ellipsoid for the Earth
Report mode: TERM/OFF/Filename

1-64
1-1
1-1
1-1
3-3
0-64
1-64

Char
Int
Int
Int
Int
Char
Char

FILE
Specifies the PCIDSK database containing the Input Raw Satellite Scene.
EASI>FILE="filespec"

DBGC
Specifies database GCP segment for which to refine.
ORBIT
Optionally specifies the orbit segment that contains ephemeris data for the Input
Raw Satellite Scene, if Satellite Ortho Model is to be used to remove bad points.
This parameter is not needed if polynomial method is used.
EASI>ORBIT=i
EASI>ORBIT=

| Orbit Segment
| No orbital segment

Segment must be type 160 (SEG ORB).


MODELTYP
Specifies model type to used in GCP refinement method.
EASI>MODELTYP=0
EASI>MODELTYP=1
EASI>MODELTYP=2

Version 8.2 / November 16, 2001

| Satellite Ortho Model


| 1st order polynomial equation
| 2nd order polynomial equation

51

CHAPTER 3. CHIP MATCHING

EASI>MODELTYP=3
EASI>MODELTYP=4
EASI>MODELTYP=5

| 3rd order polynomial equation


| 4th order polynomial equation
| 5th order polynomial equation

REJECT
Specifies the rejections method:
EASI>REJECT=mode, param1, param2
mode = 1 (absolute number to reject),
param1 = # to reject, param2 = %x vs. y
mode = 2 (percentage rejection), param1 = % to reject, param2 = %x vs. y
mode = 3 (sigma rejection), param1 = sigma in X, param2 = sigma in Y
mode = 4 (absolute distance rejection),
param1 = X pixels, param2 = Y pixels
mode = 5 (RMS error rejection), param1 = absolute X pixels,
param2 = absolute Y pixels
Please refer DETAILS section for more details.
ELLIPS
Optionally specifies the earth model to use to define the shape of the earth. This will
only be used if Satellite Ortho Model is chosen (MODELTYP=0) and is optional. If
Satellite Ortho Model is chosen and ELLIPS is not defined, this program will extract
the ellipsoid from the GCP unit. The following earth ellipsoids are supported:
EASI> ELLIPS = "0"

52

EASI>
EASI>
EASI>
EASI>
EASI>
EASI>
EASI>
EASI>

ELLIPS
ELLIPS
ELLIPS
ELLIPS
ELLIPS
ELLIPS
ELLIPS
ELLIPS

=
=
=
=
=
=
=
=

"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"

EASI>
EASI>
EASI>
EASI>

ELLIPS
ELLIPS
ELLIPS
ELLIPS

=
=
=
=

"9"
"10"
"11"
"12"

EASI>
EASI>
EASI>
EASI>
EASI>
EASI>
EASI>

ELLIPS
ELLIPS
ELLIPS
ELLIPS
ELLIPS
ELLIPS
ELLIPS

=
=
=
=
=
=
=

"13"
"14"
"15"
"16"
"17"
"18"
"19"

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

Clarke 1866, default


[used for NAD27 (North American Datum 1927)]
Clarke 1880
Bessel
New International 1967
International 1909
WGS 72 (World Geodetic Survey 1972)
Everest
WGS 66 (World Geodetic Survey 1966)
GRS 1980 (Geodetic Reference System 1980)
[used for NAD83 (North American Datum 1983)]
Airy
Modified Everest
Modified Airy
WGS 84 (World Geodetic Survey 1984)
[used for GPS (Global Positioning System)]
Southeast Asia
Australian National
Krassovsky
Hough
Mercury 1960
Modified Mercury 1968
Sphere of Radius (6370997 metres)

PCI Geomatics

3.4. GCPREFN GCP REFINEMENT

Note: If ELLIPS is defined, this will take precedence over any ellipsoid defined in
the PROJECT parameter.
If the ellipsoid is not supported as one of the above earth models, it may be defined
explicitly, in metres, as follows:
the equatorial radius (or semi-major axis or A) and the polar radius (or semiminor axis or B) for the ellipsoid. e.g. for Clarke 1866, ELLIPS = 6378206.4
6356583.8
the equatorial radius (or semi-major axis or A) and the eccentricity squared
for the ellipsoid. e.g. for Clarke 1866, ELLIPS = 6378206.4, 0.006768658
Note:

- If the "flattening" (F) is known for the earth model,


it may be used to derive the eccentricity squared (E**2)
by the following formula:
E**2 = (2 * F) - (F * F)
[Which is the same as F = 1.0 - sqrt(1.0 - E**2)]

radius of the sphere e.g. the usual radius of the earth as a sphere would be
ELLIPS = 6370997
REPORT
Specifies the file to which to append the generated report.
EASI>REPORT="filename"
Note: The following names have special meaning:
EASI>REPORT="TERM"
EASI>REPORT="OFF"

3.4.2

| generates reports on your terminal


| Cancels report generation

OUTPUT PARAMETERS
LASC
Segment number of created GCP segment containing refined GCPs.
IMSTAT(1) Number of GCPs accepted.
IMSTAT(2) Number of GCPs rejected (now Check GCPs)
IMSTAT(3) Original number of Check GCPs
IMSTAT(4) Original Residual Error (X) of accepted GCPs
IMSTAT(5) Original Residual Error (Y) of accepted GCPs
IMSTAT(6) New Residual Error (X) of accepted GCPs
IMSTAT(7) New Residual Error (Y) of accepted GCPs
IMSTAT(8) Residual error of rejected GCPs (X)
IMSTAT(9) Residual error of rejected GCPs (Y)
IMSTAT(10)Residual error of all check GCPs(X)
(original check plus rejected GCPs)
IMSTAT(11)Residual error of all check GCPs (Y)

Version 8.2 / November 16, 2001

53

CHAPTER 3. CHIP MATCHING

3.4.3

DETAILS
GCPREFN is a program to remove points with large errors from GCP segments.
This program should be run after CHIPMAT program.
This program will read the GCPs from GCP segment (DBGC) inside database file
(FILE). If satellite ortho model is to be used, an orbital segment (ORBIT) should
be specified as well.
The user can select using satellite ortho model or polynomial equations to remove
bad points using the MODELTYP parameter. MODELTYP equals 0 represents
using satellite ortho model and MODELTYP 1 to 5 represents using 1st to 5th
order polynomial equations.
The user can select different rejection methods to reject bad points using REJECT
parameter. REJECT is defined by MODE, PARAM1, and PARAM2 as follows.
MODE=1 represents absolute number of GCPs to reject. PARAM1 represents the
number of GCPs to reject and PARAM2 represents the ratio in rejection weighting
between x and y. For example, if the user wants a rejection weighting of 10 to 1 for
x and y, PARAM2 will be set to 10.
MODE=2 represents percentage rejection. PARAM1 represents the percentage of
number of GCPs to reject and PARAM2 represents the ratio in rejection weighting
between x and y.
MODE=3 represents sigma (standard deviation) rejection. PARAM1 and PARAM2
represent the minimum sigma values in X and Y to be rejected, respectively.
MODE=4 represents absolute distance rejection. PARAM1 and PARAM2 represent
the minimum absolute X and Y pixel residuals to be rejected. The rejection will
start from the point with the largest X or Y error.
MODE=5 represents RMS error rejection. The rejection will start from the point
with the largest RMS error for any point with X over PARAM1 pixels or Y over
PARAM2 pixels.
If satellite ortho model is used, this program will extract the ellipsoid from the GCP
segment. However, the user can overwrite the ellipsoid values using this parameter.
This program will save the final GCPs and check points into a new GCP segment.
If satellite ortho model is selected, a MODEL segment is also created for the user
to run SORTHO program afterwards.
GCPREFN generates a report (REPORT) of the final GCPs and check points saved
in a new gcp segment. The report can be turned off (REPORT=OFF) if desired.

3.4.4

EXAMPLE
The user has extracted GCPs using CHIPMAT program and would like to use the
satellite ortho model to delete bad GCPs. Any points with X or Y absolute residual
error over 5 are to be removed.
EASI>FILE="test.pix"
EASI>DBGC=3

54

PCI Geomatics

3.4. GCPREFN GCP REFINEMENT

EASI>ORBIT=2
EASI>MODELTYP=0
EASI>REJECT=5,5,5
EASI>ELLIPS=
EASI>REPORT=
EASI>R GCPREFN

Version 8.2 / November 16, 2001

55

CHAPTER 3. CHIP MATCHING

56

PCI Geomatics

Chapter 4

Image Chip Database Layout

4.1

File Header
Purpose:

General description of ChipDatabase file.

Location:

Block 1.

Length:

Given by FH11. Usually 1 block.

Field

Start

Type

Description
File Identification

FH1
FH2
FH3
FH4
FH5
FH6
FH7.1
FH7.2
FH8
FH9
FH10
FH11
FH12
FH13

4.1.1

1
9
17
33
49
113
145
209
273
289
305
321
337
353

A8
A8
I16
A16
A64
A32
A64
A64
A16
A16
I16
I16
I16
A160

File type
Software version
File size in blocks
Reserved (blanks)
File id
Generating Facility
First line of descriptive text
Second line of descriptive text
File creation time and date
Last update time and date
Start block of Image Chip Pointers.
Number of blocks of Image Chip Pointers
Number of Image Chip Pointers in use
Reserved (blanks)

Notes
FH1 Identifies the file a image chip database. Must always be CHIPDB .

57

CHAPTER 4. IMAGE CHIP DATABASE LAYOUT

FH2 Identifies the software system, and its current version, that generated the
CHIPDB database. Usually, this is PACEV6.0 indicating PCIs EASI/PACE
software system.
FH3 Give the overall size of file in 512 byte blocks.
FH5 Descriptive field identifying the file. Usually supported by the user at file
creation time.
FH6 Descriptive field used the identify which facility or institution produced this
file. For example, PCI Enterprises, Richmond Hill, Canada. Can be left
blank.
FH7.1, FH7.2 Descriptive fields, usually supplied by the user at file creation
time, identifying contents of the file. Can be left blank.
FH8,FH9 Formated as hh:mm dd-mmm-yy
FH10 Starting block of image chip pointer.
FH11 Usually 688 blocks allowing 2048 image chips to be stored.
FH12 Gives the number of Image Chip pointers that has data or is flagged as
deleted.

4.2

58

Image Chip Pointers


Purpose:

Information and pointers to image chips.

Location:

Given by FH10, currently equal to 2.

Length:

FH11 blocks in length. Maximum number of image chips in file is :


N = (FH11 * 512) / 699

PCI Geomatics

4.2. IMAGE CHIP POINTERS

4.2.1

Field

Start

Type

Description

...

...

...

Pointer for Image chip 1


...
Pointer for Image chip i

IPi.1
IPi.2
IPi.3
IPi.4
IPi.5
IPi.6
IPi.7
IPi.8
IPi.9
IPi.10
IPi.11
IPi.12
IPi.13
IPi.14
IPi.15
IPi.16
IPi.17
IPi.18
IPi.19
IPi.20
IPi.21.1.1
IPi.21.1.2
IPi.21.1.3
...
IPi.21.8.1
IPi.21.8.2
IPi.21.8.3
...

699*(i-1)+ 1
699*(i-1)+ 2
699*(i-1)+ 18
699*(i-1)+ 34
699*(i-1)+ 52
699*(i-1)+ 70
699*(i-1)+ 86
699*(i-1)+104
699*(i-1)+120
699*(i-1)+135
699*(i-1)+150
699*(i-1)+170
699*(i-1)+178
699*(i-1)+186
699*(i-1)+194
699*(i-1)+202
699*(i-1)+203
699*(i-1)+204
699*(i-1)+220
699*(i-1)+236
699*(i-1)+252
699*(i-1)+268
699*(i-1)+284
...
699*(i-1)+644
699*(i-1)+660
699*(i-1)+676
...

A1
A16
A16
F18.11
F18.11
A16
F18.11
I16
F15.8
F15.8
A20
F8.3
F8.3
F8.3
F8.3
A1
A1
A16
A16
A16
F16.9
F16.9
A24
...
F16.9
F16.9
A24
...

Used Flag
Sensor Type
Time of the chip acqusition in UTC
GCP X point
GCP Y point
GCP Geosystem unit
GCP Elevation (in metre)
Start block of image chip header
Pixel resolution in X direction
Pixel resolution in Y direction
Chip identifier
Viewing angle in degree
GCP X accuracy in metre
GCP Y accuracy in metre
GCP elevation accuracy in metre
Overview available flag
Ascending/Descending flag
Time image chip was added to database
Time point was last updated in database
Time chip was last used in matching
Start wavelength of first spectral band
End wavelength of first spectral band
File channel of first spectral band
...
Start wavelength of eighth spectral band
End wavelength of eighth spectral band
File channel of eighth spectral band
...
Pointer for Image chip i+1

Notes
IPi.1 This flag has the following definitions:
A segment active (contains data).
L segment active and locked (cannot be deleted).
D segment deleted (contains data but can be reused).
IPi.2 Current sensor types:
SPOT PLA : SPOT Panchromatic 10 metre
SPOT MLA : SPOT Multispectral 20 metre
RADARSAT : Radarsat

Version 8.2 / November 16, 2001

59

CHAPTER 4. IMAGE CHIP DATABASE LAYOUT

LANDSAT TM : Landsat TM
LANDSAT MSS :
IRS-1A :
IRS-1B :
IRS-1C :
MOMS :
ERS :
Scanned image :
IPi.3 Time/Date of imagery acqusition in UTC: hh:mm dd-mmm-yy .
IPi.4 Ground control point in X direction in IPi.6 unit.
IPi.5 Ground control point in Y direction in IPi.6 unit.
IPi.6 Ground control point unit, usually Lat/Long
IPi.7 Ground control point elevation in metre.
IPi.8 Pointer to the i-th Image chip header.
IPi.9 Pixel resolution in X direction in metre.
IPi.10 Pixel resolution in Y direction in metre.
IPi.11 Alphanumeric identifier of image chip.
IPi.12 Viewing angle for satellite/scene.
IPi.13 Ground control point accuracy in X direction in metre.
IPi.14 Ground control point accuracy in Y direction in metre.
IPi.15 Ground control point accuracy in elevation in metre.
IPi.16 Flag to indicate the availability/status of overview chip:
N Overview chip is not available.
Y Overview chip is available.
M Overview chip is available and could be used for coarse matching.
IPi.17 Flag to indicate ascending/descending mode for radar image chip:
A ascending mode.
D descending mode.
IPi.18 Time/Date of creating the chip and of adding it into database.
IPi.19 Time/Date of updating the chip.
IPi.20 Time/Date of using this chip in matching at the last time.
IPi.21.1.1 Start wavelength in microns of spectral response for the first channels
inside the chip.

60

PCI Geomatics

4.3. IMAGE CHIP HEADER

IPi.21.1.2 End wavelength in microns of spectral response for the first channels
inside the chip.
IPi.21.1.3 The channel number of this channel inside the original(sensor/raw)file.
......
IPi.21.8.1 Start wavelength in microns of spectral response for the eighth channels
inside the chip.
IPi.21.8.2 End wavelength in microns of spectral response for the eighth channels
inside the chip.
IPi.21.8.3 The channel number of this channel inside the original(sensor/raw)file.

4.3

Image Chip Header


Purpose:

Descriptive information about image chip and overview image chip.

Location:

Given by IPi.8 for the i-th image chip.

Length:

2 blocks.

Version 8.2 / November 16, 2001

61

CHAPTER 4. IMAGE CHIP DATABASE LAYOUT

Field

Start

Type

Description

ICi.1
ICi.2
ICi.3
ICi.4
ICi.5
ICi.6
ICi.7
ICi.8
ICi.9
ICi.10
ICi.11
ICi.12
ICi.13
ICi.14
ICi.15
ICi.16
ICi.17
ICi.18
ICi.19
ICi.20
ICi.21
ICi.22
ICi.23
ICi.24.1
ICi.24.2
ICi.25.1
ICi.25.2
ICi.25.3
ICi.25.4
ICi.26
ICi.27.1
ICi.27.2
ICi.27.3
ICi.27.4
ICi.28

1
65
129
193
201
209
217
225
241
257
321
337
353
369
370
386
402
410
426
442
450
458
474
490
506
522
538
554
570
586
842
858
874
890
906

A64
A64
A64
I8
A8
I8
I8
F16.9
F16.9
A64
F16.9
I16
I16
A1
I16
I16
F8.3
F16.9
F16.9
I8
I8
I16
I16
F16.9
F16.9
F16.9
F16.9
F16.9
F16.9
A256
F16.9
F16.9
F16.9
F16.9
A119

General description
Image description
Scene ID
Number of channels
Image channels data type
Image size in X (pixel direction)
Image size in Y (line direction)
Pixel location of GCP
Line location of GCP
Filename of original file that chip came from
Angle of rotation to make north up
Start block of image data
Number of blocks of primary image chip data
Pixel data swap flag
Start block of overview image chip data
Number of blocks of overview image chip data
Overview chip down sample factor
Pixel location of GCP in overview chip
Line location of GCP in overview chip
Overview image size in X(pixel direction)
Overview image size in Y(line direction)
Access count
Success count
Sum of successful correlation score
Sum of square of successful correlation score
Sum of X error in metre
Sum of Y error in metre
Sum of square of X error
Sum of square of Y error
Georeference string for projection
Chip X offset of upper-left corner
Chip Y offset of upper-left corner
Chip X scale factor
Chip Y scale factor
Reserved(blanks)

ICi.1 General description about the image chip. Usually supplied by user at image
chip creation time. Can be left blank.
ICi.2 Description about the image of the chip. Usually supplied by user at image
chip creation time. Can be left blank.
ICi.3 Scene ID of imagery. Can be left blank.
ICi.4 Number of channels in image chip. All channels are of the same data type
and are stored in pixel-interleaved format.
ICi.5 Indicate data type of channels, should one of 8U, 16S, 16U, and 32R.
ICi.10 Filename of the image file that the image chip is extracted from.

62

PCI Geomatics

4.4. IMAGE DATA

ICi.11 Number of degrees of rotation required to put the northmost part of the
imagery at the top. (Clockwise is taken to be positive)
ICi.12 Pointer to the primary image chip data.
ICi.14 The flag indicates whether the data is stored in swapped or standard form.
Standard form is high order byte first. 8-bit unsigned data is always in standard form since there is only one byte. This flag has the following definition:
S: swapped from standard form.
N: data is in standard form (not swapped).
ICi.15 Pointer to the overview image chip data. It must be 0, if no overview chip
exists.
ICi.22 The total number of accessing this chip.
ICi.23 The number of successfully matching this chip.
ICi.24.1 Sum of correlation score on successful matching.
ICi.24.2 Sum of square of correlation score on successful matching.
ICi.25.1 Sum of X residual error in metre. The residual was computed from the
refined model which may or may not include the current GCP.
ICi.25.2 Sum of Y residual error in metre. The residual was computed from the
refined model which may or may not include the current GCP.
ICi.25.3 Sum of square of X residual error in metre.
ICi.25.4 Sum of square of Y residual error in metre.
ICi.26 This gives the string for the projection, which will supply all the information
for the projection.
ICi.27.1 This gives the x-offset of upper-left corner of the chip. It will be used for
the geo-transformation. The value is assigned to zero if it is not available.
ICi.27.2 This gives the y-offset of upper-left corner of the chip. It will be used for
the geo-transformation. The value is assigned to zero if it is not available.
ICi.27.3 This gives the scale factor of the chip in x-direction. It will be used for
the geo-transformation. The value is assigned to zero if it is not available.
ICi.27.4 This gives the scale factor of the chip in y-direction. It will be used for
the geo-transformation. The value is assigned to zero if it is not available.

4.4

Image Data
Purpose:

Holds pixel interleaved image data.

Location:

Start at block given in field ICi.13 for the i-th image chip.

Length:

Given in field ICi.14 for the i-th image chip.

Field
ID.PIX

Start
1

Version 8.2 / November 16, 2001

Type
BINARY

Description
Image Data

63

CHAPTER 4. IMAGE CHIP DATABASE LAYOUT

4.4.1

Notes
ID.PIX Actual pixel interleaved imagery.
The total number of bytes is calculated using the following logic:
if ICi.5 equals 8U

bytes = ICi.4 * ICi.6 * ICi.7


else if ICi.5 equals 16S

bytes = ICi.4 * 2 * ICi.6 * ICi.7


else if ICi.5 equals 16U

bytes = ICi.4 * 2 * ICi.6 * ICi.7


else if ICi.5 equals 32R

bytes = ICi.4 * 4 * ICi.6 * ICi.7


The total number of blocks is:
blocks = (bytes + 511 ) / 512
There are unused (garbage) bytes at the end of last block of data for the image.
+-----------------------------------------------+
| File Header
|
| FH10 gives start block of Image Chip Pointer |
+- | FH11 gives the number of blocks of
|
| | Image Chip Pointer
|
| +-----------------------------------------------+
+->|
|
| Image Chip Pointer (IPi)
|
|
|
| +-------------------------------------------+ |
| | IP1
| |
+--| IP1.8
| |
|| +-------------------------------------------+ |
||
:
|
||
|
||
:
|
|| +-------------------------------------------+ |
|| | IPn
| |
+-----| IPn.8
| |
| || +-------------------------------------------+ |
| ||
|
| ||-----------------------------------------------|
| || Image Chip Header (ICi)
|
| || +-------------------------------------------+ |
| +->| IC1
| |
| +--| IC1.10
| |
| || +-------------------------------------------+ |
| +->| Image Chip Data
| |

64

Image Chip Pointer


must follow
File Header.

Image Chip Data


must follow Image
Chip Header

PCI Geomatics

4.4. IMAGE DATA

|
| | ID1.PIX
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| +-------------------------------------------+ |
|
|
:
|
|
|
|
|
|
:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| +-------------------------------------------+ |
+---->| ICn Image Chip Header
| |
----| ICn.10
| |
| | +-------------------------------------------+ |
+-->| Image Chip Data
| |
| | IDn.PIX
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| +-------------------------------------------+ |
+ ----------------------------------------------+

Version 8.2 / November 16, 2001

65

También podría gustarte