ydoherty / CoastSat.PlanetScope

Batch shoreline extraction toolkit for PlanetScope Dove satellite imagery
GNU General Public License v3.0
48 stars 13 forks source link

Sandless beaches not being picked in the Planetscope imagery. #18

Open ammarngis opened 4 months ago

ammarngis commented 4 months ago

I have been playing with CoastSat and CoastSat.PS. Really good tools. I have a question for you. Are the shoreline detection algorithms different in both as the shorelines returned by PS are quite different from those of S2 in areas where there is no sandy beach. I am attaching some examples below and looking to get your feedback on why this might be happening? Reference shoreline used in both cases is same and also the different shorelines parameters are kept same. PS one is missing some shoreline at the south of the inlet. Looking forward to hearing your thoughts on this.

S2 examples:

image image

PS examples: image image

kvos commented 3 months ago

@ydoherty , do you know why the shoreline is not being maapped all the way south? probably some of the settings no? buffer from sand pixels?

ydoherty commented 3 months ago

Hi @ammarngis, the shoreline algorithm varies slightly from CoastSat. Since the image resolution is much higher than Landsat/S2 it needed more filtering steps to prevent contours on pixels that aren't sandy shorelines which might be why you're having troubles. A few thoughts in the order I'd try them (to rule out other issues first):

The shoreline is only drawn on/adjacent to pixels classified as sand/water from the reference image selected in cell 2.1 add_ref_features(). If the above tests don't work I'd try run this again and choose a different reference image. You'll need to delete the .txt file that saves previously selected reference images to do this.

As Kilian suggested, contours aren't drawn on pixels classified as 'other'. It should still work next to water pixels however. If the above tests still don't work, your non-sandy beach region may be just off the edge of the water classified pixels. You could try tweak line 69 in extract_shorelines.py to increase the buffer size around sand/water pixels. ie change:

If all of the above don't work, there's a setting in data_import.py called 'generic_sl_region'. This may fix you problem, however it uses a different shoreline extraction algorithm and may be less robust/tested than the main workflow so I'd only use it as a last resort.

Hopefully one of those fixes works!

Cheers, Yarran

ammarngis commented 3 months ago

Thanks for the detailed response. I willl try these steps.

I also found out that in my case NDWI worked better than NmB and Otsu better than Peak Fraction to add more areas to the shoreline.