A method for water body extraction from visible light imagery
By preprocessing visible light images and calculating visible light water index values, combined with a supervised classifier, the problems of low accuracy and feature preservation in visible light image water extraction are solved, achieving high-precision water extraction and a simple operation process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA AGRICULTURAL UNIVERSITY
- Filing Date
- 2023-04-11
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, traditional visible light image water body extraction methods suffer from problems of missed extraction and incorrect extraction in terms of accuracy, and lack band information in hyperspectral images, making it difficult to effectively extract the geometric feature information of water bodies.
The visible light water index (VWI) is calculated by preprocessing, band operation, band merging, and floating-point processing of visible light images. A supervised classifier is used to extract water bodies, and the formula VWI=0.5R-2G is used to distinguish water bodies from other land features. Accuracy calculation is performed by combining manual visual interpretation and field surveys.
It improves the accuracy of water body extraction from visible light images, better preserves the geometric features of water bodies, simplifies the operation process, is applicable to a variety of visible light image application scenarios, and reduces research costs and time.
Smart Images

Figure CN116452978B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visible light image information extraction technology, and in particular to a method for extracting water bodies from visible light images. Background Technology
[0002] Water bodies are an important component of the Earth's ecological environment, significantly impacting the environment and people's lives and livelihoods. Monitoring water body distribution helps understand the differences in water resource distribution across regions and changes in river and lake water levels. Traditional large-scale water body monitoring primarily relies on manual field surveys, which are time-consuming, costly, and unable to monitor the dynamic distribution and changes of water bodies. However, with the development of remote sensing technology, it has become possible to study water body distribution characteristics through remote sensing imagery. Water bodies in remote sensing images provide researchers with a crucial information foundation for water body studies, and extracting water body data from remote sensing images can help researchers conduct more effective research.
[0003] Traditional methods for extracting water bodies from remote sensing images rely on manual visual interpretation. With technological advancements, these methods have gradually shifted to automated approaches such as the threshold method and supervised classification. While these methods effectively extract water bodies from remote sensing images, they require hyperspectral imagery, which is often difficult to obtain due to security concerns or high cost, and requires preprocessing, hindering research. With the rise of online platforms like Google Earth, Baidu Maps, and Tianditu, visible light remote sensing imagery (based solely on the red, green, and blue visible light bands) has become relatively easier to acquire. Although visible light imagery offers advantages such as ease of acquisition and higher resolution than some traditional hyperspectral satellite remote sensing imagery (e.g., Landsat series satellites), it lacks some band information found in hyperspectral imagery. Current water extraction methods for visible light imagery have lower accuracy, easily leading to missed or incorrect extractions, making the results difficult to apply to water body research. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of existing technologies, specifically addressing the lack of near-infrared (NIR), thermal infrared (TIR), and short-wave infrared (SWIR) bands in hyperspectral images that are highly sensitive to water bodies. This invention solves the problems encountered by traditional water extraction methods in visible light images, such as low accuracy, susceptibility to missed or incorrect extractions, and difficulty in completely preserving the geometric features of water bodies. This invention provides a water extraction method for visible light images. By performing a series of processing steps on the visible light images and constructing indices for extracting water bodies, it highlights the differences between water bodies and other land features in the visible light images, improving the accuracy of water body extraction. Furthermore, it is easy to operate and adaptable to various application scenarios for water extraction from visible light images, including color photographs, UAV images, and visible light satellite images, facilitating water body research and possessing high application value.
[0005] This invention provides a method for water body extraction from visible light images, the method comprising:
[0006] Acquire a visible light image and preprocess the visible light image to obtain a preprocessed visible light image;
[0007] Band calculations are performed on the preprocessed visible light image to obtain the visible light water index value;
[0008] The visible light water body index value is assigned to the visible light image by band merging and floating point processing to obtain a visible light image containing the visible light water body index value.
[0009] Supervised classification is performed on the visible light image containing the visible light water body index value, water bodies are extracted from the visible light image containing the visible light water body index value, and the accuracy of the extraction results is calculated.
[0010] Furthermore, the preprocessing of the visible light image to obtain a preprocessed visible light image includes:
[0011] The acquired visible light image is geometrically corrected to obtain a geometrically corrected visible light image.
[0012] The geometrically corrected visible light image is cropped to obtain a cropped visible light image.
[0013] The visible light image after image cropping is mosaicked to obtain a preprocessed visible light image.
[0014] Furthermore, the step of performing band calculations on the preprocessed visible light image to obtain the visible light water index value includes:
[0015] The reflectance values of water bodies and other land features in the preprocessed visible light image are statistically analyzed in the red, green, and blue bands to determine the bands with the greatest and least difference. The reflectance values of both bands are multiplied by a weight, and the reflectance value of the band with the greatest difference is subtracted from the weighted reflectance value of the band with the least difference to calculate the Visible Water Index (VWI). The calculation formula is as follows:
[0016] VWI = 0.5R-2G
[0017] In the formula, VWI represents the visible light water index value, R represents the reflectance value of the red band in the preprocessed visible light image, and G represents the reflectance value of the green band in the preprocessed visible light image.
[0018] Furthermore, the step of assigning the visible light water index value to the visible light image through band combining and floating-point processing to obtain a visible light image containing the visible light water index value includes:
[0019] The visible light water index values are exported to obtain a raster layer of the visible light water index values.
[0020] The raster layer of the visible light water index value is used as the 4th band and incorporated into the preprocessed visible light image to obtain the visible light image after band merging.
[0021] The four band values of the visible light image after band merging are converted into floating-point values and exported as a floating-point-processed visible light image.
[0022] Furthermore, the supervised classification of the visible light image containing the visible light water index value, the extraction of water bodies from the visible light image containing the visible light water index value, and the accuracy calculation of the extraction results include:
[0023] Training and test sample areas are selected from the visible light images containing visible light water index values to obtain training sample area images and test sample area images.
[0024] The training sample area images and test sample area images are processed by combining manual visual interpretation and field survey to obtain the labels of the training sample area images and the test sample area images.
[0025] The labels of the training sample area images are imported into the supervised classifier, and the working parameters of the supervised classifier are set for supervised training.
[0026] After training, a supervised classifier for extracting water bodies from visible light images is exported.
[0027] The visible light image containing the visible light water body index value is input into the supervised classifier used to extract water bodies in the visible light image, and the water bodies in the visible light image containing the visible light water body index value are output to obtain the extraction result;
[0028] Calculate the classification accuracy of the extracted results.
[0029] Furthermore, the calculation of the classification accuracy of the extraction result includes:
[0030] The extraction results are compared with the labels of the test sample area images to obtain a confusion matrix;
[0031] The overall precision, kappa coefficient, precision, recall, and landscape pattern precision of the extraction results are calculated using the confusion matrix, and a precision analysis is performed on the extraction results.
[0032] This invention preprocesses the acquired visible light images to facilitate their application in research. Band operations are performed on the preprocessed visible light images, calculating a water body extraction index. The difference between the reflectance of the red band (0.5 times) and the green band (2 times) is used to distinguish water bodies from other land features. In the calculated water body index, water bodies have the highest value, while other land features have lower values, thus highlighting water bodies and achieving higher extraction accuracy. This also allows the extracted water bodies to retain their geometric features to a greater extent, making the results applicable to practical research. Finally, the visible light water body index is assigned to the visible light image through band merging and floating-point processing. This method obtains visible light images containing visible light water body index values, enabling subsequent supervised classifiers to obtain more classification criteria from the visible light images, improving extraction accuracy. Simultaneously, it converts the four band values in the visible light image into floating-point values of the same type, preventing errors in the supervised classifier's operation. Applying a supervised classifier for water body extraction from visible light images eliminates the need for specific values for specific research areas, demonstrating significant versatility. Accuracy analysis of the extraction results from the supervised classifier for water body extraction from visible light images effectively assesses the precision of water body extraction. Based on ease of operation, a unified band calculation formula is proposed, adaptable to various application scenarios for water body extraction from visible light images, facilitating water body research and demonstrating high application value. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a flowchart of a water extraction method for visible light images according to an embodiment of the present invention;
[0035] Figure 2 This is a flowchart of the visible light image preprocessing in an embodiment of the present invention;
[0036] Figure 3 This is a flowchart illustrating how the visible light water index value is assigned to the visible light image through band merging and floating-point processing in an embodiment of the present invention.
[0037] Figure 4 This is a flowchart of water body extraction using a supervised classifier in an embodiment of the present invention;
[0038] Figure 5 This is a schematic diagram of the water extraction area in an embodiment of the present invention;
[0039] Figure 6 This is a schematic diagram of the extraction results of water body extraction using visible light images in an embodiment of the present invention;
[0040] Figure 7 This is a schematic diagram of the extraction results of water body extraction using the visible light water index in an embodiment of the present invention. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] In this invention, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, portions or combinations thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, figures, steps, behaviors, components, portions or combinations thereof are present or added.
[0043] It should also be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0044] This invention relates to a method for extracting water bodies from visible light images. The method includes: acquiring a visible light image and preprocessing the visible light image to obtain a preprocessed visible light image; performing band operations on the preprocessed visible light image to obtain a visible light water body index value; assigning the visible light water body index value to the visible light image through band merging and floating-point processing to obtain a visible light image containing the visible light water body index value; performing supervised classification on the visible light image containing the visible light water body index value; extracting water bodies from the visible light image containing the visible light water body index value; and calculating the accuracy of the extraction results.
[0045] Existing technical solutions include collecting visible light images taken by drones, segmenting them, and using the differential vegetation index method to extract initial water bodies from the segmentation results. Based on the average value and standard deviation of the blue band in the visible light images, the final water body is extracted from the initial water body. This method requires the use of equipment such as drones and on-site investigations, which increases the time and money costs of research. Moreover, the index used is only the visible light differential vegetation index, lacking a water body index based solely on the three visible light bands (R, G, B).
[0046] It also includes: collecting satellite remote sensing images; constructing an expression for a water body index based on the spectral reflectance characteristics of land features in the area under study; acquiring a reflectance remote sensing image of the area under study; and determining a remote sensing water body index map based on the reflectance remote sensing image and the expression for the water body index; and extracting water body regions from the remote sensing water body index map based on the remote sensing water body index map and the reflectance remote sensing image. The formula for the water body index is as follows:
[0047]
[0048] In the formula, RWI represents the water index, G represents the reflectance in the green band, NIR represents the reflectance in the near-infrared band, R represents the reflectance in the red band, a represents the reflectance adjustment coefficient in the green band, b represents the reflectance adjustment coefficient in the near-infrared band, and c represents the reflectance adjustment coefficient in the red band. The reflectance adjustment coefficients a, b, and c must be determined based on the specific spectral image of the study area. This method uses hyperspectral satellite imagery, which requires specialized equipment for data processing, increasing financial and technical costs. Furthermore, it uses traditional hyperspectral imagery, and the constructed index is a water index based on the visible and near-infrared bands, lacking a water index based solely on the three visible bands (R, G, and B).
[0049] Both of the above-mentioned technical solutions use the threshold method for water body extraction, which requires repeated trials and judgments based on the researcher's experience, and has a certain degree of subjectivity. Furthermore, specific extraction thresholds and indices need to be set according to the specific research area, and the collected images need to be segmented and processed, making the operation relatively cumbersome, increasing the workload of the research, and making it inconvenient to carry out the research.
[0050] To address the problems existing in the above-mentioned prior art solutions, the present invention provides a method for water body extraction from visible light images. This method can effectively distinguish water bodies from other land features in visible light images, thereby improving the accuracy of water body extraction from visible light images. It is also applicable to various types of visible light remote sensing images, making water body extraction simple and convenient, and has wide application value.
[0051] In one optional implementation of this embodiment, such as Figure 1 As shown, Figure 1 A flowchart of a water extraction method for visible light images according to an embodiment of the present invention is shown, including the following steps:
[0052] S101. Acquire a visible light image and preprocess the visible light image to obtain a preprocessed visible light image.
[0053] In one optional implementation of this embodiment, visible light images are mainly acquired through Google Earth, Baidu Maps, and Tianditu.
[0054] In an optional implementation of this embodiment, the visible light image is preprocessed using ENVI software.
[0055] Specifically, the ENVI software (The Environment for Visualizing Images) is a complete remote sensing image processing platform. It is currently a leading software solution for quickly, conveniently, and accurately extracting information from images, and is widely used in scientific research, environmental protection, meteorology, oil and mineral exploration, agriculture, forestry, medicine, national defense and security, earth science, public utility management, remote sensing engineering, water conservancy, oceanography, surveying and mapping, and urban and regional planning. In this embodiment, it is used to preprocess the acquired visible light images.
[0056] In one optional implementation of this embodiment, such as Figure 2 As shown, Figure 2 A flowchart illustrating the preprocessing of visible light images according to an embodiment of the present invention is shown, including the following steps:
[0057] S201. Perform geometric correction processing on the acquired visible light image to obtain a geometrically corrected visible light image.
[0058] In an optional implementation of this embodiment, the geometric correction process refers to eliminating geometric deformations in the visible light image, eliminating internal distortions in the visible light image, and realizing geometric integration of the visible light image and the standard map image.
[0059] S202. Perform image cropping on the geometrically corrected visible light image to obtain a cropped visible light image.
[0060] In one optional implementation of this embodiment, the image cropping process refers to reasonably cropping the size of the geometrically corrected visible light image to meet the standards for water body research.
[0061] S203. Perform image mosaicking on the visible light image after image cropping to obtain a preprocessed visible light image.
[0062] In an optional implementation of this embodiment, the image mosaicking process refers to extracting the beneficial information from the multi-source channels of the visible light image after image cropping to the maximum extent, and synthesizing a high-quality visible light image.
[0063] Visible light imagery was chosen here because it offers the advantage of simpler preprocessing compared to traditional hyperspectral imagery. It eliminates the need for radiometric calibration and atmospheric correction required by traditional hyperspectral imagery, requiring only simple geometric correction, image cropping, and image mosaicking before it can be used in the research. Preprocessing visible light imagery improves the utilization of image information, enhances interpretation accuracy and reliability, and increases the spatial and spectral resolution, facilitating subsequent water body extraction and enabling water body research.
[0064] S102. Perform band calculations on the preprocessed visible light image to obtain the visible light water index value;
[0065] In one optional implementation of this embodiment, the reflectance values of water bodies and other land features in the preprocessed visible light image are statistically analyzed in the red, green, and blue bands to obtain the bands with the greatest and least differences. The reflectance values of the bands with the greatest and least differences are multiplied by a weight, and the reflectance value of the band with the greatest difference is subtracted from the reflectance value of the band with the least difference to calculate the visible light water index value (VWI). The calculation formula includes:
[0066] VWI = 0.5R-2G
[0067] In the formula, VWI represents the visible light water index value, R represents the reflectance value of the red band in the preprocessed visible light image, and G represents the reflectance value of the green band in the preprocessed visible light image.
[0068] Specifically, current traditional water body indices are generally based on the visible-near infrared, thermal infrared, and shortwave infrared bands. However, visible light imagery lacks these bands, making it impossible to use traditional water body indices for water body extraction. This scheme samples, statistically analyzes, observes, and summarizes the reflectance distribution patterns of water bodies and other land features in visible light imagery across the R, G, and B bands (corresponding to the red, green, and blue bands of pixels in the visible light imagery), deriving reflectance values and proposing a visible-band water index (VWI) suitable for extracting water bodies from visible light imagery. By adjusting the multipliers of each band value and subtracting them, the scheme highlights the differences in pixel values between water bodies and other land features in the image, thereby improving the accuracy of subsequent supervised classifiers in extracting water bodies from visible light imagery. The visible-band water index can suppress other land feature information in visible light imagery while enhancing water body information, enabling the supervised classifier to extract water bodies from visible light imagery more accurately and preserve the geometric features of water bodies to a certain extent.
[0069] Specifically, by establishing sampling points for various land features in visible light images, collecting and analyzing the values of each band at these sampling points, it was found that water bodies exhibit low reflectance compared to other land features in both the red and green bands, while this characteristic is not obvious in the blue band. Therefore, the reflectance value of the blue band was excluded when designing the water body index value applicable to visible light. In addition, the reflectance of other land features that are prone to mixing with water bodies is lower in the red band than in the green band. Therefore, utilizing this characteristic, the coefficient of the red band reflectance in the water body index value was reduced, while the coefficient of the green band reflectance was increased, thus deriving the calculation formula for the water body index value applicable to visible light.
[0070] Furthermore, in this embodiment, the difference between the reflectance value of 0.5 times that of the red band and the reflectance value of 2 times that of the green band is used to highlight the difference between water bodies and other land features in the visible light image. In the calculation results of the water body extraction index of the visible light image, water bodies have the highest value and other land features have lower values, thereby highlighting the water body and enabling the subsequent water body extraction results to achieve higher extraction accuracy. The extracted water bodies can also retain their geometric features to a greater extent, allowing the extraction results to be applied to practical research to a certain extent.
[0071] S103. The visible light water body index value is assigned to the visible light image by band merging and floating point processing to obtain a visible light image containing the visible light water body index value.
[0072] In one optional implementation of this embodiment, such as Figure 3 As shown, Figure 3 This invention illustrates a flowchart of assigning the visible light water index value to the visible light image through band combining and floating-point processing, comprising the following steps:
[0073] S301. Export the visible light water index values to obtain a raster layer of the visible light water index values.
[0074] Specifically, the visible light water index (VWI) values are exported to obtain a raster layer of the visible light water index values.
[0075] S302. The raster layer of the visible light water index value is used as the 4th band and incorporated into the preprocessed visible light image to obtain the visible light image after band merging.
[0076] In an optional implementation of this embodiment, the raster layer of the visible light water index value is incorporated into the preprocessed visible light image to obtain a visible light image after band merging processing.
[0077] Specifically, the raster layer of the visible light water index value is added to the preprocessed visible light image as a new band, that is, a fourth band in addition to the red, green and blue bands. This makes the visible light image after band merging processing become a raster layer with four bands (the other three bands are red, green and blue) similar to a traditional hyperspectral image.
[0078] Band merging is performed here so that the subsequent supervised classifier can obtain more classification information from the visible light image, thereby improving the extraction accuracy.
[0079] S303. Convert the four band values of the visible light image after band merging into floating-point values and export them as a floating-point processed visible light image.
[0080] In an optional implementation of this embodiment, the band values of the four bands in the visible light image after band merging are converted into floating-point values and then re-exported as a floating-point-processed visible light image.
[0081] Specifically, in step S102, band operations are performed on the preprocessed visible light image. The results of the band operations are floating-point values, while the reflectance values of the red, green, and blue bands in the original visible light image are all integer data. If the visible light image after band merging is directly applied to the training of the supervised classifier, it will cause an error. Therefore, it is necessary to convert the band values of the four bands in the visible light image after band merging into floating-point values and re-export it as a floating-point processed visible light image to avoid errors in the subsequent operation of the supervised classifier.
[0082] S104. Supervised classification is performed on the visible light image containing the visible light water body index value, water bodies are extracted from the visible light image containing the visible light water body index value, and the accuracy of the extraction results is calculated.
[0083] In one optional implementation of this embodiment, such as Figure 4 As shown, Figure 4 The flowchart illustrating the application of a supervised classifier for water body extraction in an embodiment of the present invention is shown, including the following steps:
[0084] S401. Select training sample area and test sample area from the visible light image containing the visible light water index value to obtain training sample area image and test sample area image.
[0085] In an optional implementation of this embodiment, training and testing sample areas are randomly selected proportionally from the visible light image containing the visible light water index value obtained in step S103.
[0086] S402. Combine manual visual interpretation and field survey to process the training sample area images and test sample area images to obtain the labels of the training sample area images and the test sample area images.
[0087] In one optional implementation of this embodiment, the labels of the training sample area images and the labels of the test sample area images are obtained through manual visual interpretation and field surveys.
[0088] S403. Import the labels of the training sample area images into the supervised classifier, and set the working parameters of the supervised classifier for supervised training.
[0089] Specifically, the labels of the training sample area images are imported into the supervised classifier after initialization, relevant working parameters are set, and the supervised classifier is trained.
[0090] Specifically, Supervised Classification, also known as the training site method or training classification method, is a technique that classifies images based on establishing a statistical recognition function and training with typical samples. It involves selecting feature parameters from samples provided by a known training area, calculating these feature parameters as decision rules, and establishing a discriminant function to classify images. It is a method of pattern recognition. The training area must be typical and representative. If the discriminant criterion meets the classification accuracy requirements, then the criterion is valid; otherwise, the classification decision rules need to be re-established until the classification accuracy requirements are met.
[0091] S404. After training, export the supervised classifier used to extract water bodies from visible light images;
[0092] In an optional implementation of this embodiment, after training is completed in step S403, a supervised classifier for extracting water bodies from visible light images is exported.
[0093] This application uses a supervised classifier for extracting water bodies from visible light images. It does not require specific values for a particular study area and has great versatility.
[0094] S405. Input the visible light image containing the visible light water body index value into the supervised classifier used to extract water bodies in the visible light image, and output the water bodies in the visible light image containing the visible light water body index value to obtain the extraction result;
[0095] In an optional implementation of this embodiment, the visible light image containing the visible light water body index value is input into the supervised classifier for extracting water bodies in the visible light image exported in step S404, and the extraction result of the water bodies in the visible light image containing the visible light water body index value is output.
[0096] S406. Calculate the classification accuracy of the extracted results.
[0097] In an optional implementation of this embodiment, the extraction results are compared with the labels of the test sample area images to obtain a confusion matrix; the overall precision, kappa coefficient, precision, recall, and landscape pattern precision of the extraction results are calculated using the confusion matrix, and a precision analysis is performed on the extraction results.
[0098] Specifically, accuracy analysis is performed using the overall accuracy (OA), and the calculation formula includes:
[0099]
[0100] In the formula, OA represents the ratio of the number of correct labels extracted by the method to the total number of labels in the test sample area image; TP is the true class in the confusion matrix, indicating that the label of the test sample area image is positive and the method extraction result is also positive; TN is the true negative class in the confusion matrix, indicating that the label of the test sample area image is negative and the method extraction result is also negative; FP is the false positive class in the confusion matrix, indicating that the label of the test sample area image is negative, but the method extraction result is positive; FN is the false negative class in the confusion matrix, indicating that the label of the test sample area image is positive, but the method extraction result is negative.
[0101] Furthermore, the kappa coefficient is used for accuracy analysis.
[0102] Specifically, the kappa coefficient is used for consistency testing and is an indicator of classification accuracy. Its calculation is based on the confusion matrix, and the formula is as follows:
[0103]
[0104] In the formula, p o This represents the overall precision, and its value is the overall precision OA; p e The formula for calculating the true class of the labels in the test sample area image multiplied by the sum of the extraction results by the method, divided by the square of the number of labels in the test sample area image, is as follows:
[0105]
[0106] The kappa coefficient is calculated to be between -1 and 1, usually falling between 0 and 1. It can be divided into five groups to represent different levels of consistency: 0.0 to 0.20 very low consistency (slight), 0.21 to 0.40 fair consistency (fair), 0.41 to 0.60 moderate consistency (moderate), 0.61 to 0.80 substantial consistency (substantial), and 0.81 to 1 almost perfect consistency (almost perfect).
[0107] Furthermore, precision analysis is performed using precision, recall, and F1 score.
[0108] Specifically, precision represents the percentage of positive results extracted by the method; recall represents the proportion of positive results extracted by the method among the positive categories of labels in the test sample area image; the F1 score combines the results of precision and recall. The calculation formula includes:
[0109]
[0110]
[0111]
[0112] In the formula, TP is the true class in the confusion matrix, indicating that the label of the test sample area image is positive and the method extraction result is also positive; TN is the true negative class in the confusion matrix, indicating that the label of the test sample area image is negative and the method extraction result is also negative; FP is the false positive class in the confusion matrix, indicating that the label of the test sample area image is negative, but the method extraction result is positive; FN is the false negative class in the confusion matrix, indicating that the label of the test sample area image is positive, but the method extraction result is negative.
[0113] It should be noted that precision, recall, and F1 score range from 0 to 1, where 0 represents the worst precision and 1 represents the best precision.
[0114] Furthermore, accuracy analysis is performed using Landscape Pattern Precision (LPA).
[0115] Specifically, in landscape pattern analysis, the number, perimeter, and area of patches (referring to water bodies in this embodiment of the invention) are basic calculation parameters. Therefore, in this embodiment of the invention, the accuracy of the extracted results in landscape pattern analysis is assessed through landscape pattern precision considerations. The calculation formula includes:
[0116]
[0117] In the formula, L p L represents the number of labels, perimeter, or area of the tested sample area image. p 'Indicates the quantity, perimeter, or area of the water body extracted by the method.
[0118] It should be noted that the LAP value ranges from 0 to 1, and the larger the value, the higher the accuracy of the landscape pattern.
[0119] Here, the extraction results of the supervised classifier used to extract water bodies from visible light images are analyzed for accuracy, which can effectively determine the accuracy of water body extraction.
[0120] In one optional implementation of this embodiment, such as Figure 5 , Figure 6 and Figure 7 As shown, Figure 5 This diagram illustrates an image of the water extraction area in an embodiment of the present invention. Figure 6 This diagram illustrates the extraction results of water extraction using visible light images directly in an embodiment of the present invention. Figure 7 This diagram illustrates the extraction results of water body extraction using the visible light water index in an embodiment of the present invention.
[0121] Specifically, Figure 5This is a visible light image of the area where water extraction is needed. If water extraction is performed directly using this image, the following results will be obtained: Figure 6 If the water extraction is performed using the method provided in the embodiments of the present invention, the following results can be obtained: Figure 7 Through the Figure 6 and Figure 7 Through observation and comparison, we can find that Figure 5 Some of the buildings, roads, and fields on the right side of the middle section are... Figure 6 The middle failed to identify accurately, while Figure 7 The middle part achieves accurate identification. Figure 5 The water body in the middle, in contrast Figure 6 and Figure 7 It can be seen that the water extraction using the method provided in the embodiments of the present invention has higher precision.
[0122] In summary, this invention provides a method for water body extraction from visible light images. By preprocessing the acquired visible light images to facilitate their application in research, and performing band operations on the preprocessed images, a water body extraction index is calculated. The difference between the reflectance value of the red band (0.5 times) and the reflectance value of the green band (2 times) is used to distinguish water bodies from other land features in the visible light image. In the calculated visible light water body index, water bodies have the highest value, while other land features have lower values, thus highlighting water bodies and achieving higher extraction accuracy. This allows the extracted water bodies to retain their geometric features to a greater extent, making the extraction results applicable to practical research. The method further involves band merging and floating-point processing to extract the water body from the visible light image. The water body index value is assigned to the visible light image, resulting in a visible light image containing the visible light water body index value. This allows the subsequent supervised classifier to obtain more classification criteria from the visible light image, improving extraction accuracy. Simultaneously, it converts the four band values in the visible light image into floating-point values of the same type, preventing errors in the supervised classifier's operation. Applying the supervised classifier for water extraction from visible light images eliminates the need for specific values for specific research areas, demonstrating significant versatility. Accuracy analysis of the extraction results from the supervised classifier for water extraction from visible light images effectively assesses the precision of water extraction. Based on ease of operation, a unified band calculation formula is proposed, adaptable to various application scenarios for water extraction from visible light images, facilitating water research and demonstrating high application value.
[0123] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0124] Furthermore, the embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for extracting water bodies from visible light images, characterized in that, The method includes: Acquire a visible light image and preprocess the visible light image to obtain a preprocessed visible light image; Band calculations are performed on the preprocessed visible light image to obtain the visible light water index value; The step of performing band calculations on the preprocessed visible light image to obtain the visible light water index value includes: The reflectance values of water bodies and other land features in the preprocessed visible light image are statistically analyzed in the red, green, and blue bands to determine the bands with the greatest and least difference. The reflectance values of both bands are multiplied by a weight, and the reflectance value of the band with the greatest difference is subtracted from the weighted reflectance value of the band with the least difference to calculate the Visible Water Index (VWI). The calculation formula is as follows: , In the formula, VWI represents the visible light water index value, R represents the reflectance value of the red band in the preprocessed visible light image, and G represents the reflectance value of the green band in the preprocessed visible light image. The visible light water body index value is assigned to the visible light image by band merging and floating point processing to obtain a visible light image containing the visible light water body index value. The step of assigning the visible light water index value to the visible light image through band merging and floating-point processing to obtain a visible light image containing the visible light water index value includes: exporting the visible light water index value data to obtain a raster layer of the visible light water index value; incorporating the raster layer of the visible light water index value as the fourth band into the preprocessed visible light image to obtain a visible light image after band merging; converting the four band values of the visible light image after band merging into floating-point values and exporting them as a visible light image after floating-point processing. Supervised classification is performed on the visible light image containing the visible light water body index value, water bodies are extracted from the visible light image containing the visible light water body index value, and the accuracy of the extraction results is calculated.
2. The method for water body extraction from visible light imagery of claim 1, wherein, The preprocessing of the visible light image to obtain a preprocessed visible light image includes: The acquired visible light image is geometrically corrected to obtain a geometrically corrected visible light image. The geometrically corrected visible light image is cropped to obtain a cropped visible light image. The visible light image after image cropping is mosaicked to obtain a preprocessed visible light image.
3. The water extraction method for visible light images as described in claim 1, characterized in that, The supervised classification of the visible light image containing the visible light water body index value, the extraction of water bodies from the visible light image containing the visible light water body index value, and the accuracy calculation of the extraction results include: Training and test sample areas are selected from the visible light images containing visible light water index values to obtain training sample area images and test sample area images. The training sample area images and test sample area images are processed by combining manual visual interpretation and field survey to obtain the labels of the training sample area images and the test sample area images. The labels of the training sample area images are imported into the supervised classifier, and the working parameters of the supervised classifier are set for supervised training. After training, a supervised classifier for extracting water bodies from visible light images is exported. The visible light image containing the visible light water body index value is input into the supervised classifier used to extract water bodies in the visible light image, and the water bodies in the visible light image containing the visible light water body index value are output to obtain the extraction result; Calculate the classification accuracy of the extracted results.
4. The water extraction method for visible light images as described in claim 3, characterized in that, The calculation of the classification accuracy of the extracted results includes: The extraction results are compared with the labels of the test sample area images to obtain a confusion matrix; The overall precision, kappa coefficient, precision, recall, and landscape pattern precision of the extraction results are calculated using the confusion matrix, and a precision analysis is performed on the extraction results.