Color correcting raster data
Color correction can help render each raster dataset to appear as a single seamless image. It can be applied to an existing raster catalog, or a mosaic dataset.
This topic will focus on color correcting using a raster catalog. To understand the steps to color correct a mosaic dataset, see Color correcting a mosaic dataset.
Two methods can be used to apply a color correction: color balancing and color matching. Color balancing adjusts the contrast and color of each raster dataset to a reference raster. Color matching uses a reference raster dataset to which each of the source raster datasets is matched using one of three methods: statistic match, histogram match, or linear correlation. Color matching consists of two processes: first, the areas of overlap will have the matching calculations determined, then the pixel values will be interpolated for the rest of the raster datasets.
Color correction can be applied to a raster catalog layer or to a mosaicked raster dataset while it is being created.
- On-the-fly corrections: When a raster catalog is added to ArcMap or when a layer is created from it, there is a Color Correction tab on the Layer Properties dialog box. On this tab, color correction settings can be defined for the raster catalog layer. Optionally, you can apply color correction on a mosaic dataset.
- Persisted results: In ArcMap, you can output a mosaicked raster catalog as a raster dataset from the context dialog box. From the Mosaic Raster Catalog dialog box, you can check the Apply the color correction settings from Property Page box when creating the mosaicked raster dataset.
- Raster Catalog To Raster Dataset, Mosaic, and Workspace To Raster Dataset contain parameters that allow you to define the color correction you want applied when the raster dataset is created.
Color correction can only take place if the following are true about your data:
- All the bands have their statistics calculated.
- All the bands have their histograms built.
- All the raster datasets have the same number of bands.
- All the raster datasets have the same pixel type and pixel depth. Only 8-bit unsigned and 16-bit unsigned bit depths are supported.
- None of the raster datasets have an associated color map.
Pre-stretching can be performed on each raster catalog or mosaic dataset item before any other color correction takes place. This means that the original raster catalog item will be using its stretched pixel values, rather than its raw pixel values, in the color correction process. You may want to use this option to change the color to an expected distribution before applying color correction.
For raster catalogs, the Pre-stretching checkbox becomes available if either the Color Balancing or the Color Matching checkbox is checked. For mosaic datasets, this option is available on the Mosaic Color Correction window and with the Color Balance Mosaic Dataset tool. There are three pre-stretch methods available: adaptive stretch, minimum-maximum stretch, and standard deviation stretch.
Color balancing uses one of three techniques to color correct your raster catalog items or mosaic datasets: dodging balancing, histogram balancing, and standard deviation balancing.
- Dodging balancing—This is the traditional dodging photogrammetric technique, where each of the pixel values change toward the target color. These values are used to determine the output value for each pixel. If you choose Dodging, you must also choose the type of target color surface to use, which will affect what the target color is. Dodging balancing tends to give the best result in most cases.
- Histogram balancing—This technique will change each of the pixel values according to the target histogram. The target histogram can be automatically calculated from the raster catalog items, or a target raster can be specified. Histogram balancing works well when all the raster catalog items have a similar histogram shape.
- Standard deviation balancing—This technique will change each of the pixel values according to the standard deviation calculation. The standard deviation value can be automatically calculated from the raster catalog items or from a specified target raster. Standard deviation balancing works best when all the raster catalog items have the same histogram distribution of the normalized values.
The target color surface is only available if the dodging balancing technique is chosen. When using the dodging technique, each pixel needs a target color, which is picked up from the target color surface. There are five types of target color surfaces that you can choose from: single color, color grid, first order surface, second order surface, and third order surface.
- Single color—All the pixels are dodged toward a single color point, which is the mean. A single color surface works well when there are a small number of raster catalog items that have only a few different types of ground objects. If there are too many raster catalog items or too many types of ground surfaces, the output color may become blurred.
- Color grid—All the input pixels are dodged toward a set of points, which is distributed all over the raster catalog. Color grid produces a good output for a large number of raster catalog items or areas with a diverse number of ground objects.
- First order surface—All input pixels are dodged toward many points, which are obtained from the two-dimensional polynomial slanted plane. Compared to the Color Grid surface, a polynomial order surface tends to be a smoother color change and uses less storage in the auxiliary table but tends to take longer to process.
- Second order surface—All input pixels are dodged toward a set of points, which is obtained from the two-dimensional polynomial parabolic/hyperbolic/elliptical surface. Compared to the Color Grid surface, a polynomial order surface tends to be a smoother color change and uses less storage in the auxiliary table but tends to take longer to process.
- Third order surface—All input pixels are dodged toward multiple points, which are obtained from the cubic surface. Compared to the Color Grid surface, a polynomial order surface tends to be a smoother color change and uses less storage in the auxiliary table but tends to take longer to process.
The Use Reference Target Image checkbox allows you to specify the target raster used to balance your raster catalog or mosaic dataset items. If the checkbox is checked, you can specify the target image. If the checkbox is not checked, the system will automatically calculate the target.
- When dodging balancing is used—The target color that will be derived depends on the target color surface type that was chosen. For single color, the average value of the reference target image is used. For color grid, the reference target image is resampled to a suitable grid. For the polynomial order surfaces, the coefficients of the polynomial are obtained by least square fitting, from the reference target image.
- When histogram balancing is used—The target histogram is obtained from the reference target image.
- When standard deviation balancing is used—The target standard deviation is obtained from the reference target image.
The Apply Contrast Adjustment checkbox is used to apply a contrast stretch to your output color correction result. If you check the box, the output will appear sharper, since a contrast stretch will be applied.
Color matching matches the overlapping areas between the reference raster and the source rasters. Once the matching algorithm is determined in the overlap areas, it will be applied to the source rasters. Color matching can use one of three methods to interpolate the proper color match from the reference raster to the source rasters (see below).
In addition to the color correction requirements, there are two scenarios where color matching cannot be performed:
- If there is not enough overlap between the reference raster and the source rasters.
- If there is not enough correlation between the reference raster and the source rasters, the linear correlation method is not possible. In this case, another matching method can be chosen as a substitute.
Color matching is not available with mosaic datasets. It is only available with raster catalogs.
The first step in color matching is to determine the reference raster catalog item, either automatically or manually. The overlapped areas between the reference raster and the adjacent source raster datasets undergo the matching method chosen to determine the color transformation that is required. This transformation is applied to all the source rasters, while the raw pixel values of the reference raster is not changed. This procedure continues until all the rasters in the catalog have undergone this color transformation.
The image below shows two raster datasets that are overlapping and have slightly different color. With color matching, you are able to choose one image to match the color of the other image (reference raster). The first step is to choose the reference raster; for this example, the raster dataset outlined in yellow is chosen as the reference raster dataset. The raster dataset outlined in blue will be the source raster dataset, which will match the color of the reference.
The next step is to color match the areas of overlap. Only the areas where the yellow and blue outlines overlap will undergo the color-matching process. Once the transformation algorithm has been determined, the transformation will take place on the source image; the raw pixel values of the reference raster will not be changed.
There are three matching methods for the color matching process:
- Statistics matching—This method matches the statistical differences (using minimum, maximum, and mean) between the reference overlap area and the source overlap area, then applies the color transformation to the source datasets.
- Histogram matching—This method matches the histogram from the reference overlap area with the source overlap area, then applies the color transformation to the source datasets.
- Linear correlation—This method matches overlapped pixels and interpolates the rest of the source. The pixels that do not have a one-to-one relationship will use a weighted average.
The reference raster is the raster catalog item (raster dataset) that will not change its raw pixel values. The use of contrast stretching may make the reference raster look different, but the actual values are unchanged. The source raster datasets will conform to the qualities of the reference raster. The reference raster can be automatically chosen by an algorithm, or you can manually choose the reference when using the Layer Properties dialog box.