Skip to content

Latest commit

 

History

History
81 lines (72 loc) · 4.93 KB

08.image_registration.md

File metadata and controls

81 lines (72 loc) · 4.93 KB

08. L8-S2 Co-Registration (Re-alignment)

Objective

  • Find the miss-aligment between L8-S2
  • Re-align L8 according to S2
  • Plot the offset difference before and after

General Information

  • Miss alignment (or miss registration) between L8 and S2 images varied with location and can exceed one Landsat pixel (>30 meters) (Storey et al., 2016). It is due to the residual geolocation errors in Landsat-8 framework which based upon the Global Land Survey images.
  • In general, S2 has better absolute geodetic accuracy than L8 (Storey et al.,2016) therefore we are going to re-align Landsat images according to a reference S2 image (Gao et al., 2009)
  • In GEE, we are going to find a pair of L8-S2 which were captured at the same time over the same location. Then displacement() is used to calculate the displacement vector (X and Y) at each pixel between the two images. Then displace() will be used to displace or wrap the L8 image aligned with the base S2 image (GEE Documenation).
  • The re-alignment described here is purely image processing technique. It is differed from geo-referencing or geo-correcting which involves aligning images to the correct geographic location through ground control points.

Core script

var bound = ee.Geometry.Polygon([
  [[35.96060746534647,33.815740435596645], [36.00472443922342,33.815740435596645], [36.00472443922342,33.85366939280121], [35.96060746534647,33.85366939280121], [35.96060746534647,33.815740435596645]]
]);

var bandIn = ['B2','B3','B4','B5','B6','B7'];
var bandOut = ['blue','green','red','nir','swir1','swir2'];

//Example images of S2 and L8
var imgS2SR = ee.Image('COPERNICUS/S2_SR/20181107T082129_20181107T082732_T36SYC').select(bandIn,bandOut).clip(bound);
var imgL8SR = ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_174036_20181107').select(bandIn,bandOut).clip(bound);

// Choose to register using only the 'Red' band.
var L8RedBand = imgL8SR.select('red');
var S2RedBand = imgS2SR.select('red');

// Determine the displacement by matching only the 'Red' bands.
var displacement = L8RedBand.displacement({
  referenceImage: S2RedBand,
  maxOffset: 50.0,//The maximum offset allowed when attempting to align the input images, in meters
  patchWidth: 100.0 // Small enough to capture texture and large enough that ignorable 
  //objects are small within the patch. Automatically ditermined if not provided 
});

//wrap the imgL8SR image
var l8SR_aligned = imgL8SR.displace(displacement);

Visualization and Checking

  • Visualizing on the map
Map.centerObject(bound,12)
var visParams = {bands: ['red','green','blue'], min:0, max: 3500};
Map.addLayer(imgL8SR, visParams, 'imgL8SR 30m');
Map.addLayer(imgS2SR, visParams, 'imgS2SR 10m');
Map.addLayer(l8SR_aligned, visParams, 'l8SR 10m'); 
  • Histogram of the offset difference before the alignment
// Compute image offset and direction.
var offset = displacement.select('dx').hypot(displacement.select('dy'));//calculates the magnitude of the 2D vector [x, y]
var angle = displacement.select('dx').atan2(displacement.select('dy'));// calculates the angle formed by the 2D vector [x, y].
//histogram of offset and agle
var histogramOffset = ui.Chart.image.histogram(offset, bound, 10).setOptions({title: 'Offset Differences'});
var histogramAngle = ui.Chart.image.histogram(angle, bound, 10).setOptions({title: 'Angle Differences'});
print(histogramOffset,'Offset Differences Before')
  • Histogram of the offset difference after the alignment
// Determine the displacement after registration (Red band)
var L8RedBand_aligned = l8SR_aligned.select('red');
var displacement = L8RedBand_aligned.displacement({
  referenceImage: S2RedBand,
  maxOffset: 50.0,
  patchWidth: 100.0
});
var offset_after = displacement.select('dx').hypot(displacement.select('dy'));
var angle_after = displacement.select('dx').atan2(displacement.select('dy'));
var histogramOffset_after = ui.Chart.image.histogram(offset_after, bound, 10).setOptions({title: 'Offset Differences'});
var histogramAngle_after = ui.Chart.image.histogram(angle_after, bound, 10).setOptions({title: 'Angle Differences'});

print(histogramOffset_after,'Offset Differences After');

References

  1. Registering Images in Google Earth Engine
  2. Masek, J., 2009. Automated registration and orthorectification package for Landsat and Landsat-like data processing. Journal of Applied Remote Sensing 3, 33515. https://doi.org/10.1117/1.3104620
  3. Storey, J., Roy, D.P., Masek, J., Gascon, F., Dwyer, J., Choate, M., 2016. A note on the temporary misregistration of Landsat-8 Operational Land Imager (OLI) and Sentinel-2 Multi Spectral Instrument (MSI) imagery. Remote Sensing of Environment 186, 121–122. https://doi.org/10.1016/j.rse.2016.08.025