Documentos de Académico
Documentos de Profesional
Documentos de Cultura
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
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.1
2 Chip Functions
2.1
2
11
12
2.2
14
2.3
15
2.4
16
2.5
17
2.6
18
2.7
19
2.8
20
2.9
21
22
2.11 CDBInsertChip Insert Image Chip into Image Chip Database File
23
24
26
27
iii
28
29
30
32
34
35
3 Chip Matching
37
3.1
38
3.2
42
3.3
47
3.4
51
57
4.1
File Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
57
4.2
58
4.3
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.
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
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.
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
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.
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
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.2
1.1.3
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
1.1.6
PCI Geomatics
1.1.7
1.1.8
10
PCI Geomatics
Chapter 2
Chip Functions
11
2.1
2.1.1
CALL SEQUENCE
void
12
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);
13
2.2
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.
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
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);
15
2.4
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];
16
PCI Geomatics
2.5
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;
17
2.6
2.6.1
CALL SEQUENCE
FILE
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
2.7.1
CALL SEQUENCE
void
2.7.2
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);
19
2.8
2.8.1
CALL SEQUENCE
void
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
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);
21
2.10
2.10.1
CALL SEQUENCE
void
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
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.
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
23
2.12
2.12.1
CALL SEQUENCE
void
24
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.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);
25
2.13
2.13.1
CALL SEQUENCE
void
2.13.2
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
2.14.1
CALL SEQUENCE
void
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.
27
2.15
2.15.1
CALL SEQUENCE
FILE
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
| Close file
PCI Geomatics
2.16
2.16.1
CALL SEQUENCE
void
2.16.2
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");
...
29
2.17
2.17.1
CALL SEQUENCE
void
30
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);
31
2.18
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
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);
33
2.19
2.19.1
CALL SEQUENCE
void
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
2.20.1
CALL SEQUENCE
void
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);
35
36
PCI Geomatics
Chapter 3
Chip Matching
37
3.1
3.1.1
PARAMETERS
AUTOGEO is controlled by the following global parameters:
Name
Prompt
Count
Type
FILI
ORBIT
GEOFILE
FILO
CLOUDTHR
REPORT
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
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=
|
|
|
|
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
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
39
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
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
41
3.2
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
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
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"
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
(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 =
|
|
|
|
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"
43
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
PCI Geomatics
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=
|
|
|
|
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
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
45
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
PCI Geomatics
3.3
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
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
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
47
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"
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"
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
PCI Geomatics
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=
|
|
|
|
|
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
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.
49
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
3.4.1
PARAMETERS
GCPREFN is controlled by the following parameters:
Name
Prompt
Count
Type
FILE
DBGC
ORBIT
MODELTYP
REJECT
ELLIPS
REPORT
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
51
EASI>MODELTYP=3
EASI>MODELTYP=4
EASI>MODELTYP=5
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"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PCI Geomatics
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:
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
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)
53
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
EASI>ORBIT=2
EASI>MODELTYP=0
EASI>REJECT=5,5,5
EASI>ELLIPS=
EASI>REPORT=
EASI>R GCPREFN
55
56
PCI Geomatics
Chapter 4
4.1
File Header
Purpose:
Location:
Block 1.
Length:
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
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
Location:
Length:
PCI Geomatics
4.2.1
Field
Start
Type
Description
...
...
...
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
59
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
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
Location:
Length:
2 blocks.
61
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
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:
Location:
Start at block given in field ICi.13 for the i-th image chip.
Length:
Field
ID.PIX
Start
1
Type
BINARY
Description
Image Data
63
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
64
PCI Geomatics
|
| | ID1.PIX
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| +-------------------------------------------+ |
|
|
:
|
|
|
|
|
|
:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| +-------------------------------------------+ |
+---->| ICn Image Chip Header
| |
----| ICn.10
| |
| | +-------------------------------------------+ |
+-->| Image Chip Data
| |
| | IDn.PIX
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| +-------------------------------------------+ |
+ ----------------------------------------------+
65