Remote sensing image water body detection method based on smooth histogram morphological characteristics
By determining the optimal segmentation threshold for NDWI based on the morphological characteristics of smooth histograms, the accuracy and universality of water body detection in the prior art are solved, and a higher precision water body extraction effect is achieved.
Patent Information
- Application Number
- CN202510086111.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-01-20
AI Technical Summary
When using large-area remote sensing images, existing remote sensing images, the existing remote sensing methods are susceptible to image acquisition parameters and noise interference, resulting in error marking of non-water information. In the case of a small proportion of water cells, the threshold value determined by the OTSU algorithm is poor.
Using a remote sensing image water body detection method based on the morphological characteristics of smooth histograms, the NDWI value is calculated, the histogram is drawn, and the peaks and troughs on the histogram are recorded, and the optimal segmentation threshold for NDWI is determined for water body detection.
The accuracy and effect of water body segmentation and extraction are improved, especially when the number of water body cells accounts for a small proportion, the threshold value can be determined more accurately and the water body extraction results can be obtained with higher accuracy.
Smart Images

Figure CN120014456A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of remote sensing image detection, and in particular relates to a remote sensing image water body detection method based on smoothed histogram morphological features. Background Art
[0002] Water body data plays a key geographic information role in water conservancy project planning, water resources exploration, maintenance and supervision, and emergency response to floods and waterlogging; understanding the coverage of water body data has an extremely important impact on the continuous monitoring of water resources, the safety of water sources, and the rational development and maintenance of water resources.
[0003] Remote sensing technology has shown significant advantages in obtaining water body information within a large spatial range, which are mainly reflected in the following aspects: ① It can conduct observations with a short period of time and update data in a timely manner; ② It has a wide range of observations and can cover a large area; ③ It has rich spatial resolution and scale information and can provide detailed geographical details; ④ It has a large amount of spectral information and can conduct in-depth analysis and research. The traditional methods for obtaining water body distribution information can be divided into two main categories: one is the manual visual interpretation method, which relies on the intuitive analysis and interpretation of remote sensing images by professionals, and determines the spatial distribution of water bodies by identifying the visual characteristics of water bodies, such as color, texture and shape; professionals manually draw the boundaries of water bodies and finally generate spatial vector data of water bodies. The other is the automated extraction method, which mainly includes the following methods:
[0004] The single-band threshold method, such as the literature [Frazier PS, Page K J. Water body detection and delineation with Landsat TM data [J]. Photogrammetric engineering and remote sensing, 2000, 66 (12): 1461-1468], selects a specific band and sets a threshold to distinguish between water bodies and non-water bodies; this method is simple and direct, but may be affected by background noise.
[0005] The spectral relationship method, such as the literature [Chen C, Chen H, Liang J, et al. Extraction of water body information from remote sensing imagery while considering greenness and wetness based on Tasseled Cap transformation [J]. Remote Sensing, 2022, 14(13): 3001], uses the differences between multiple bands to extract water body characteristics by calculating difference, ratio and other models; this method can improve the accuracy of water body extraction, but the calculation process is more complicated.
[0006] Image classification methods, such as the literature [Yaqiu Y, Jiaguo L, Tao Y, et al. The Study of Object-oriented Water Body Extraction Method Based on High Resolution RS Image [J]. Bulletin of Surveying and Mapping, 2015 (1): 81], use classification algorithms to divide image data into two categories: water bodies and non-water bodies. This method can use machine learning and other technologies to improve classification accuracy through training samples, and use the boundaries of water body classification objects as the range of water distribution.
[0007] The above techniques highlight water features and distinguish water from non-water by comparing and analyzing different spectra. However, these methods may be affected by image acquisition parameters (such as the spectral response range and number of bands of satellite sensors) and image signal-to-noise ratio; in addition, when processing large-area remote sensing images (when considering a complete series of high-resolution satellite images), it is common for images to have different environments at the same time. These methods may mistakenly identify other surface features with similar grayscale values to water as water, resulting in non-water information being mislabeled in water; inappropriate threshold settings may lead to inaccurate fitting or overfitting of water boundaries, and the threshold needs to be adjusted according to different images, which limits the versatility of these methods.
[0008] In the process of determining the threshold of the water body index, the OTSU (Otsu method) is often used, such as in the literature [Jia YL, Zhang W, Meng L K. Astudy of selection method of NDWI segmentation threshold for GF-1 image [J]. Remote Sensing for Land and Resources, 2019, 31 (01): 95-100]. However, when the number of water body pixels in the scene or study area is very small, and the number of non-water body pixels and water body pixels is very different, the water body index histogram of the image does not show a more obvious bimodal state. At this time, the threshold determined by the OTSU algorithm has a poor effect on water body extraction. Summary of the invention
[0009] In view of the above, the present invention provides a remote sensing image water body detection method based on smoothed histogram morphological features to determine the optimal segmentation threshold of NDWI, which can improve the accuracy and effect of water body segmentation and extraction.
[0010] A remote sensing image water body detection method based on smoothed histogram morphological features comprises the following steps:
[0011] (1) obtaining a remote sensing image of the target area and performing preprocessing, wherein the remote sensing image contains spectral information of a red band, a green band, a blue band, and a near-infrared band;
[0012] (2) For the preprocessed remote sensing image, draw a histogram of the NDWI (Normalized Difference Water Index) data;
[0013] (3) filtering the histogram and recording the highest peak point, the second highest peak point and all valley points between the two peak points in the histogram;
[0014] (4) According to the distance from the trough point to the line connecting the highest peak point and the second highest peak point, the optimal segmentation threshold of NDWI is determined for water body detection and extraction.
[0015] Furthermore, the pre-processing of the remote sensing image in step (1) includes radiation calibration, atmospheric correction, geometric correction processing, etc.
[0016] Furthermore, the specific implementation method of step (2) is as follows: for the pre-processed remote sensing image, firstly, the NDWI value of each pixel in the remote sensing image is calculated by the following formula;
[0017]
[0018] Among them: for any pixel in the remote sensing image, NDWI is the NDWI value of the pixel, p(Green) and p(NIR) are the pixel values of the pixel in the green band and near infrared band respectively;
[0019] Then the range of [-1,1] is evenly divided into multiple intervals, and the number of pixels whose NDWI values are distributed in each interval is counted, so as to draw a histogram of the remote sensing image about the NDWI data, with the horizontal axis being the median value of each interval and the vertical axis being the number of pixels.
[0020] Furthermore, the specific implementation method of step (3) is as follows: first, the histogram is filtered by a sliding average filtering algorithm, and all local maximum points in the histogram are recorded as peak points; then, the peak points are screened, with each N interval length as a group, and only the largest peak point is retained in each group, where N is a natural number greater than 1; after screening, the highest peak point and the second highest peak point are selected from the retained peak points, which are the highest peak point and the second highest peak point visually in the histogram, and then all local minimum points between the two peak points are recorded as trough points.
[0021] Furthermore, the specific implementation method of step (4) is as follows: first, the straight line L passing through the highest peak point and the second highest peak point is calculated in the histogram; then, the distances of all trough points along the vertical axis to the straight line L are calculated, and the trough point with the largest corresponding distance is extracted, and the horizontal coordinate of the trough point in the histogram is taken as the optimal segmentation threshold of NDWI.
[0022] Furthermore, the equation of the straight line L is expressed as follows:
[0023]
[0024] Among them: (x1, y1) and (x2, y2) are the coordinates of the highest peak point and the second highest peak point in the histogram respectively, and (x, y) is the coordinates of any point on the straight line L in the histogram.
[0025] Furthermore, the distances of all trough points along the longitudinal axis to the straight line L are calculated by the following formula:
[0026]
[0027] Where: For any trough point v, (x v ,y v ) is the coordinate of the trough point v in the histogram, d v is the distance from the trough point v to the straight line L along the longitudinal axis, (x1, y1) and (x2, y2) are the coordinates of the highest peak point and the second highest peak point in the histogram respectively.
[0028] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the above-mentioned remote sensing image water body detection method based on smooth histogram morphological features.
[0029] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the remote sensing image water body detection method based on smoothed histogram morphological features is implemented.
[0030] The method of the present invention is a complete technical solution for automatic extraction of water bodies from satellite remote sensing images, including calculation of NDWI water body index, smoothing filtering of histogram, automatic determination of thresholds, and extraction of water bodies. When the water body portion in the remote sensing image accounts for a very small proportion of the entire image, and the ratio of land and water body pixels is quite different, the histogram of the image is not in a relatively obvious bimodal state; in this case, the threshold determined by the OTSU algorithm is inaccurate, and the effect of water body extraction is poor. The remote sensing water body detection method based on the morphological characteristics of the smoothed histogram of the present invention overcomes the above shortcomings to a certain extent; the water body index segmentation threshold obtained by the method of the present invention is more accurate than the threshold directly calculated by the OTSU method, and a higher precision water body extraction result can be obtained. For high-resolution four-channel satellite image data, the present invention can quickly and automatically extract water body areas in large-format images, providing technical support for different satellite usage scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic diagram of the flow of the remote sensing image water body detection method of the present invention.
[0032] Figure 2 The original remote sensing image.
[0033] Figure 3 It is the histogram of NDWI data image.
[0034] Figure 4 This is the histogram of the smoothed NDWI data image.
[0035] Figure 5 The water body area image is extracted by segmentation threshold detection determined by the method of the present invention. DETAILED DESCRIPTION
[0036] In order to describe the present invention more specifically, the technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0037] like Figure 1 As shown, the remote sensing image water body detection method based on the smoothed histogram morphological characteristics of the present invention comprises the following steps:
[0038] (1) Obtain remote sensing images of the target area and preprocess the remote sensing images; the remote sensing images include spectral information of the red band, green band, blue band and near-infrared band.
[0039] This implementation uses a Gaofen-2 satellite image as the original image. Figure 2 As shown, the image dimension is (6908×7300).
[0040] (2) Calculate the normalized water index NDWI and obtain the NDWI data of the entire image, where each data is a floating point number in the range of [-1, 1].
[0041] The formula for calculating NDWI is as follows:
[0042]
[0043] Among them: p(Green) and p(NIR) are the pixel values of each pixel in the remote sensing image in the green band and near infrared band respectively.
[0044] (3) Taking m = 0.002 as the interval interval, the NDWI data in the range of [-1, 1] is divided into n = [1-(-1)] / 0.002 = 1000 intervals, and the number of pixels in each interval is counted to obtain the interval pixel count array array1 of the NDWI data. Based on this, a histogram of the NDWI data is drawn, as shown in Figure 3 shown.
[0045] at the same time, Figure 3 The segmentation threshold td0 = 0.262215033417768 determined directly using the OTSU method is marked in Figure 3 It can be observed that the segmentation threshold td0 directly determined using the OTSU method is not located at the visually optimal position of the histogram.
[0046] (4) The interval pixel count array array1 is filtered by a sliding average filter to obtain the interval pixel count array array2 after smoothing filtering, and a histogram after smoothing is drawn based on it, as shown in FIG. Figure 4 shown.
[0047] (5) Traverse the interval pixel count array array2 and record all local maximum points in the array as histogram peaks.
[0048] (6) Filter the histogram peaks and retain only the largest peak within the 125 interval length range to prevent peaks that are too close from being selected at the same time.
[0049] (7) In the filtered histogram peak set, find the highest peak point peak1 and the second highest peak point peak2 as the visual highest peak point and the second highest peak point, where the coordinates of peak1 are (0.01, 287737) and the coordinates of peak2 are (0.632, 96757).
[0050] (8) Traverse the pixel count array array2 in the range of (0.01, 0.632) between peak1 and peak2, and record all local minimum points as the trough point V between the visual highest peak point and the second highest peak point.
[0051] (9) Draw a straight line L through the highest peak point and the second highest peak point. From the coordinates of peak1 and peak2, we can know that the analytical formula of straight line L is:
[0052]
[0053] (10) Calculate all the trough points v between two peaks in sequence i coordinate The distance d from the line L along the longitudinal axis i :
[0054]
[0055] (11) Find the distance d i The largest trough point V * :
[0056]
[0057] V * The horizontal axis value is x * As the optimal segmentation threshold for water body extraction, water body detection is performed. In this image, the valley point V with the largest distance to the straight line L * The coordinates are (0.39, 33198), so the optimal segmentation threshold is determined to be 0.39.
[0058] The segmentation threshold determined by the method of the present invention is used to detect water bodies on the image, and the following is obtained: Figure 5 The water area segmentation result shown has a classification accuracy of 90.05% and an mIoU (Mean Intersection over Union) of 93.87%.
[0059] Table 1 is a comparison of the mIoU (%) accuracy using the method of the present invention and the OTSU algorithm, logistic regression, naive Bayes classification, and support vector machine methods on three public remote sensing datasets: ESWKB, GID, and WOSD. Among them, the ESWKB dataset [LuoX, Tong X, Hu Z. An applicable and automatic method for earth surface watermapping based on multispectral images [J]. International Journal of Applied Earth Observation and Geoinformation, 2021, 103: 102472] provides 95 global Sentinel-2 satellite image data, the GID dataset [Tong XY, Xia GS, Lu Q, et al. Land-cover classification with high-resolution remote sensing images using transferable deep models [J]. Remote Sensing of Environment, 2020, 237: 111322] provides 150 high-resolution Gaofen-2 satellite images, and the WOSD dataset [Li X, Zhang G, Cui H, et al. MCANet: Ajoint semantic segmentation framework of optical and SAR images for land use classification [J]. International Journal of Applied Earth Observation andGeoinformation,2022,106:102638] provided 100 Gaofen-1 satellite image data.
[0060] Table 1
[0061]
[0062] It can be seen from Table 1 that the effect of the method of the present invention is much better than that of the OTSU algorithm, and is comparable to the effects of machine learning algorithms such as logistic regression, naive Bayes, and support vector machine, while the latter require a complex training process, while the method of the present invention does not require training.
[0063] The above description of the embodiments is to facilitate the understanding and application of the present invention by those skilled in the art. It is obvious that those skilled in the art can easily make various modifications to the above embodiments and apply the general principles described herein to other embodiments without creative work. Therefore, the present invention is not limited to the above embodiments. Improvements and modifications made by those skilled in the art to the present invention based on the disclosure of the present invention should be within the protection scope of the present invention.
Claims
1. A remote sensing image water body detection method based on smoothed histogram morphological features, comprising the following steps: (1) obtaining a remote sensing image of the target area and performing preprocessing, wherein the remote sensing image contains spectral information of a red band, a green band, a blue band, and a near-infrared band; (2) Draw a histogram of NDWI data for the preprocessed remote sensing image; (3) filtering the histogram and recording the highest peak point, the second highest peak point and all valley points between the two peak points in the histogram; (4) According to the distance from the trough point to the line connecting the highest peak point and the second highest peak point, the optimal segmentation threshold of NDWI is determined for water body detection and extraction.
2. The remote sensing image water body detection method based on smoothed histogram morphological features according to claim 1 is characterized by: The preprocessing of the remote sensing image in step (1) includes radiation calibration, atmospheric correction, and geometric correction.
3. The remote sensing image water body detection method based on smoothed histogram morphological features according to claim 1 is characterized by: The specific implementation method of step (2) is as follows: for the pre-processed remote sensing image, firstly, the NDWI value of each pixel in the remote sensing image is calculated by the following formula; Among them: for any pixel in the remote sensing image, NDWI is the NDWI value of the pixel, p(Green) and p(NIR) are the pixel values of the pixel in the green band and near infrared band respectively; Then the range of [-1,1] is evenly divided into multiple intervals, and the number of pixels whose NDWI values are distributed in each interval is counted, so as to draw a histogram of the remote sensing image about the NDWI data, with the horizontal axis being the median value of each interval and the vertical axis being the number of pixels.
4. The remote sensing image water body detection method based on smoothed histogram morphological features according to claim 1, characterized in that: The specific implementation method of the step (3) is as follows: first, the histogram is filtered by a sliding average filtering algorithm, and all local maximum points in the histogram are recorded as peak points; then, the peak points are screened, with each N interval length as a group, and only the largest peak point is retained in each group, where N is a natural number greater than 1; after the screening, the highest peak point and the second highest peak point are selected from the retained peak points, which are the highest peak point and the second highest peak point visually in the histogram, and then all local minimum points between the two peak points are recorded as trough points.
5. The remote sensing image water body detection method based on smoothed histogram morphological features according to claim 1 is characterized by: The specific implementation method of step (4) is as follows: first, the straight line L passing through the highest peak point and the second highest peak point is calculated in the histogram; then, the distances of all trough points along the vertical axis to the straight line L are calculated, and the trough point with the largest corresponding distance is extracted, and the horizontal coordinate of the trough point in the histogram is taken as the optimal segmentation threshold of NDWI.
6. The remote sensing image water body detection method based on smoothed histogram morphological features according to claim 5 is characterized by: The equation of the straight line L is as follows: Among them: (x1, y1) and (x2, y2) are the coordinates of the highest peak point and the second highest peak point in the histogram respectively, and (x, y) is the coordinates of any point on the straight line L in the histogram.
7. The remote sensing image water body detection method based on smoothed histogram morphological features according to claim 5 is characterized by: The distances of all trough points along the longitudinal axis to the straight line L are calculated using the following formula: Where: For any trough point v, (x v ,y v ) is the coordinate of the trough point v in the histogram, d v is the distance from the trough point v to the straight line L along the longitudinal axis, (x1, y1) and (x2, y2) are the coordinates of the highest peak point and the second highest peak point in the histogram respectively.
8. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: The processor is used to execute the computer program to implement the remote sensing image water body detection method based on smooth histogram morphological features as claimed in any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for detecting water bodies in remote sensing images based on smoothed histogram morphological features as claimed in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image segmentation threshold determination method and device, terminal and storage medium
CN112215856A
Optical remote sensing image large-range surface water extraction method and device
CN113177964A
Method and device for recognizing license plate number
WO2018028306A1
Cited By
Water surface contour line extraction method and device, processor and computer program product
CN121033085A