This project processes NISAR Level-2 Geocoded Polarimetric Covariance (GCOV) data to detect water and vegetation using SAR backscatter, filtering, thresholding, and K-Means clustering.
- Nisar_Level2_GCOV.ipynb for VVVV polarization analysis(Done in QGIS):
- Nisar_Level2_GCOV_img2.ipynb for HVHV polarization analysis(Done in QGIS):
The repository contains two notebooks:
Nisar_Level2_GCOV.ipynbfor VVVV polarization analysis.Nisar_Level2_GCOV_img2.ipynbfor HVHV polarization analysis.
VVVV is used for water-sensitive analysis, while HVHV is used for vegetation-sensitive analysis.
- Loads multi-band SAR GeoTIFF data.
- Normalizes and smooths backscatter using Gaussian filtering.
- Detects water regions using Otsu thresholding on VVVV.
- Detects vegetation regions using Otsu thresholding on HVHV.
- Applies morphological cleanup to binary masks.
- Uses K-Means clustering to classify surface types from backscatter intensity.
- Visualizes SAR intensity, masks, and cluster-based land-cover categories.
The first notebook processes the VVVV band from the GCOV product.
Main steps:
- Load the VVVV band from the GeoTIFF.
- Replace invalid values and normalize intensity to 0–1.
- Apply Gaussian smoothing to reduce speckle noise.
- Use log transformation and Otsu thresholding to extract water-like regions.
- Clean the mask using opening and closing operations.
- Apply K-Means clustering with 3 classes to separate dark, medium, and bright surfaces.
The second notebook processes the HVHV band for vegetation analysis.
Main steps:
- Load the HVHV band from the GeoTIFF.
- Normalize and smooth the data.
- Use log transformation and Otsu thresholding to identify vegetation.
- Refine the mask with morphological operations.
- Overlay vegetation on the SAR image.
- Apply K-Means clustering with 3 classes to represent vegetation density.
This image shows the processed VVVV SAR scene over a basemap. The bright white regions indicate strong low-backscatter or water-dominant areas in the SAR footprint.
Install the required Python packages:
pip install rasterio numpy matplotlib scipy scikit-image scikit-learn- Open
Nisar_Level2_GCOV.ipynb. - Set the correct path to the VVVV GeoTIFF file.
- Run all cells to generate the water mask and clustering output.
- Open
Nisar_Level2_GCOV_img2.ipynb. - Set the correct path to the HVHV GeoTIFF file.
- Run all cells to generate the vegetation mask and clustering output.
- The helper function
process_sar_tiff()loads a selected band, handlesNaNvalues, normalizes the data, and applies Gaussian smoothing. - Otsu thresholding is used for automatic separation of classes based on intensity distribution.
- K-Means clustering is used as an unsupervised method to group pixels into meaningful surface categories.
- VVVV low-backscatter regions: likely water or smooth surfaces.
- VVVV bright regions: stronger scattering, often associated with rough or built-up areas.
- HVHV high-response regions: likely dense vegetation.
- HVHV low-response regions: sparse vegetation, bare land, or water.