Sunday, May 31, 2009

Scanned Aerial Photo Pixel Size Determination

Many GIS people are collecting historical aerial photos to understand the changes in their areas of responsibility. I became interested in historical aerial photos when a student of Drs. John Jensen and Dave Cowan at the University of South Carolina (Dept. of Geography). One of Jensen’s graduate teaching assistants gave us a stereo pair of black and white aerial photos for us to use in our aerial photo interpretation lab. Among the tasks we had to perform was to decide what part of the US the photos covered. It was a trick question.

The stereo pairs were from the late 1930s, had smoothly rolling terrain, and were mostly covered by hay, corn and other crops. Trees were only located to provide shade for homes and along the larger streams. All but one student guessed Kansas was the area. The one who guessed differently said Nebraska (he was from Nebraska). We were all wrong. It was from Laurens County, South Carolina about 60 miles north of the university. Look on Google today.

We missed it because in 1989 (and today) when we drove through the area, there was little farming and the area was mostly covered by trees. But if we had looked carefully, we would have noticed that most of the trees were less than 50 years old.

So, thus began an interest in historical aerial imagery. The chart below was born at that time when I was a graduate student and working at South Carolina Department of Natural Resources.


1:40000

1:9600

1:4800

1:2400

1:1200

DPI

Microns

Feet

Meters

Feet

Meters

Feet

C'meters

Inches

C'meters

Inches

C'meters

508

50

6.56

2.00

1.57

0.48

0.79

24.00

4.72

12.00

2.36

6.00

635

40

5.25

1.60

1.26

0.38

0.63

19.20

3.78

9.60

1.89

4.80

847

30

3.94

1.20

0.94

0.29

0.47

14.40

2.83

7.20

1.42

3.60

1016

25

3.28

1.00

0.79

0.24

0.39

12.00

2.36

6.00

1.18

3.00

1270

20

2.62

0.80

0.63

0.19

0.31

9.60

1.89

4.80

0.94

2.40

1411

18

2.36

0.72

0.57

0.17

0.28

8.64

1.70

4.32

0.85

2.16

1814

14

1.84

0.56

0.44

0.13

0.22

6.72

1.32

3.36

0.66

1.68

2540

10

1.31

0.40

0.31

0.10

0.16

4.80

0.94

2.40

0.47

1.20

3629

7

0.92

0.28

0.22

0.07

0.11

3.36

0.66

1.68

0.33

0.84

  1. These are in photo scales; not in map scales.
  2. Diapositive or negative transparencies provide the best results. The original scan resolution should be at least 20% smaller than the final pixel size. Scanning images above 50 microns will make it difficult to measure fiducials correctly, and is discouraged when doing ortho-correction.
  3. The best available resolution is determined from the "Camera Calibration Report" in the "Lens Resolving Power" section. Depending on the quality of the camera, lens and film; resolution quality will vary across the image. 1000 / Tangential Line value will calculate the available resolution of the image in microns. As an example, cameras used to capture US Geological Survey (USGS) National Aerial Photography Program (NAPP) imagery typically had a maximum resolving ability from 8.85 to 15.38 microns. Using this information, the USGS typically scanned CIR NAPP imagery at 14 microns.
  4. Below is a graphic Spatial Model to convert scanned negatives to positives. It is simply each digital number minus 255 (if the data are 8-bit). You may wish to add another step to the model to the model eliminate all zero and 255 values. Remote sensing software (including ERDAS IMAGINE) like zero as the background values (black). ESRI's ArcGIS likes 255 as the background value (white). The difference comes from image analysts wanting a black background to ease eye strain, while GIS analysts wanting a white background for the map composition. Although the ArcGIS user could make the 255 values transparent, many are not familiar with this option. Thus ESRI made it simple for their customers.


PAGESIZE 6, 8 INCHES;
CELLSIZE MINIMUM;
PRINTERPAGESIZE 8.5, 11;
MARGINS 0.5, 0.5, 0.5, 0.5;
ORIENTATION PORTRAIT;
PRINTSCALE 100;
WINDOW UNION;
PROJECTION DEFAULT;
AOI NONE;
OPTIMIZE NO;
RASTER {
ID 1;
TITLE "n1_memory";
POSITION 0.833329, 0.666667;
TEMPFILE;
INTERPOLATION NEAREST;
ATHEMATIC;
DATATYPE FLOAT;
DECLARE "Integer";
COMPRESSION UNCOMPRESSED;
COORDINATES MAP;
RECODE NO;
CHILD 2;
}
FUNCTION {
ID 2;
TITLE "$n1_memory";
POSITION 1.68889, 1.91111;
VALUE "$n1_memory - 255";
AREA UNION;
CHILD 3;
}
RASTER {
ID 3;
TITLE "n3_memory";
POSITION 2.54444, 3.28889;
TEMPFILE;
NEWFILE;
INTERPOLATION NEAREST;
ATHEMATIC;
DATATYPE FLOAT;
DECLARE "Integer";
COMPRESSION UNCOMPRESSED;
COORDINATES MAP;
RECODE NO;
}

Friday, May 22, 2009

Fill Holes and Slivers in Imagery (Table of Values)

Here is a graphic Spatial Model (PaulBeaty_HoleFiller_Table.gmd) I created when I was at Georgia Tech. It fills DEM and other raster data (including imagery) holes and slivers with data calculated values from surrounding pixel values. These 1, 2 and sometimes 3 pixel wide artifacts are common to users who have reprojected butt-matched raster data. This model finds the "to-be-replaced" values from a table of values and determines whether a 3 x 3 or 5 x 5 focal mean should be applied. The model ignores the replacement values when calculating the focal mean.

Copy and paste the text below into a text editor and save as ANSI text file without the text editor's formatting. Save as PaulBeaty_HoleFiller_Table.gmd and open in Model Maker.


PAGESIZE 6.04444, 8.73889 INCHES;
CELLSIZE MINIMUM;
PRINTERPAGESIZE 8.5, 11;
MARGINS 0.5, 0.5, 0.5, 0.5;
ORIENTATION PORTRAIT;
PRINTSCALE 100;
WINDOW INTERSECTION;
PROJECTION DEFAULT;
AOI NONE;
OPTIMIZE YES;
RASTER {
ID 1;
TITLE "n1_PROMPT_USER";
POSITION 0.855556, 1.4;
PROMPT;
IGNORE 0;
INTERPOLATION NEAREST;
ATHEMATIC;
DATATYPE UNSIGNED16;
DECLARE "Integer";
COMPRESSION UNCOMPRESSED;
COORDINATES MAP;
AREA RECT 26, -2.079167 : 26.628333, -5.184167;
AOI NONE;
RECODE NO;
CHILD 2;
}
FUNCTION {
ID 2;
TITLE "EITHER";
POSITION 2.18889, 3.21111;
VALUE "EITHER (FOCAL MEAN ( $n1_PROMPT_USER , $n6_Low_Pass , IGNORE_VALUE $n28_Custom_Integer , APPLY_AT_VALUE $n28_Custom_Integer ) ) IF ( (FOCAL MAJORITY ( $n1_PROMPT_USER , $n3_Low_Pass ) == $n28_Custom_Integer) ) OR (FOCAL MEAN ( $n1_PROMPT_USER , $n3_Low_Pass , IGNORE_VALUE $n28_Custom_Integer , APPLY_AT_VALUE $n28_Custom_Integer ) ) OTHERWISE";
AREA UNION;
CHILD 4;
}
MATRIX {
ID 3;
TITLE "n3_Low_Pass";
POSITION 3.42222, 5.36667;
SIZE 3, 3;
DATATYPE SIGNED32;
BUILTIN LOWPASS;
VALUE 1, 1, 1,
1, 1, 1,
1, 1, 1;
NORMALIZE NO;
CHILD 2;
}
RASTER {
ID 4;
TITLE "n4_PROMPT_USER";
POSITION 0.944445, 5.24444;
PROMPT;
NEWFILE;
IGNORE 0;
INTERPOLATION NEAREST;
ATHEMATIC;
DATATYPE UNSIGNED16;
DECLARE "Integer";
COMPRESSION UNCOMPRESSED;
COORDINATES MAP;
RECODE NO;
}
MATRIX {
ID 6;
TITLE "n6_Low_Pass";
POSITION 3.26667, 1.68889;
SIZE 5, 5;
DATATYPE SIGNED32;
BUILTIN LOWPASS;
VALUE 1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1;
NORMALIZE NO;
CHILD 2;
}
TEXT {
ID 7;
TITLE "Repair Holes and Slivers using a Table of Values";
POSITION 2.67778, 0.344445;
FONT "new century schoolbook";
SIZE 18;
}
TEXT {
ID 8;
TITLE "5 x 5 filter";
POSITION 3.26667, 0.988889;
FONT "new century schoolbook";
SIZE 12;
}
TEXT {
ID 10;
TITLE "Value(s) to Replace";
POSITION 0.788889, 2.57778;
FONT "new century schoolbook";
SIZE 12;
}
TEXT {
ID 11;
TITLE "3 x 3 filter";
POSITION 3.52222, 4.66667;
FONT "new century schoolbook";
SIZE 12;
}
TEXT {
ID 13;
TITLE "Conditional statement to determine";
POSITION 3.8, 2.78889;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 14;
TITLE "which filter is more appropriate. If a majority";
POSITION 4.06667, 2.96667;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 15;
TITLE "of the pixels are the \"Value(s) to Replace,\"";
POSITION 4.01111, 3.18889;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 16;
TITLE "the 5 x 5 filter is used. Otherwise, ";
POSITION 3.8, 3.38889;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 17;
TITLE "the 3 x 3 filter is used.";
POSITION 3.4, 3.58889;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 18;
TITLE "Be sure to define the correct";
POSITION 1.03333, 6.23333;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 19;
TITLE "\"Data Type\" in the output file.";
POSITION 1.03333, 6.43333;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 20;
TITLE "Created in IMAGINE 8.4 - Developed by Paul Beaty";
POSITION 2.72222, 7.08889;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 21;
TITLE "Center for Geographic Information Systems";
POSITION 2.72222, 7.47778;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 22;
TITLE "Georgia Institute of Technology - Atlanta Georgia, USA";
POSITION 2.82222, 7.65556;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 26;
TITLE "Both filters ignore the \"Value(s) to Replace\"";
POSITION 4.06667, 3.77778;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 27;
TITLE "when calculating the mean.";
POSITION 3.58889, 3.98889;
FONT "new century schoolbook";
SIZE 10;
}
TABLE {
ID 28;
TITLE "n28_Custom_Integer";
POSITION 0.744445, 3.21111;
SIZE 4;
DATATYPE SIGNED32;
VALUE 0, 10, 20, 30;
CHILD 2;
}
TEXT {
ID 29;
TITLE "Add and delete values";
POSITION 0.8, 4.08889;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 30;
TITLE "Integer or float?";
POSITION 0.777778, 4.27778;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 31;
TITLE "Modified in IMAGINE 8.7 - Paul Beaty";
POSITION 2.71111, 7.27778;
FONT "new century schoolbook";
SIZE 10;
}

Fill Holes and Slivers in Imagery (Single Value)

Here is a graphic Spatial Model (PaulBeaty_HoleFiller.gmd) I created when I was at Georgia Tech. It fills DEM and other raster data (including imagery) holes and slivers with data calculated values from surrounding pixel values. These 1, 2 and sometimes 3 pixel wide artifacts are common to users who have reprojected butt-matched raster data. This model finds the "to-be-replaced" value and determines whether a 3 x 3 or 5 x 5 focal mean should be applied. The model ignores the replacement value when calculating the focal mean.

Copy and paste the text below into a text editor and save as ANSI text file without the text editor's formatting. Save as PaulBeaty_HoleFiller.gmd and open in Model Maker.

PAGESIZE 6.04444, 8.83889 INCHES;
CELLSIZE MINIMUM;
PRINTERPAGESIZE 8.5, 11;
MARGINS 0.5, 0.5, 0.5, 0.5;
ORIENTATION PORTRAIT;
PRINTSCALE 100;
WINDOW INTERSECTION;
PROJECTION DEFAULT;
AOI NONE;
OPTIMIZE YES;
RASTER {
ID 1;
TITLE "n1_PROMPT_USER";
POSITION 0.8, 1.7;
PROMPT;
INTERPOLATION NEAREST;
ATHEMATIC;
DATATYPE SIGNED16;
DECLARE "Integer";
COMPRESSION UNCOMPRESSED;
COORDINATES MAP;
AOI NONE;
RECODE NO;
CHILD 2;
}
FUNCTION {
ID 2;
TITLE "EITHER";
POSITION 2, 3.3;
VALUE "EITHER (FOCAL MEAN ( $n1_PROMPT_USER , $n6_Low_Pass , IGNORE_VALUE $n5_Integer , APPLY_AT_VALUE $n5_Integer ) ) IF ( (FOCAL MAJORITY ( $n1_PROMPT_USER , $n3_Low_Pass ) == $n5_Integer) ) OR (FOCAL MEAN ( $n1_PROMPT_USER , $n3_Low_Pass , IGNORE_VALUE $n5_Integer , APPLY_AT_VALUE $n5_Integer ) ) OTHERWISE";
AREA UNION;
CHILD 4;
}
MATRIX {
ID 3;
TITLE "n3_Low_Pass";
POSITION 3.3, 5.9;
SIZE 3, 3;
DATATYPE SIGNED32;
BUILTIN LOWPASS;
VALUE 1, 1, 1,
1, 1, 1,
1, 1, 1;
NORMALIZE NO;
CHILD 2;
}
RASTER {
ID 4;
TITLE "n4_PROMPT_USER";
POSITION 0.988889, 5.5;
PROMPT;
NEWFILE;
INTERPOLATION NEAREST;
ATHEMATIC;
DATATYPE SIGNED16;
DECLARE "Integer";
COMPRESSION UNCOMPRESSED;
COORDINATES MAP;
RECODE NO;
}
SCALAR {
ID 5;
TITLE "n5_Integer";
POSITION 0.6, 4;
DATATYPE SIGNED32;
VALUE -32767;
SHOW;
CHILD 2;
}
MATRIX {
ID 6;
TITLE "n6_Low_Pass";
POSITION 3.2, 1.8;
SIZE 5, 5;
DATATYPE SIGNED32;
BUILTIN LOWPASS;
VALUE 1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1;
NORMALIZE NO;
CHILD 2;
}
TEXT {
ID 7;
TITLE "Repair DEM Holes and Slivers";
POSITION 2.4, 0.5;
FONT "new century schoolbook";
SIZE 18;
}
TEXT {
ID 8;
TITLE "5 x 5 filter";
POSITION 3.2, 1.1;
FONT "new century schoolbook";
SIZE 12;
}
TEXT {
ID 10;
TITLE "Value to Replace";
POSITION 0.644444, 3.4;
FONT "new century schoolbook";
SIZE 12;
}
TEXT {
ID 11;
TITLE "3 x 3 filter";
POSITION 3.4, 5.2;
FONT "new century schoolbook";
SIZE 12;
}
TEXT {
ID 13;
TITLE "Conditional statement to determine";
POSITION 3.7, 2.8;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 14;
TITLE "which filter is appropriate. If a majority";
POSITION 3.8, 3;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 15;
TITLE "of the pixels are the \"Value to Replace,\"";
POSITION 3.83333, 3.18889;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 16;
TITLE "the 5 x 5 filter is used. Otherwise, ";
POSITION 3.7, 3.4;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 17;
TITLE "the 3 x 3 filter is used.";
POSITION 3.3, 3.6;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 18;
TITLE "Be sure to define the correct";
POSITION 1.2, 6.4;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 19;
TITLE "\"Data Type\" in the output file.";
POSITION 1.2, 6.6;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 20;
TITLE "Created in IMAGINE 8.4 - Developed by Paul Beaty";
POSITION 2.7, 7.4;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 21;
TITLE "Center for Geographic Information Systems";
POSITION 2.7, 7.6;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 22;
TITLE "Georgia Institute of Technology - Atlanta Georgia, USA";
POSITION 2.8, 7.8;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 26;
TITLE "Both filters ignore the \"Value to Replace\"";
POSITION 3.9, 3.8;
FONT "new century schoolbook";
SIZE 10;
}
TEXT {
ID 27;
TITLE "when calculating the mean.";
POSITION 3.48889, 4;
FONT "new century schoolbook";
SIZE 10;
}