Cloud shadows in multispectral satellite imagery: correction before pansharpening

Updated:

Cloud shadows in a satellite image are best corrected on the original multispectral image (MSS), in linear values and before pansharpening, and the orthomosaic is built only after that. On a high-resolution image (PAN 0.5 m, MSS 2 m, four bands) with cloud shadows over mountain forest, the brightness step at the shadow edge fell from −0.67 to +0.01 (target 0), the color shift at the shadow edge (blue to green) from +0.53 to 0.00, and the brightness non-uniformity across the image from 0.76 to 0.51 stops. The geometry is preserved: the orthomosaic built from the corrected MSS matches the original orthomosaic (built by the imagery provider’s software) in position, with a median offset of 0.2 m. For comparison, the shadows were also corrected on the finished orthomosaic. The correction is computed by Fastvideo software.

The whole satellite image: the original orthomosaic with dark cloud shadows and the orthomosaic after shadow correction on the MSS, alternating frames
Figure 1. The whole image, 16 m per pixel, one brightness stretch for both frames. The frames alternate: the original orthomosaic and the orthomosaic built from the PAN and the corrected MSS. White patches are dense clouds, the white background is no data.

Key points

  1. Shadows are easiest to correct on the original MSS. Its values are linear, its color is the one the satellite measured, and all four bands, including near infrared (NIR), have not yet been mixed by pansharpening.
  2. The PAN needs correction if pansharpening takes brightness from it. Here pansharpening was done with a multiplicative method: the shadows stay in the PAN, but with this method they cancel out, and the final orthomosaic has no shadows without any PAN correction. If the pansharpening software also takes brightness from the PAN, the PAN must be corrected with the same factor as the MSS.
  3. The geometry does not change. Only brightness values change: the corrected MSS keeps its size and its RPC model.
  4. One image is enough. The correction is computed from the image itself: there was no elevation model, no other images of the same place and no ground control points.
  5. There is no data under dense clouds. Such areas stay clouds: they can only be replaced with another image of the same place, not painted in.
  6. Quality is measured with numbers over the whole image. GOST R 59328-2021 assesses shadows visually, so measures of the shadow edge, color, brightness non-uniformity, noise and sharpness were defined separately and checked on synthetic images with a known answer.

1. PAN, MSS and the orthomosaic

A high-resolution satellite captures the same place as two different images. The panchromatic image (PAN) is one wide band, a black-and-white image with a small pixel, here 0.5 m on the ground: individual tree crowns, paths and road edges are visible in it. The multispectral image (MSS) has four narrow bands: blue, green, red and near infrared. A narrow band collects less light, so the pixel is larger, 2 m. The MSS provides color, and NIR separates vegetation well from other surfaces.

The image is recorded not as a frame but line by line as the satellite flies. The PAN sensor line and the line of each MSS band sit side by side, so they see the same ground point at slightly different moments and from slightly different angles. In mountains this offset changes with elevation. Each image comes with an RPC model that converts the coordinates and elevation of a ground point into an image row and column.

To get an orthomosaic, three steps are needed:

  1. Orthorectification: move the PAN and the MSS onto the map grid using the RPC model and the terrain elevation.
  2. Co-registration: make the PAN and the MSS bands match pixel for pixel; otherwise colored fringes appear at edges.
  3. Pansharpening: take the color from the MSS and the fine detail from the PAN to get a color image with a 0.5 m pixel.

This is usually done by photogrammetry software. Cloud shadows can be corrected at two points in this chain: at the end, on the finished orthomosaic, or at the start, on the MSS before pansharpening. This article compares both options on one image.

The article continues the topic of brightness and color balancing of a series of aerial frames. There the same patch of ground is seen on several frames, in shadow and in sun. Here there is only one image, and everything the correction needs has to come from the image itself.

2. Why cloud shadows are hard to correct

3. Approach

For each point, the depth of the cloud shadow is determined from the image itself, using all four MSS bands at once; this is how a shadow is told apart from dark objects. Each band is then corrected in linear values according to its own dependence on shadow depth, so that an area in shadow gets the tone and color of the same kind of area in sun. The semi-transparent veil near cloud edges is reduced. Sunlit areas and dense clouds do not change.

Two options were compared:

Each step was checked first on synthetic images with a known answer, then on fragments of the real image, and only then on the whole image.

3.1. Pansharpening and shadows

The shadows were corrected only in the MSS; they remained in the PAN. The orthomosaic from the corrected MSS was built with a multiplicative pansharpening method (SFIM type): each MSS band is multiplied by the ratio of the PAN to its smoothed copy. This ratio carries only fine detail: crowns, paths, edges. A cloud shadow is smooth and enters the PAN and its smoothed copy equally, so it cancels out in the ratio, and brightness and color come from the MSS. The final orthomosaic has no shadows even though the PAN was not corrected.

Methods that replace the image brightness with the PAN (PCA, HSV, Brovey, Gram-Schmidt) take brightness from the PAN together with its shadows; such methods were not used in this work. There are photogrammetry programs in which pansharpening of any type takes brightness from both the PAN and the MSS; then the PAN has to be corrected together with the MSS. It is enough to multiply the PAN by the same brightness correction as the MSS, resampled onto the PAN grid: no color is taken from the PAN, and the PAN geometry, like the MSS geometry, does not change.

Stereo pairs. Pansharpened images are used for stereo plotting, so the shadow correction is visible in stereo too. Both images of a stereo pair must be corrected the same way: the same ground must have the same brightness and color on both images after correction, otherwise the stereo view is tiring and falls apart. A fringe at the shadow edge and noise in deep shadow that differ between the two images look like false relief in stereo. The image in this article is a single image, not a stereo pair; a check on a stereo pair is still ahead.

4. Example: a satellite image with cloud shadows

4.1. Data

A level L1 image (not orthorectified) from a high-resolution satellite and the original orthomosaic built from it by the imagery provider’s software. There was no elevation model, no other images of the same place and no ground control points.

Input dataOne level L1 image and the orthomosaic built from it by the imagery provider’s software
DataSize,
pixels
Ground
pixel
BandsNotes
Panchromatic image (PAN)16,735 × 11,372≈ 0.5 m1, 12 bitsRPC model
Multispectral image (MSS)4,167 × 2,831≈ 2 mblue, green, red, NIR; 12 bitsRPC model; bands co-registered to 0.5–0.8 pixel
Original orthomosaic (built by the imagery provider’s software)18,906 × 14,8630.5 mR, G, B, NIR; 16 bits (values 0–4095)UTM projection

4.2. Geometry

The orthomosaic from the corrected MSS was built with the RPC models on the grid of the original orthomosaic; terrain elevations were recovered from the data itself. The positional offset from the original orthomosaic was measured on 913 cloud-free patches of 128 × 128 m across the whole image: median 0.2 m, 90th percentile 0.9 m. Correction of the finished orthomosaic does not change the geometry: the grid is the same.

4.3. Results

The table gives quality measures computed over the whole image, at the same places for all three options. The brightness step and the color shift at the shadow edge were measured on 54 thousand pairs of points of the same forest on both sides of the shadow boundary: how much the shadow side differs from the sunlit side, in stops per stop of shadow depth (a stop is a twofold change in brightness). Brightness non-uniformity is the spread of the mean brightness of 64 × 64 m patches, in stops; patches with clouds are excluded. Edge width was measured on about 1,250 edges of roads and forest margins in sun (the transition from 10 to 90 % of the step).

Quality measures over the whole imageThe same places for all three options; patches with clouds are excluded
Measure
(what is better)
Original
orthomosaic
Correction of
finished
orthomosaic
MSS correction,
orthomosaic
rebuilt
Brightness step at the shadow edge (target 0)−0.67+0.03+0.01
Color shift at the shadow edge, blue/green (target 0)+0.53−0.040.00
Brightness non-uniformity across the cloud-free image, stops (lower is more uniform)0.7620.4850.508
Noise on flat areas, sun / shadow, % (lower is better)0.38 / 0.500.38 / 0.730.47 / 0.85
Color blotches in deep shadow, color spread at a 1–4 m scale (lower is better)0.0100.0090.010
Width of a sharp edge in sun, 0.5 m pixels (lower is sharper)2.022.062.37
Positional offset from the original orthomosaic, median, m—0 (same grid)0.2
Contrast coefficient K per GOST R 59328-2021 cl. 10.4, R / G / B (norm 0.75–0.99)0.95 / 0.74 / 0.600.94 / 0.92 / 0.920.98 / 0.80 / 0.67

There are no generally accepted numerical measures for cloud shadows: GOST R 59328-2021 assesses them visually. The measures of step, color, brightness non-uniformity, noise, color blotches and edge width were defined separately, and each was checked on synthetic images with a known answer.

Fragment 1, the deepest shadow in forest: the original orthomosaic, correction of the finished orthomosaic and MSS correction side by side
Fragment 1, the deepest shadow in forest: the original orthomosaic and MSS correction at full resolution, alternating frames
Figure 2. Fragment 1, the deepest shadow in forest, 300 × 300 m, 0.5 m per pixel. Top, left to right: the original orthomosaic, correction of the finished orthomosaic, MSS correction; below, the original orthomosaic and MSS correction at full resolution, alternating. On the original orthomosaic the forest is almost black with a bluish tint; after correction individual crowns, gaps and red autumn trees are visible.
Fragment 2, the edge of a cloud shadow over forest: the original orthomosaic, correction of the finished orthomosaic and MSS correction side by side
Fragment 2, the edge of a cloud shadow over forest: the original orthomosaic and MSS correction at full resolution, alternating frames
Figure 3. Fragment 2, the edge of a cloud shadow over forest, shadow on the left and sun on the right, 300 × 300 m, 0.5 m per pixel. Top, left to right: the original orthomosaic, correction of the finished orthomosaic, MSS correction; below, the original orthomosaic and MSS correction at full resolution, alternating. After correction the shadow boundary is barely visible; with correction of the finished orthomosaic the shadow side is slightly bluer, with MSS correction it is more even.
Fragment 3, a veil near a cloud edge over forest: the original orthomosaic, correction of the finished orthomosaic and MSS correction side by side
Fragment 3, a veil near a cloud edge over forest: the original orthomosaic and MSS correction at full resolution, alternating frames
Figure 4. Fragment 3, a veil near a cloud edge over forest, 300 × 300 m, 0.5 m per pixel. Top, left to right: the original orthomosaic, correction of the finished orthomosaic, MSS correction; below, the original orthomosaic and MSS correction at full resolution, alternating. The whitish veil over the forest next to the cloud is reduced; the dense cloud does not change.
Fragment 4, roads, clearings and glades in shadow: the original orthomosaic, correction of the finished orthomosaic and MSS correction side by side
Fragment 4, roads, clearings and glades in shadow: the original orthomosaic and MSS correction at full resolution, alternating frames
Figure 5. Fragment 4, roads, clearings and glades in shadow, 300 × 300 m, 0.5 m per pixel. Top, left to right: the original orthomosaic, correction of the finished orthomosaic, MSS correction; below, the original orthomosaic and MSS correction at full resolution, alternating. Not only the forest but also the road, clearing and glade in shadow get natural color.

5. Discussion and limitations

Both options remove the shadow boundary almost completely. MSS correction is better on the shadow edge and color, while correction of the finished orthomosaic is better on noise and sharpness, because it keeps its grid and its pansharpening. MSS correction gives one more result: a corrected MSS with the same geometry and RPC model. On this image correction of the finished orthomosaic also worked, because the original orthomosaic was built with a multiplicative method: its color matches the MSS to within a few units.

5.1. What needs more work

Fragment 5, a shadow under a semi-transparent cloud: the original orthomosaic, correction of the finished orthomosaic and MSS correction side by side
Fragment 5, a shadow under a semi-transparent cloud: the original orthomosaic and MSS correction at full resolution, alternating frames
Figure 6. Fragment 5, a shadow under a semi-transparent cloud (a limitation), 300 × 300 m, 0.5 m per pixel. Top, left to right: the original orthomosaic, correction of the finished orthomosaic, MSS correction; below, the original orthomosaic and MSS correction at full resolution, alternating. Here the shadow and the veil lie at the same points: the ground is brightened, but the veil rose with it and turned yellowish. Separating shadow and veil in such places is not yet fully achieved.

5.2. Next steps

  1. Checks on other scenes: cities, fields, snow.
  2. Separating shadow and veil where they lie at the same point.
  3. PAN correction with the same factor as the MSS, for software in which pansharpening takes brightness from the PAN.
  4. Stereo pairs: identical correction of both images and a check on the same ground in the left and right images.
  5. Computation speed: a C++ and CUDA version.

6. References

Pansharpening and its quality assessment

  1. Liu J.G. Smoothing Filter-based Intensity Modulation: a spectral preserve image fusion technique for improving spatial details. Int. J. Remote Sens. 21(18):3461–3472, 2000.
  2. Laben C.A., Brower B.V. Process for enhancing the spatial resolution of multispectral imagery using pan-sharpening. US Patent 6,011,875, 2000.
  3. Tu T.-M., Su S.-C., Shyu H.-C., Huang P.S. A new look at IHS-like image fusion methods. Information Fusion 2(3):177–186, 2001.
  4. Aiazzi B., Alparone L., Baronti S., Garzelli A., Selva M. MTF-tailored multiscale fusion of high-resolution MS and Pan imagery. Photogramm. Eng. Remote Sens. 72(5):591–596, 2006.
  5. Vivone G. et al. A Critical Comparison Among Pansharpening Algorithms. IEEE TGRS 53(5):2565–2586, 2015.
  6. Wald L., Ranchin T., Mangolini M. Fusion of satellite images of different spatial resolutions: assessing the quality of resulting images. Photogramm. Eng. Remote Sens. 63(6):691–699, 1997.
  7. Alparone L. et al. Multispectral and panchromatic data fusion assessment without reference. Photogramm. Eng. Remote Sens. 74(2):193–200, 2008.

Shadows and haze

  1. Richter R., Müller A. De-shadowing of satellite/airborne imagery. Int. J. Remote Sens. 26(15):3137–3148, 2005.
  2. Dare P.M. Shadow analysis in high-resolution satellite imagery of urban areas. Photogramm. Eng. Remote Sens. 71(2):169–177, 2005.
  3. Chavez P.S. An improved dark-object subtraction technique for atmospheric scattering correction of multispectral data. Remote Sens. Environ. 24:459–479, 1988. USGS

Quality requirements

  1. GOST R 59328-2021. Topographic aerial photography. Technical requirements (in Russian).

7. Further reading

Fyodor Serzhenko, Fastvideo

About the author

Fyodor Serzhenko, PhD, is the founder and CEO of Fastvideo. He earned his PhD at the Moscow Institute of Physics and Technology (MIPT) in 1993. Since 2009 he has led the development of Fastvideo’s GPU-accelerated image codecs and ISP modules, including the Fastvideo SDK. Connect on LinkedIn.

Why you can trust these results

Fastvideo has built GPU-accelerated image processing software since 2009. Our codecs comply with the standards they implement — JPEG (ITU-T T.81 / ISO IEC 10918) and JPEG2000 (ITU-T T.800 / ISO IEC 15444) — and our tools are open source on GitHub. Every performance figure we publish is reproducible: see our benchmark methodology, download the Fastvideo SDK benchmark report (PDF), and measure it on your own GPU.

You Might Also Like

JPEG codec test: Fastvideo JPEG vs NVIDIA nvJPEG on RTX 4090 JPEG on GPU: Fastvideo JPEG vs nvJPEG on RTX 4090 JPEG2000 codec test: Fastvideo JPEG2000 vs NVIDIA nvJPEG2000 on RTX 4090 Fastvideo JPEG2000 vs nvJPEG2000 on RTX 4090 Fastvideo SDK vs NVIDIA NPP for camera applications Fastvideo SDK vs NVIDIA NPP for camera applications

Contact Form

This form collects your name and email. See our Privacy Policy for how we handle your personal data.