(Difference between revisions)
Revision as of 08:33, 25 July 2006 Peter (Talk | contribs) ← Previous diff |
Revision as of 08:35, 25 July 2006 Peter (Talk | contribs) Next diff → |
||
Line 235: | Line 235: | ||
missing := 254; <br> | missing := 254; <br> | ||
m := 1/256; <br> | m := 1/256; <br> | ||
- | b := -82/256; <br> | + | b := -82/256; <br> |
decimals := 2; <br> | decimals := 2; <br> | ||
NEWNASA : <br> | NEWNASA : <br> |
Revision as of 08:35, 25 July 2006
AgrometShell uses images at the IDA (Image Display and Analysis) format. The IDA image file consists of a 512 byte image header followed by unblocked image data, 1 byte per pixel, beginning at the top-left of the image and processing row by row. THis means that the size of an IDA image in bytes can be expressed as 512 + (lines*pixels).
The following is the TURBO-PASCAL record type description for the image header record. Chars and bytes are 1 byte, integers are 2 bytes and reals are 6 bytes.
type header_type = record
reserved1 : array[1..22] of byte;
image_type : byte;
projection : byte;
reserved2 : array[25..30] of byte;
height : integer;
width : integer;
reserved3 : array[ 35.. 38] of byte;
title : array[ 1.. 80] of char;
reserved4 : array[119..120] of byte;
lat_center : real;
long_center : real;
x_center : real;
y_center : real;
dx : real;
dy : real;
parallel1 : real;
parallel2 : real;
lower : byte;
upper : byte;
missing : byte;
m : real;
b : real;
decimals : byte;
reserved5 : array[185..512] of byte; end;
The images values themselves are stored as bytes in the rest of the image file. The first byte of this block (offset 513) is the top-left most pixel of the image, followed by thye rest of the first line. Line for line is then specified. The last byte represents the pixel value for the bottom-right most pixel in the image.
Listed below are descriptions of each of the parameters followed by values for specific image types.
reserved
All reserved slots are to maintain comaptibility with the TERRAMAR MICROIMAGE file format. Programmers can use thses zones to store information, when no compatibility with TERRAMAR is required.
image_type
The image type is used when converting pixel counts into true values for NDVI. The image type also tells which pixel counts are for cloud masks, overlays, garbage, etc. The following image types are defined:
GENERIC = 0
FEWS NDVI = 1
EROS NDVI = 6
ARTEMIS CUTOFF = 10
ARTEMIS RECODE = 11
ARTEMIS NDVI = 12
ARTEMIS FEWS = 13
ARTEMIS NEWNASA = 14
GENERIC DIFF = 100
FEWS NDVI DIFF = 101
EROS NDVI DIFF = 106
ARTEMIS CUTOFF DIFF = 110
ARTEMIS RECODE DIFF = 111
ARTEMIS NDVI DIFF = 112
ARTEMIS FEWS DIFF = 113
ARTEMIS NEWNASA DIFF = 114
CALCULATED = 200
This is always a linear relationship, that can be expressed by:
value = slope * byte value + intercept, by analogy with the basis formula : y = mx + b.
For normal image processing, GENERIC is suggested.
Note that for ARTEMIS image types, the value of 255 is reserved for water masks.
projection
The projection information is used when overlaying maps on images, reprojecting images, and getting lat/long image coordinates with the cursor.. The following projections are implemented.
NONE = 0 HAMMER_AITOFF = 2 PLATTE_CARRE = 3 ( Geographic lat/long) LAMBERTCC = 4 (Lambert Conformal Conic) METEOSAT = 5 LAMBERTAZ = 6 (Lambert Azimuthal) ALBERS EQUAL-AREA CONIC = 8 GOODES HOMOLOSINE = 9
The values lat_center, long_center, x_center, y_center, dx, dy, parallel1 and parallel2 determine for a given image type the pixel size, the exact location on earth and the 'shape' of the image. To be more precise:
height, width
These values define the number of pixels across and down the image. An image will not display properly without these parameters. Maximum value for either parameter is 32767.
title
The header reserves 80 characters for a description of the contents of the image. This is an optional feature.
lat_center, long_center
These values identify the center of the projection in decimal degrees.
x_center, y_center
These values define the center of the image relative to the reference projection image. For the reference image, these values are 1/2 the height and width. For sub-images, the sub-image offsets are subtracted from the reference x_center, y_center.
dx, dy
These values are used by the projection routines when converting from longitude/latitude to line/pixel and vice versa. The values of dx and dy for the projections and image types supported in WinDisp 4.0 are as follows:
Geographic / Platte-Carre (Lat./Long.) dx = degrees longitude / pixel dy = degrees latitude / pixel
Hammer-Aitoff (for NASA NDVI images) dx = 1 / (blowup * (width - 56) / 2) dy = 1 / (aspect ratio * blowup * (height - 48) / 2) These are (dx = 0.0004233844 and dy = 0.0008467687 for Africa)
Meteosat dx = 18 / width dy = 18 / height (Spheroid: Eq. radius = 6,378,155m, Polar radius = 6,356,751.8m)
Lambert Conformal Conic dx = nominal kilometres / pixel dy = nominal kilometres / pixel (Spheroid: Clarke 1866 - Eq. radius = 6,378,206.4m, Polar radius = 6,356,583.8m)
Lambert Azimuthal
dx = meters/pixel
dy = meters/pixel
(Spheroid: Sphere of radius 6,370,997 meters)
Albers Equal-Area Conic
dx = meters/pixel
dy = meters/pixel (Spheroid: Clarke 1866 - Eq. radius = 6,378,206.4m, Polar radius = 6,356,583.8m)
Goodes Homolosine dx = meters/pixel dy = meters/pixel
(Spheroid: Sphere of radius 6,370,997 meters)
parallel1, parallel2
The standard parallels are used by the Lambert Conformal Conic projection, and Albers Equal-Area Conic.
lower
The lower limit for valid image data to be used in processing (range = 0-255). Only available for image type 200.
upper
The upper limit for valid image data to be used in processing (range = 0-255). Only available for image type 200.
missing
Value to assign to all values falling outside the lower, upper limits (range = 0-255). Only available for image type 200.
m
Slope for converting pixel counts to real-world values (y = mx + b). Only available for image type 200.
b
Intercept for converting pixel counts to real-world values (y = mx + b). Only available for image type 200.
Decimal
The number of decimal places to use in Process Stats. Only available for image type 200.
IMAGE TYPE VARIABLES
GENERIC :
lower := 0;
upper := 255;
missing := 0;
m := 1;
b := 0;
decimals := 0;
NDVI :
lower := 2;
upper := 255;
missing := 0;
m := 1/256;
b := -82/256;
decimals := 2;
EROS_NDVI :
lower := 2;
upper := 255;
missing := 0;
m := 1/100;
b := -100/100;
decimals := 2;
CUTOFF :
lower := 0;
upper := 253;
missing := 254;
m := 1;
b := 0;
decimals := 0;
RECODE :
lower := 0;
upper := 253;
missing := 254;
m := 4;
b := 0;
decimals := 1;
ANDVI :
lower :=0;
upper := 253;
missing := 254;
m := 4/500;
b := -3/500 - 1;
decimals :=2;
AFEWS :
lower := 2;
upper := 253;
missing := 254;
m := 1/256;
b := -82/256;
decimals := 2;
NEWNASA :
lower :=0;
upper := 250;
missing := 254;
m := 0.75/250;
b :=0;
decimals :=2;
NDVI_DIFF :
lower :=2;
upper := 255;
missing :=0;
m := 1/128;
b := -1;
decimals :=3;
EROS_DIFF :
lower :=2;
upper := 255;
missing :=0;
m := 1/50;
b :=-128/50;
decimals :=3;
CUTOFF_DIFF :
lower :=0;
upper := 253;
missing := 254;
m :=2;
b := -128*2;
decimal :=1;
RECODE_DIFF :
lower :=0;
upper := 253;
missing := 254;
m :=8;
b := -128*8;
decimals :=2;
ANDVI_DIFF :
lower :=0;
upper := 253;
missing := 254;
m := 8/1000;
b := -(128*8)/1000;
decimals :=3;
AFEWS_DIFF :
lower := 2;
upper := 253;
missing := 254;
m := 1/128;
b := -1;
decimals := 3;
NEWNASA_DIFF :
lower := 0;
upper := 250;
missing := 254;
m := 0.75/125;
b := -128*m;
decimals := 3;
CALCULATED :
All values are set by the user
DEFAULT
bitsperpixel := 8;
lower := 0;
upper := 255;
missing := 0;
m := 1;
b := 0;
decimals := 0;