ydoherty / CoastSat.PlanetScope

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

Question: Why did you combine the land mask with the cloud & no data mask during co-registration? #19

Open 2320sharon opened 2 weeks ago

2320sharon commented 2 weeks ago

Hi @ydoherty Thank you for your help with my previous question. I was wondering why you combined the land mask with the no data and cloud mask before co-registering the images? In single_mask_coreg I can see that the land mask generated by create_land_mask is combined with no data and cloud in mask = (mask_comb + land_mask) > 0 and then this is used as the target bad mask in the call to COREG_LOCAL in the arugment mask_baddata_tgt = land_mask_tgt,.

The land mask returned by create_land_mask is a flipped version of the "other " class mask returned by classify_single . In the function the mask returned by classify_single is first isolated to get the "other" class other_mask = im_classif == 0, then it is inverted other_mask = other_mask == 0, then this mask is saved as the land mask at the end of this function. The land mask returned by classify_single is therefore everything but the "other" class due to the inversion. By this logic the bad data mask used in the co-registration consists of the cloud, no data , as well as the water, white water and sand masks right? I'm guessing this is because in the local co-registeration you only want the tie point to be generated on land, is this right?

ydoherty commented 1 week ago

Hi @2320sharon, that's correct! For co-registration I wanted the image to be aligned with tie points on static non-moving components of the image. As you mentioned, to do this I filter out all sand (since it can be transient) and all water/whitewater as the reflectance in these pixels varies between all images. I imagine it may still work without these exclusions, however getting AROSICS to run without crashing on 2000+ images was a challenge so once I found a set of settings that worked I just stuck with it! There are many extra co-registration settings available in my advanced settings that can be tweaked if needed.

2320sharon commented 6 days ago

Thanks for getting back to me @ydoherty ! That makes sense, we ran into similar issues with tie points when were co-registering our imagery. The tie points kept getting generated on the sea, instead of on constant structures like buildings. I notice that in coastsat.planetscope it co-registers all the planet imagery to a single planet scene, did you ever get the chance to co-register to any LandSat imagery? We have developed a way to do that, but due the size & quality differences between the landsat & planet scenes the co-registered results seem to be warped randomly.

Once again thank you for answering all my questions and making this awesome tool.