====== PCA – Principal Components Analysis ====== {{ :basic_level:hoku_basic_pca_1.png?nolink&400|PCA with two ReadImage inputs, and its argument dialog}} Principal Components Analysis (PCA) looks for variance in multispectral data and re-orients the axes of the data so that it is ordered by decreasing variance. At times, this can reveal difficult-to-see text, by separating the low-contrast information from the high-contrast information. ===== Two inputs ===== PCA has two inputs, both from the same multiband image (with at least two bands): * **roi_link**: a region of interest. PCA computes the principal components from this data, so read it with a "window" around the area you care about. * **input_link**: the image that the resulting PCA transform is applied to, usually the whole image. The two images must have the same number of bands, but they can be different sizes. ===== Analysis ===== There are three ways to compute the components: **variance** (the default), **correlation** and **crossproducts**. They can give slightly different results, which might reveal different characters. The more spectral bands, and the larger the region of interest, the longer the computation takes. ===== Output bands ===== By default, there are as many output bands as input bands, ordered by decreasing statistical variance. As a result, the low-numbered bands have the higher-contrast information. Erased text is often low-contrast information, and may be in the higher-numbered bands. The highest-numbered bands are almost always random noise. If there are N output bands, they are numbered 0 to N-1. Enter a number M in **bandsOut** to output only bands 0 to M-1. The output is floating point. To save it, use ENVI with BSQ interleave; see [[basic_level:writeimage:multispectral_image_in_envi|Multispectral Image in ENVI]]. Calibrating the images first may give a better result; see [[advanced_level:calibration:read_calibrated_images|Read Calibrated Images]].