1i.pca(1) Grass User's Manual i.pca(1)
2
3
4
6 i.pca - Principal components analysis (PCA) for image processing.
7
9 imagery, transformation, PCA, principal components analysis
10
12 i.pca
13 i.pca --help
14 i.pca [-nf] input=name[,name,...] output=basename [rescale=min,max]
15 [percent=integer] [--overwrite] [--help] [--verbose] [--quiet]
16 [--ui]
17
18 Flags:
19 -n
20 Normalize (center and scale) input maps
21 Default: center only
22
23 -f
24 Output will be filtered input bands
25 Apply inverse PCA after PCA
26
27 --overwrite
28 Allow output files to overwrite existing files
29
30 --help
31 Print usage summary
32
33 --verbose
34 Verbose module output
35
36 --quiet
37 Quiet module output
38
39 --ui
40 Force launching GUI dialog
41
42 Parameters:
43 input=name[,name,...] [required]
44 Name of two or more input raster maps or imagery group
45
46 output=basename [required]
47 Name for output basename raster map(s)
48 A numerical suffix will be added for each component map
49
50 rescale=min,max
51 Rescaling range for output maps
52 For no rescaling use 0,0
53 Default: 0,255
54
55 percent=integer
56 Cumulative percent importance for filtering
57 Options: 50-99
58 Default: 99
59
61 i.pca is an image processing program based on the algorithm provided by
62 Vali (1990), that processes n (n >= 2) input raster map layers and pro‐
63 duces n output raster map layers containing the principal components of
64 the input data in decreasing order of variance ("contrast"). The out‐
65 put raster map layers are assigned names with .1, .2, ... .n suffixes.
66 The numbers used as suffix correspond to percent importance with .1
67 being the scores of the principal component with the highest impor‐
68 tance.
69
70 The current geographic region definition and MASK settings are
71 respected when reading the input raster map layers. When the rescale
72 option is used, the output files are rescaled to fit the min,max range.
73
74 The order of the input bands does not matter for the output maps (PC
75 scores), but does matter for the vectors (loadings), since each loading
76 refers to a specific input band.
77
78 If the output is not rescaled (rescale=0,0, the output raster maps will
79 be of type DCELL, otherwise the output raster maps will be of type
80 CELL.
81
82 By default, the values of the input raster maps are centered for each
83 map separately with x - mean. With -n, the input raster maps are nor‐
84 malized for each map separately with (x - mean) / stddev. Normalizing
85 is highly recommended when the input raster maps have different units,
86 e.g. represent different environmental parameters.
87
88 The -f flag, together with the percent option, can be used to remove
89 noise from input bands. Input bands will be recalculated from a subset
90 of the principal components (inverse PCA). The subset is selected by
91 using only the most important (highest eigenvalue) principal components
92 which explain together percent percent variance observed in the input
93 bands.
94
96 Richards (1986) gives a good example of the application of principal
97 components analysis (PCA) to a time series of LANDSAT images of a
98 burned region in Australia.
99
100 Eigenvalue and eigenvector information is stored in the output maps’
101 history files. View with r.info.
102
104 PCA calculation using Landsat7 imagery in the North Carolina sample
105 dataset:
106 g.region raster=lsat7_2002_10 -p
107 i.pca in=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70 \
108 out=lsat7_2002_pca
109 r.info -h lsat7_2002_pca.1
110 Eigen values, (vectors), and [percent importance]:
111 PC1 4334.35 ( 0.2824, 0.3342, 0.5092,-0.0087, 0.5264, 0.5217) [83.04%]
112 PC2 588.31 ( 0.2541, 0.1885, 0.2923,-0.7428,-0.5110,-0.0403) [11.27%]
113 PC3 239.22 ( 0.3801, 0.3819, 0.2681, 0.6238,-0.4000,-0.2980) [ 4.58%]
114 PC4 32.85 ( 0.1752,-0.0191,-0.4053, 0.1593,-0.4435, 0.7632) [ 0.63%]
115 PC5 20.73 (-0.6170,-0.2514, 0.6059, 0.1734,-0.3235, 0.2330) [ 0.40%]
116 PC6 4.08 (-0.5475, 0.8021,-0.2282,-0.0607,-0.0208, 0.0252) [ 0.08%]
117 d.mon wx0
118 d.rast lsat7_2002_pca.1
119 # ...
120 d.rast lsat7_2002_pca.6
121 In this example, the first two PCAs (PCA1 and PCA2) already explain
122 94.31% of the variance in the six input channels.
123
124 Resulting PCA maps calculated from the Landsat7 imagery (NC, USA)
125
127 Richards, John A., Remote Sensing Digital Image Analysis, Springer-Ver‐
128 lag, 1986.
129
130 Vali, Ali R., Personal communication, Space Research Center, University
131 of Texas, Austin, 1990.
132
133 i.cca, g.gui.iclass, i.fft, i.ifft, m.eigensystem, r.covar, r.mapcalc
134
135 Principal Components Analysis article (GRASS Wiki)
136
138 David Satnik, GIS Laboratory
139
140 Major modifications for GRASS 4.1 were made by
141 Olga Waupotitsch and Michael Shapiro, U.S.Army Construction Engineering
142 Research Laboratory
143
144 Rewritten for GRASS 6.x and major modifications by
145 Brad Douglas
146
147 Last changed: $Date: 2015-09-14 19:06:11 +0200 (Mon, 14 Sep 2015) $
148
150 Available at: i.pca source code (history)
151
152 Main index | Imagery index | Topics index | Keywords index | Graphical
153 index | Full index
154
155 © 2003-2019 GRASS Development Team, GRASS GIS 7.4.4 Reference Manual
156
157
158
159GRASS 7.4.4 i.pca(1)