kvos / CoastSat

Global shoreline mapping tool from satellite imagery
http://coastsat.space
GNU General Public License v3.0
698 stars 252 forks source link

Offshore bias in detection on S2 and L8 images #237

Closed pgurruchaga closed 7 months ago

pgurruchaga commented 3 years ago

Hi. I've been facing some trouble with the shoreline detection at a certain location where there's no white water and there's dark wet sand. My problem is kinda the opposite of #177 because in my case there's an offshore bias (instead of a detection in the wet-dry sand limit). I've also read #50 but unfortunately in my case adjusting the MNDWI threshold didn't help. Besides, I re-trained the classifier, which helped with the detection of sand pixels and the detection of some images that was wrongly at land, but it didn't solve the problem with the offshore lines. The issue is mainly with S2 images but also in some L8 (not as evident as in S2). I'll leave here two examples (two positions of the threshold for each one, the automatic and one modified by me) so you can see what I'm saying and perhaps give me your insight on why this is happening and what I can do. The images correspond to the detection with the original classifier, not the one I trained. Figure_1 Figure_2 Figure_3 Figure_4

Thanks, Paula.

kvos commented 3 years ago

hi paula, the classification looks good, it just seems like that there is a very shallow, crystal clear area in front of the shoreline that is returning MNDWI values that are close to land/sand and misleading the algorithm. There are three options that I can suggest:

  1. manually adjust the threshold on those images where it's completely off, or discard those images.
  2. other option is to change the MNDWI, which is used to contour the shoreline, with something else that shows a better contrast between sand and water at this site. Could be NDWI (NIR-Green/NIR+Green), or SWIR only, or Red minus Blue, you will have to test this.
  3. since the classification is good, you could contour the sand pixels directly, this is what was done in CoastSat.islands, you can try to apply that toolbox at your site.

All the best, kilian image