The management of water resources is vital for maintaining the world’s ecosystems. Conventional methods of extracting water bodies remain very limited due to the complexity of the implementation. This leads to a reduction in the extraction precision. Our main objec- tive is to improve the detection of water bodies. We tested the accuracy of our method on the Sentinel-2 Dataset that contains images with different complexity levels and heterogeneous structures like shadows, roads, buildings, etc. This article presents an original method that implements the idea of separating the three-component RGB image matrices and then processing only the green matrix because it contains all water bodies with high precision. Our method is based mainly on the mathematical morphology. Firstly, we propose a simple and fast binary algorithm to detect the maximum of water bodies existing in the images. This step was carried out using the Hit-or-Miss Transform. The second step exploits applying the Top-Hat Transform to refine the segmentation result. By comparing our method with several currently used methods, we notice that our method improves the quality of segmentation and gives excellent results, which exceed 95% for all the metrics used to calculate the classification quality in the purview of remote sensing. The error obtained with our method remains less than 1 %. We can affirm that our method is very suitable for detecting bodies of water compared to all current methods.