meta data for this page
Example 2: Reveal Faint Text with PCA
Level: Advanced (calibration needs the Statistics module) Modules: ReadStack, Statistics, PCA, Show, WriteImage
Goal
You have a folder of images of one page, each taken at a different wavelength, with a white calibration target in view. Erased or faded text is often low-contrast information that PCA can separate into its own bands. Calibrating the images first may give a better result.
Steps
1. Make the calibration file. Build ReadStack → Statistics. In ReadStack, add all the images in the folder, and leave its “calibration” flag unchecked. Display one image, draw a window on the white target, and enter it in Statistics. Check “calibration” and “verbose” in Statistics, run the job, and say yes to writing the file. The file is saved in the folder, named after the folder, with .cal. See Generate Cal File.
2. Build the PCA job. Drag two ReadStack modules and a PCA module to the Desktop. Connect one ReadStack to the left of PCA and the other to the top, and connect PCA to Show.
- In both ReadStack modules, add the same images in the same order, and check calibration.
- In the top ReadStack, enter a small “window” around an area that contains the faint text. This is the region of interest.
- In PCA, set input_link to left and roi_link to top. Leave “analysis” on variance.
3. Run it. Turn the job into a Star and execute it. The more bands and the larger the region of interest, the longer it takes.
4. Look through the bands. In Show, use the band slider to step through the output bands; see Displaying the Bands. The low-numbered bands have the higher-contrast information. Erased text, being low-contrast, may appear in the higher-numbered bands. The highest-numbered bands are almost always random noise.
5. Save the bands. Replace Show with WriteImage, choose Envi with BSQ interleave, and give the file a .hdr name, so that you can inspect each band later. See Multispectral Image in ENVI.