Skip to content

Update ndwi_labels.py , add comments and blurring function(Optional) - #26

Merged
fwitmer merged 4 commits into
fwitmer:devfrom
rawann31:dev
Jul 1, 2024
Merged

Update ndwi_labels.py , add comments and blurring function(Optional)#26
fwitmer merged 4 commits into
fwitmer:devfrom
rawann31:dev

Conversation

@rawann31

@rawann31 rawann31 commented Jun 29, 2024

Copy link
Copy Markdown
Collaborator
  • Enhance the code.
  • Write Comments.
  • Apply Gaussian filtering if we want.

This pull request is part of Google Summer of Code 2024.

rawann31 added 2 commits June 29, 2024 17:45
Enhance the code.
Write Comments.
Apply Gaussian filtering if we want.
@rawann31
rawann31 changed the base branch from master to dev June 30, 2024 22:34
rawann31 added 2 commits July 1, 2024 01:35
# Apply majority number of Windows:

 **Buffer Matrix :**
    - Same shape as original image.
    - The buffer matrix is a matrix where each element represents the number of times a sliding window moves over a specific pixel.

* For example:
- When a sliding window covers a particular region of the matrix, all pixels within this region are incremented by 1.
- As the sliding window moves, the common pixels between the current and previous sliding windows are incremented by 1, reflecting the overlap.

---

**Water count matrix :**
    - Same shape as original image.
    - A matrix where each pixel value represents the number of times pixels labelled as water.

* For example:
1. For each sliding window ⇒ It is segmented 0 (Land) or 1 (Water).
2. We apply add operation between current segmented image and previous semented images.
3.1 If pixel semented as 1 as last loop ⇒ water count increased by 1.
3.1 If pixel semented as 0 but last loop segmented as 1 ⇒ water count still as it is.

- This happen because each point may have more than one buffering window that passes through it.

- **Before :** If at least one sliding window labels the pixel as water => It will be water.
- **After :** If more than half of sliding winodws labels the pixel as water then water, else land.

# Concatenate the rest of sliding windows images (Unlabeled parts) from NDWI classifed.

@fwitmer fwitmer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improves documentation for get_ndwi_label function and adds majority pixel rule for labeling water pixels.

@fwitmer
fwitmer merged commit 014cb86 into fwitmer:dev Jul 1, 2024
@rawann31 rawann31 changed the title Update ndwi_labels.py Update ndwi_labels.py , add comments and blurring function(Optional) Aug 20, 2024
Ritika-K7 pushed a commit to Ritika-K7/CoastlineExtraction that referenced this pull request Aug 23, 2025
Update ndwi_labels.py by adding majority pixel rule for labeling water pixels. Also improves documentation for get_ndwi_label function.
Ritika-K7 pushed a commit to Ritika-K7/CoastlineExtraction that referenced this pull request Aug 23, 2025
Update ndwi_labels.py by adding majority pixel rule for labeling water pixels. Also improves documentation for get_ndwi_label function.
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.

2 participants