Closed 2320sharon closed 9 months ago
I figured out the cause of this bug at last!
When shorelines are extracted from the image the reference shoreline buffer is dilated by 5 pixels in both the coastsat_package
workflow and the zoo workflow. The issue is the reference shoreline buffer shown in the plots was not dilated at all meaning that the reference shoreline buffer shown on the plots did not reflect the actual reference shoreline buffer used to extract the shoreline.
# dilate the reference shoreline buffer by 5 pixels to mask out anything outside the reference shoreline buffer
se = morphology.disk(5)
im_ref_buffer_extra = morphology.binary_dilation(im_ref_buffer, se)
plot_image_with_legend
with markersize =1
shoreline_detection_figures
to plot the reference shoreline buffer dilated by 5 pixelsmarkersize =1
The reference shoreline buffer plotted by the coastsat workflow is correct because it uses the dilated buffer to plot the shorelines unlike the zoo workflow.
So this issue was bit more complicated than I previously thought. Here is what actually ended up being the solution.
I found out within coastsat_package
find_wl_contours2
and find_wl_contours1
that both of these functions were dilating the reference shoreline buffer by 5 pixels and keeping only the data within that region. The same was happening in the zoo workflows simplified_find_contours
function. This would normally be fine except the SDS_shoreline.create_shoreline_buffer
had already dilated the shoreline reference buffer by 5 pixels meaning that the buffer was being dilated by a total of 10 pixels, but the plot only reflected the 5 pixel dilation. I modified coastsat_package and simplified_find_contours
to no longer dilate the reference shoreline buffer after it was dilated.
In Zoo the reference shoreline buffer is not being applied correctly. Shorelines are being extracted even when they are outside the reference shoreline buffer as shown in the figure below. I have verified via the example below that the reference shoreline buffer is being plotted correctly, but it doesn't appear to be applied correctly.
What's weird though is that if I increase the size of the buffer more shorelines are being extracted as seen in the second figure.