bcdev / snap-idepix

Collection of IdePix pixel classification modules for various sensors
GNU General Public License v3.0
4 stars 1 forks source link

S2 Idepix Cloud Urban distinction #36

Closed jorritscholze closed 2 years ago

jorritscholze commented 3 years ago

Currently bright urban areas are flagged within the Idepix MSI cloud flag. To distinguish urban areas from clouds the Cloud Displacement Index (CDI) is used, which makes use of the three highly correlated near infrared bands that are observed with different view angles. Hence, elevated objects like clouds are observed under a parallax and can be reliably separated from bright ground objects (Frantz et al., 2018 - Uni Trier). Additionally a spatial filter is applied on the Idepix_Cloud mask to correct gabs in the cloud mask, which ensures that the CDI condition is not applied if a pixel area of 11x11 is all masked as cloud. Furthermore, this correction is only applied for land pixel.

The following steps are a first approach for the corrected mask:

  1. Band Arithmetic: R8A7 = B7/B8A R8A8 = B8/B8A
  2. Band Filter Standard Deviation 7x7 R8A7_stddev7 = stddev7(R8A7)
    R8A8_stddev7 = stddev7(R8A8)
  3. Calculate CDI CDI = (pow(R8A7_stddev7,2) - pow(R8A8_stddev7,2)) /(pow(R8A7_stddev7,2) + pow(R8A8_stddev7,2))
  4. Spatial Filter 11x11 Mean cloud_filter = mean11(IDEPIX_CLOUD)
  5. Expression for corrected cloud mask: IDEPIX_CLOUD_new = if IDEPIX_CIRRUS_SURE or IDEPIX_CIRRUS_AMIGUOUS or IDEPIX_WATER then IDEPIX_CLOUD else if cloud_filter = 255 then IDEPIX_CLOUD else CDI<-0.5 and IDEPIX_CLOUD
marpet commented 3 years ago

Implemented in Branch mp_Urban_Cloud_Distinction

marpet commented 2 years ago

integrated into 8.x and master branch