opera-adt / DSWX-SAR

Dynamic Surface Water Extent from Synthetic Aperture Radar
Apache License 2.0
9 stars 6 forks source link

Add a function adjusting threshold #51

Closed oberonia78 closed 6 months ago

oberonia78 commented 6 months ago

This PR includes several modifications to the initial_threshold.py file, aimed at improving its functionality.

1) The optimize_inter_distribution_threshold is introduced. This function addresses situations where the two distributions do not overlap. In such cases, the threshold tends to be biased towards the lower distribution (see figure), which can help reduce false positives (dark land) but may increase false negatives (bright water). To achieve a more balanced threshold, the optimize_inter_distribution_threshold function is introduced. It adjusts the threshold slightly higher when it falls below the 95% tail of the left distribution and the 5% tail of the right distribution. This adjustment helps mitigate false positive issues.

image

2) The tile-selection has more freedom to choose. In the previous version, users had options for tile-selection methods, including twele, chini, bimodality, and combined. The combined method combined all available methods (twele, chini, bimodality). However, there was a limitation in the previous version where users could only choose the selective methods, which included only two individual methods. With this PR, users can now select any two of the individual methods, such as chini and bimodality allowing for a more customized tile-selection approach.

3) iteration in initial_threshold was deleted. This change was made because it was found that the iteration parameter did not result in any improvements in the function's performance. Although this change may seem minor, it had an impact on the code's indentation without altering the underlying functionality.