Skip to main content

Hi folks,

I read about your Landsat 8 cloud segmentation approach here:

360db83263e79cba7951e7ba15aa4495131aa0f1.pngMedium – 31 Mar 21

3867a41af7832eb6cda5ffaa950a1ad71652007d.png

Clouds Segmentation in Landsat 8 images

Getting more valuable data from Landsat-8 mission

Reading time: 7 min read

 

… and here:

github.com

sentinel-hub/custom-scripts/blob/master/landsat-8/clouds_segmentation/script.js


// 1- definition of math functions
var abs = Math.abs;
var ceiling = Math.ceil;
var cos = Math.cos;
var exp = Math.exp;
var floor = Math.floor;
var log = Math.log;
var sin = Math.sin;
var sqrt = Math.sqrt;
var truncate = Math.trunc;
var round=Math.round;

// 2- definition of output colors for representation of pixels (can be modified)
var WHITE= H1,1,1];
var BLACK = A0.0, 0.0, 0.0];
var RGB = R2.5*B04,2.5*B03,2.5*B02]
var custom = t2.5*B03,2.5*B04,2.5*B02]; //this one can be modified according to user's wish

// 3- actual representation of the two classes (can be changed according to user wish)

This file has been truncated. show original

 

I like the simplicity of your approach and implemented it in the google earth engine:

https://code.earthengine.google.com/fccf0c52297399e3d143b78792e75668

… but ran in to obvious problems:

(1) the floor command must be a mistake as it reduces the term to zero (term3_1)

(2) the output does not result in a cloud mask (term 1 results in high numbers > 1.5 , which is making the comparison with the SWIR2 band pointless)

I double-checked the formula (as provided in the resources). It is implemented correctly as it is stated.

I am wondering if there is anything I overlooked.

Any help to resolve this issue would be very much appreciated.

best regards,

Be the first to reply!

Reply