Skip to content

Robust NDWI Calculation with Edge-Protected Gaussian Filteringprotected blurring#73

Open
Vishesh0305 wants to merge 1 commit intofwitmer:masterfrom
Vishesh0305:fix/ndwi-robustness-optimization
Open

Robust NDWI Calculation with Edge-Protected Gaussian Filteringprotected blurring#73
Vishesh0305 wants to merge 1 commit intofwitmer:masterfrom
Vishesh0305:fix/ndwi-robustness-optimization

Conversation

@Vishesh0305
Copy link

This PR improves the numerical stability and spatial accuracy of the NDWI labeling process.
Numerical Stability - Implemented np.nan_to_num and np.errstate to handle zero-division and invalid pixels (0/0 cases) safely, which is critical for raw satellite sensor data.

Edge Protection - ntroduced a NoData mask ($green == 0$) that is applied after Gaussian blurring. This prevents the "smearing" of zero-value border pixels into the valid NDWI data, preserving the coastline's integrity at the image boundaries.
Value Distinction - Mapped NoData values to -1.0 to clearly distinguish "No Information" from "Deep Water" (NDWI \approx 1.0) and "Land" (NDWI < 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant