I've detected water bodies in satellite images (modis, sentinel, landsat) in special area polygons, by ndwi values and based on special thresholds. area polygons and image tiles are coordinate restricted, so there is only one main water body in image (as you can see in the picture below). i need to identify water body borders so i defined a binary mask that represents water body area (1s) and land area (0s). the problem is, there are some small water bodies (as noises) in the image. i want to get access to them and turn their values in binary mask array from 1 to 0, without effecting the main water body. i found some codes can count such like binary areas base on adjacency, but i dont have access to those areas to change the values!i need to access those areas seperately as an distinct objects (or something like this).
what should i do?