A shore line fitting method based on an optimized douglas-peucker algorithm
By improving the Douglas-Puk algorithm with particle swarm optimization and convolutional neural networks, the problems of loss of key terrain features and manual intervention in shoreline fitting are solved, realizing automated and efficient and accurate calculation of shoreline fitting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HOHAI UNIV
- Filing Date
- 2025-05-29
- Publication Date
- 2026-06-26
AI Technical Summary
The existing Douglas-Puk algorithm suffers from the problems of losing key terrain features and relying on human intervention in shoreline fitting, resulting in inaccurate fitting results and low efficiency.
The threshold selection mechanism of the Douglas-Puk algorithm is optimized by using particle swarm optimization, and the shoreline pixel points are identified by combining convolutional neural network. The shoreline fitting process is automated by block processing and key feature density adjustment, avoiding manual intervention.
It automates and improves the accuracy of shoreline fitting results, avoids the subjective influence of human intervention, and improves computational efficiency and the accuracy of fitting results.
Smart Images

Figure CN120673204B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of shoreline fitting algorithm technology, specifically relating to a shoreline fitting method based on an optimized Douglas-Puk algorithm. Background Technology
[0002] Shorelines are the boundaries between water bodies such as rivers, lakes, and oceans and land, serving as transitional zones. As a crucial geographical feature, shoreline determination plays a vital role in marine resource management, environmental monitoring, and disaster early warning. With the development of high-precision remote sensing and geographic information systems (GIS), the amount of raw shoreline data obtained during shoreline measurements has increased exponentially. However, much of this raw data is meaningless for practical applications or analytical research, becoming redundant and wasting storage and computational resources. Furthermore, in numerical studies of water flow changes, water bodies with irregularly shaped shorelines often use unstructured grids. Overly complex shoreline shapes can significantly increase the number of grids in the water body, leading to excessively long computation times, or drastically reduce the orthogonality of grids near the shoreline, causing grid distortion and computational failure.
[0003] Various shoreline processing methods have been developed to remove redundant parts from the original shoreline data, with the Douglas-Peucker algorithm being one of the most widely used. The core idea of this algorithm is to recursively divide the polyline into two segments, and then remove points whose deviation from the straight line is less than the threshold, thereby simplifying the polyline and achieving a balance between data compression and shape preservation. As a classic line feature simplification algorithm, the Douglas-Peucker algorithm is widely used in curve fitting calculations due to its mathematical simplicity and high efficiency in data processing, especially in cases requiring curve interpolation. However, the classic Douglas-Peucker algorithm also has certain limitations in shoreline processing. When fitting shorelines, a fixed threshold may cause the final result to be sensitive to complex shoreline shape changes, resulting in the loss of key topographic features such as estuaries and headlands. Other traditional shoreline processing methods also rely heavily on manual intervention or simple geometric rules during the processing. These methods often suffer from problems such as the fitting results being greatly affected by subjectivity, low fitting efficiency, and difficulty in guaranteeing the accuracy of the fitting results.
[0004] Researchers in the field of shoreline fitting algorithms have made numerous improvements to the Douglas-Puk algorithm to avoid the loss of key topographic features in the fitting results. For example, Chinese patent application number 202411002029.3, entitled "A Data Fusion Method and System for Nautical and Land Maps," proposes a method to derive the final fitting result by combining the characteristics of data point distribution density, shoreline smoothness, and fitting distance within a local area. This method highlights key topographic features such as estuaries and headlands by increasing the correlation between data points within a certain range, thereby avoiding the loss of these features. However, the selection of data points and the determination of the correlation range still rely on manual intervention, and the final result is still prone to variations depending on the individual. How to improve the Douglas-Puk algorithm so that it can both avoid losing key features during the fitting calculation process and eliminate the need for manual intervention is a current research focus. Summary of the Invention
[0005] This invention aims to propose an improved Douglas-Puk algorithm, which optimizes the threshold selection mechanism of the traditional Douglas-Puk algorithm through particle swarm optimization, so that important features in the shoreline are preserved in the fitting calculation process, while improving the automation of shoreline fitting calculation and avoiding interference from human intervention in the fitting results.
[0006] The technical solution adopted in this invention is as follows:
[0007] A shoreline fitting method based on an optimized Douglas-Puk algorithm specifically includes the following steps:
[0008] Step 1. Obtain publicly available satellite image data of the area where the coastline to be fitted is located, as the raw data for coastline fitting, and preprocess the raw data;
[0009] Step 2. Identify the pixels in the original data image, determine whether each pixel corresponds to water or land, filter out the pixels that are superimposed on water and land, and record them as shoreline pixels. All shoreline pixels together constitute the original shoreline.
[0010] Step 3. Divide the original shoreline into multiple segments using a block-based method. The specific steps are as follows:
[0011] Step 3.1. Identify all key topographic features in the original shoreline by morphological characteristics, and then divide the original shoreline into segments. Each segment is taken as an original block, and each original block contains one of the key topographic features. Each original block corresponds to a unique number.
[0012] Step 3.2. Calculate the key feature density for each original block and set a density threshold, where the key feature density is the ratio of the number of key terrain features in a block to the length of the shoreline in that block;
[0013] The key feature density of each original block is compared with the density threshold in numerical order. If the key feature density of two blocks is less than the density threshold and the numbers are consecutive, the two blocks are merged. After all blocks have been compared and merged, a new block sequence is formed. The new block sequence is recorded as the first block sequence and the blocks in it are renumbered. The comparison and merging process is repeated to form the second block sequence. This process is repeated until there are no more blocks to merge in the sequence. The last sequence obtained after comparison and merging is recorded as the final block sequence.
[0014] Step 4. Use the Douglas-Puk algorithm to fit the shoreline in each block of the final block sequence. The threshold in the algorithm is different when fitting different blocks. Use the particle swarm optimization algorithm to generate multiple values as candidate solutions for the threshold of each block.
[0015] Step 5. Use each candidate solution as the threshold in the Douglas-Puk algorithm, use the pixels in the original shoreline as the data points in the Douglas-Puk algorithm, and then use the Douglas-Puk algorithm to obtain the corresponding fitting result. Compare the degree of consistency between the obtained fitting result and the original shoreline, and record each candidate solution and its corresponding degree of consistency.
[0016] Step 6. Find the candidate solution with the highest matching degree in each block as the final threshold of the Douglas-Puk algorithm, and take the fitting result corresponding to the final threshold as the final fitting result. Then, combine the final fitting results of all blocks according to the block number order to obtain the final shoreline.
[0017] In existing technologies, shoreline synthesis using the Douglas-Puk algorithm often involves manually selecting points from the original shoreline as data points for fitting. This manual process also involves segmenting the original shoreline and selecting the Douglas-Puk algorithm threshold. This approach makes it difficult to ensure that the fitting result fully reflects the important features of the shoreline, and the result is also significantly influenced by human subjectivity. In the method of this invention, the data points used for fitting are the pixels that constitute the original shoreline; the terrain complexity of each segment is measured by the density of key features, and adjustments are made to the segmentation based on this. The Douglas-Puk algorithm threshold is obtained through an optimization algorithm. Thus, the selection of data points for fitting, the segmentation of the original shoreline, and the determination of the Douglas-Puk algorithm threshold all follow fixed rules, avoiding the interference caused by the randomness of manual selection and human subjectivity.
[0018] Step 3 first divides the shoreline into blocks based on the terrain feature identification results, ensuring that each block contains only one key terrain feature. The boundary between two adjacent blocks is a randomly selected point on the shoreline between the two key terrain features. Then, the key point density of each block determines whether it can be merged with adjacent blocks, achieving a balanced combination of key terrain features and relatively straight shorelines within each block. If a block contains only one very large key terrain feature, it cannot be fitted using the Douglas-Puk algorithm. However, such blocks will inevitably have a low key point density. Considering that in reality, a large key terrain feature is usually surrounded by other large key terrain features (e.g., a large estuary often doesn't have a large headland), merging adjacent blocks with low key point densities can achieve a combination of large key terrain features and relatively straight shorelines. It is important to emphasize that adjacent blocks must be merged to prevent protruding parts in the water, such as reefs, from interfering with shoreline fitting. Depending on the accuracy requirements, for applications requiring lower accuracy, the system can be set to merge when the density of key points in two adjacent blocks is less than 0.5 per km. For applications requiring higher accuracy, the system can be set to merge when the density of key points in two adjacent blocks is less than 0.2 per km.
[0019] Further optimization involves the following specific steps for raw data searching and preprocessing in Step 1:
[0020] Step 1.1. Access relevant servers through web crawlers to retrieve publicly available satellite remote sensing images of the area where the shoreline to be fitted is located as the raw data for shoreline fitting;
[0021] Step 1.2. Use ENVI remote sensing image processing software to perform atmospheric correction processing on the raw data. The atmospheric correction processing is based on the FLAASH model.
[0022] Step 1.3. Use an adaptive median filter to denoise the original data.
[0023] Web crawlers are programs that automatically access websites on the internet and selectively retrieve desired target files. Using web crawlers to collect raw data for fitting shorelines eliminates the need for manual web browsing and judgment, improving efficiency and avoiding hassle. The raw data requires atmospheric correction because subsequent identification of water bodies and land is based on the spectral characteristics of surface objects. However, satellite-captured remote sensing images are affected by factors such as clouds and aerosols in the atmosphere, as well as reflected light from the top of the atmosphere. To increase the accuracy of subsequent water body and land identification, it is necessary to correct the raw data using the FLAASH atmospheric correction model. The FLAASH model includes an atmospheric model and an aerosol model. The atmospheric model is determined based on the time and latitude / longitude of the satellite remote sensing images. The aerosol model uses the shortwave infrared band as the KT Upper Channel and the red band as the KT Lower Channel. Parameters such as the aerosol thickness coefficient and CO2 mixing ratio are determined according to the specific scenario. The adaptive median filter is an algorithm that automatically adjusts the size of the filtering window based on pixel noise and determines whether to filter based on the pixel distribution within the window. Compared to traditional median filters, it has stronger adaptability and can better preserve details in the processed image, especially edge details. Since subsequent steps require pixel identification, the raw data must undergo denoising to prevent noise from interfering with shoreline identification.
[0024] Further optimization involves the following specific steps in Step 2: identification of pixel-corresponding regions and construction of the original shoreline:
[0025] Step 2.1. Use Convolutional Neural Networks (CNN) as a tool for pixel-to-region recognition. By learning from a large number of water and land images, CNN can acquire the ability to recognize water and land features.
[0026] Step 2.2. Number all pixels in the original data, take any pixel in the original data as the specified pixel, and take a 1×3 pixel area centered on the specified pixel. The pixel arrangement in the area can be horizontal or vertical. All areas taken in the same remote sensing image have the same pixel arrangement. If the specified pixel is located at the edge of the image, take a 1×2 pixel area.
[0027] Step 2.3. Use CNN to identify two non-adjacent pixels in a 1×3 pixel region and identify pixels that are not located at the edge in a 1×2 pixel region. Pixels with the identification type of water are marked with an identification value of 1, and pixels with the identification type of land are marked with an identification value of 0. Mark the pixels as identified.
[0028] Step 2.4. After completing the identification and recording, randomly select one pixel from the unmarked pixels in the original data as the specified pixel, and then repeat step 2.3 until all pixels in the original data are marked as identified;
[0029] Step 2.5. Compare whether the two identification values corresponding to each pixel in the original data are the same, find the pixels with different identification values and record their corresponding numbers;
[0030] Step 2.6. After comparing the identification values of all pixels in the original data, the pixels with recorded numbers are used as shoreline pixels to construct the original shoreline.
[0031] CNN is a widely used neural network for image feature recognition. The convolutional layers in a CNN learn image features by multiplying the kernel by the image's chromaticity and summing the results. Based on these learned features, the CNN can perform feature judgment on subsequent input images at the pixel level, thereby achieving image classification. In the method of this invention, after learning the corresponding features of water and land images using a CNN, two non-adjacent pixels in a 1×3 pixel region are identified. This is because the chromaticity features of two non-adjacent pixels are discontinuous, and identifying two independent pixels is more accurate than identifying two adjacent pixels. Following the procedure described in Step 2, after all pixels in the original data are labeled and identified, each pixel will have two identification values. If the two identification values are inconsistent, it indicates that the pixel is located at the edge of water or land, making feature judgment difficult. The arrangement of such pixels in the image can constitute the original shoreline.
[0032] Further optimization involves obtaining candidate solutions in Step 4 as follows:
[0033] Step 4.1. Determine the range of initial candidate solutions for each block based on the complexity of the morphological features of the original shoreline in each block;
[0034] Step 4.2. Randomly select a value from the range described in Step 4.1 as the initial candidate solution, i.e., the initial position value for iteration. During the iteration process, each candidate solution corresponds to one particle; the formula for iterative calculation is as follows:
[0035]
[0036] Where t is the iteration number (t=0 in the initial candidate solution), i is the block number, and j is the particle number. Let be the position of the j-th particle in the i-th block after the t-th iteration. This value is the numerical value of the newly generated candidate solution. w is the velocity of the particle. iAs inertia weights, pbest is the individual historical best solution, and gbest is the group historical best solution. The corresponding values of pbest and gbest are in the generated... Take the value from c i1 With c i2 The learning factors are r1 and r2, which are random numbers in the range (0, 1). The values of r1 and r2 are different in each iteration.
[0037] Step 4.3. Determine the iteration threshold T corresponding to each block based on the complexity of the original shoreline shape in each block, and stop iterating after t = T.
[0038] For the Douglas-Puk algorithm, the selection of the threshold is crucial to the fitting result of the shoreline. The core idea of the Douglas-Puk algorithm is to recursively segment the curve. Before fitting, a certain number of points on the original curve are taken as data points, and these points are denoted as {P1, P2, ..., P...} according to their distribution order on the original curve. m}, where m is the number of data points, P1 and P m The starting and ending points of the original curve are identified, and the coordinates of these data points are determined. Then, a threshold ε is set. Connect P1 and P2. m Establish a baseline and calculate the distance d from the baseline to all other data points. j Let j be the data point index, and 2 ≤ j ≤ m-1. Find the maximum deviation value d. max d max =max{d2, d3, ..., d m-1}, and record d max Corresponding data point P j Then d max Compared with the threshold ε, if d max If the value is greater than ε, then retain P. j The original curve is then divided into two segments, with the starting and ending points of the first segment being P1 and P2, respectively. j The starting and ending points of the latter part are P. j and P m If d max If the value is less than ε, all data points except the start and end points are discarded, and the original curve is directly fitted to a curve connecting P1 and P2. m The line segment. If it is d max If the value is greater than ε, then repeat the above operation on the two segments of the curve until all the remaining data points become the endpoints of the line segments. This is the complete process of fitting the original curve.
[0039] To avoid the randomness caused by arbitrarily choosing the threshold ε, ε must be tested with a large number of values, and a fitting result corresponding to each ε must be obtained. These fitting results are then compared with the original curve. The quality of the fitting result is measured by two aspects: the retention of original curve features and the simplification effect on the curve shape. The fitting result that retains more original curve features and has a simpler curve shape is considered a superior fitting result. The retention of original curve features is quantified in subsequent steps using the fitness value obtained from the fitness function. A smaller threshold ε results in a simpler shape, therefore ε must be tested with a sufficient number of values for filtering. The more times ε is tested, the closer the final result obtained by the method of this invention is to the optimal fitting result, but this significantly increases the computational load. Therefore, the number of particles in the particle swarm optimization algorithm, i.e., the number of initial candidate solutions, needs to be determined based on the specific shape of the shoreline in the block. For relatively straight coastlines, the number of particles can be 20 to 50. For complex coastlines with key topographic features such as headlands, the number of particles can be 80 to 100. Similarly, the position and velocity values of the initial candidate solutions also need to be determined according to the complexity of the coastline. For relatively straight coastlines, the range of particle positions is [x]. min x max [x] can be [0.1 meters, 100 meters], for complex shoreline areas [x] min x max The velocity can be [0.1 meters, 10 meters]; the range of velocity values is usually determined by the range of position values, and the velocity range is [-(x... max -x min )·k,(x max -x min [)-k], where k is a scaling factor, typically 0.2. To avoid missing the optimal solution, the velocity value needs to be kept within a certain range during iteration, which can be described as above, with k ranging from 0.1 to 0.2. Furthermore, the iteration threshold T also needs to be determined based on the complexity of the shoreline. For relatively straight shorelines, T ranges from 50 to 100 iterations, while for complex shorelines, it ranges from 100 to 200 iterations.
[0040] Further optimization involves determining the degree of consistency in Step 5 as follows:
[0041] Step 5.1. Establish a corresponding Cartesian coordinate system in each block, and determine the coordinates of each pixel that constitutes the original shoreline based on the coordinate system;
[0042] Step 5.2. As the threshold in the Douglas-Puk algorithm, all the pixels that make up the original shoreline are used as data points in the Douglas-Puk algorithm, and the fitting result is obtained through the Douglas-Puk algorithm.
[0043] Step 5.3. Use the value of fitness as a standard to measure the degree of conformity, and calculate according to the fitness function. The fitness function is defined as the fitness between the fitted result and the original shoreline of the corresponding block.
[0044]
[0045] in for The corresponding fitness, α, β, γ are all weighting coefficients, H i Let Hausdorff distance be assumed. Let l be the distance between any data point in the fitting result and any pixel in the original shoreline. The maximum value that l can take is the Hausdorff distance, R. i and N i L represents the number of data points in the fitting result and the number of pixels in the original shoreline, respectively. i The number of missing keypoints is recorded. Keypoints are pixels that constitute key terrain features in the original shoreline; a keypoint is considered missing if no data point in the fitting result has the same coordinates as it. The corresponding fitness and fitting results;
[0046] In all currently generated The one with the smallest corresponding fitness value That is, gbest. If a smaller fitness value appears in subsequent iterations... Then use that Replace the current gbest; in all currently generated j, the same The one with the smallest corresponding fitness value pbest is the iteration sequence corresponding to the iteration sequence, where the iteration sequence is all sequences with the same j. The set consists of a set where each iteration sequence has a corresponding pbest. In subsequent iterations, if a sequence with a smaller fitness value appears... Then use that Replace the current pbest.
[0047] The fitness function measures the similarity of features between the fitted result and the original shoreline. This function primarily considers the degree of overlap between the fitted result and the original shoreline; the more similar the fitted result is to the original shoreline, the higher the fitness. The smaller the value, the better the individual's historical best solution pbest and the group's historical best solution gbest can be determined through the calculation of the fitness function, thus allowing the candidate solutions generated iteratively by the particle swarm optimization algorithm in Step 4 to gradually approach the optimal result.
[0048] Further optimization involves assigning a corresponding convergence threshold G to each block. The difference between gbest in the current iteration and gbest in the previous iteration is denoted as δ. δ is calculated after each iteration. If δ is consistently less than G, the iteration is considered to have met the convergence condition, and the iteration stops. Iterative calculations typically have two termination conditions: reaching a threshold number of iterations and meeting the convergence condition. In this invention, if the historical optimal solution gbest remains unchanged or changes minimally after multiple iterations, the particle swarm optimization algorithm is considered to have found the optimal solution, and the iteration stops. For general fitting requirements, the convergence threshold G can be 0.01; for high-precision fitting requirements, G can be 0.001. Ten consecutive δ values less than G indicate that the convergence condition is met.
[0049] The beneficial effects of the method of the present invention are as follows:
[0050] 1. The method of this invention has fixed rules for selecting fitted data points, dividing the original shoreline into blocks, and determining the threshold of the Douglas-Puk algorithm, thus avoiding interference caused by the randomness of selection and human subjectivity during manual operation;
[0051] 2. Each step of the method of this invention has fixed rules to follow, making it simpler and more efficient than traditional fitting methods;
[0052] 3. The use of particle optimization algorithms and fitness functions is more conducive to obtaining optimal fitting results. Attached Figure Description
[0053] Figure 1 A schematic diagram of the overall process of the shoreline fitting method of this invention. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below through specific embodiments. Obviously, the described embodiments are only some embodiments of the present invention, 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.
[0055] Example 1:
[0056] A shoreline fitting method based on an optimized Douglas-Puk algorithm, the overall process of which is as follows: Figure 1 As shown, the specific steps include:
[0057] Step 1. Search the internet for publicly available satellite image data of the area where the coastline to be fitted is located as the raw data for coastline fitting, and preprocess the raw data. Specific steps include:
[0058] Step 1.1. Access publicly available high-resolution shoreline data (GSHHG) through web crawling, and capture publicly available satellite remote sensing images of the area where the shoreline to be fitted is located as the raw data for shoreline fitting;
[0059] Step 1.2. Use ENVI remote sensing image processing software to perform atmospheric correction on the raw data. The atmospheric correction is based on the FLAASH model. The FLAASH model includes an atmospheric model and an aerosol model. The atmospheric model is determined according to the time and latitude and longitude of the satellite remote sensing image. When setting the aerosol model, the shortwave infrared band is used as the KT Upper Channel and the red light band is used as the KT Lower Channel. Parameters such as aerosol thickness coefficient and CO2 mixing ratio are determined according to the specific scene.
[0060] Step 1.3. Use an adaptive median filter to denoise the original data.
[0061] Step 2. Identify whether the pixels in the original data correspond to water or land, and find the pixels that are a superimposed state of water and land to form the original shoreline. The specific steps include:
[0062] Step 2.1. Use CNN as a pixel-to-region recognition tool. By learning from a large number of water and land images, CNN can acquire the ability to recognize water and land features.
[0063] Step 2.2. Number all pixels in the original data, take any pixel in the original data as the specified pixel, and take a 1×3 pixel area centered on the specified pixel. The pixel arrangement in the area is vertical. All areas taken in the same remote sensing image have the same pixel arrangement. If the specified pixel is located at the upper or lower edge of the image, take a 1×2 pixel area.
[0064] Step 2.3. Use CNN to identify two non-adjacent pixels in a 1×3 pixel region and identify pixels that are not located at the edge in a 1×2 pixel region. Pixels with the identification type of water are marked with an identification value of 1, and pixels with the identification type of land are marked with an identification value of 0. Mark the pixels as identified.
[0065] Step 2.4. After completing the identification and recording, randomly select one pixel from the unmarked pixels in the original data as the specified pixel, and then repeat step 2.3 until all pixels in the original data are marked as identified;
[0066] Step 2.5. Compare whether the two identification values corresponding to each pixel in the original data are the same, find the pixels with different identification values and record their corresponding numbers;
[0067] Step 2.6. After comparing the identification values of all pixels in the original data, the pixels with recorded numbers are used as shoreline pixels, and the original shoreline is constructed using the shoreline pixels.
[0068] Step 3. Divide the original shoreline into multiple segments using a block-segmentation method. The specific steps for block segmentation are as follows:
[0069] Step 3.1. Identify all key topographic features in the original shoreline by recognizing morphological characteristics, and then divide the original shoreline into segments. Each segment is a block, and each block contains one of the key topographic features. Each block has a unique number.
[0070] Step 3.2. Calculate the key feature density for each original block. The key feature density is the ratio of the number of key terrain features in each block to the length of the shoreline in that block. Then, determine a density threshold of 0.5 features / km. Compare the key feature density of each block with the density threshold in numerical order. If the key feature densities of two blocks are both less than the threshold and the numbers are consecutive, merge the two blocks. After all blocks have been compared, a new block sequence is generated. The new block sequence is recorded as the first block sequence, and the blocks in it are renumbered. Then, repeat the comparison and merging process to form the second block sequence. And so on, until there are no more blocks to merge in the sequence. The last sequence obtained after comparison and merging is recorded as the final block sequence.
[0071] Step 4. Obtain candidate solutions for the Douglas-Puk algorithm threshold through optimization algorithms. The specific steps are as follows:
[0072] Step 4.1. Determine the range of initial candidate solutions for each block based on the complexity of the morphological features of the original shoreline in each block;
[0073] Step 4.2. Randomly select a value from the range described in Step 4.1 as the initial candidate solution, i.e., the initial position value for iteration. During the iteration process, each candidate solution corresponds to one particle; the formula for iterative calculation is as follows:
[0074]
[0075] Where t is the iteration number (t=0 in the initial candidate solution), i is the block number, and j is the particle number. Let be the position of the j-th particle in the i-th block after the t-th iteration. This value is the numerical value of the newly generated candidate solution. w is the velocity of the particle.i As inertia weights, pbest is the individual historical best solution, and gbest is the group historical best solution. The corresponding values of pbest and gbest are in the generated... Take the value from c i1 With c i2 The learning factors are r1 and r2, which are random numbers in the range (0, 1). The values of r1 and r2 are different in each iteration.
[0076] Step 4.3. Determine the iteration threshold T = 100 times for each block based on the complexity of the original shoreline shape in each block, and stop iterating after t = T.
[0077] In addition, each block takes a corresponding convergence threshold G, which is 0.01 in this embodiment. The difference between gbest in the current iteration step and gbest in the previous iteration step is recorded as δ. δ is calculated after each iteration. If the δ calculated in 10 consecutive iterations is less than G, it is considered that the iteration calculation has met the convergence condition. After the convergence condition is met, the iteration calculation is stopped.
[0078] Step 5. Obtain the fitting results corresponding to the candidate solutions of the Douglas-Puk algorithm threshold, compare the degree of consistency between the fitting results and the original shoreline, and record them. Specific steps include:
[0079] Step 5.1. Establish a corresponding Cartesian coordinate system in each block, and determine the coordinates of each pixel that constitutes the original shoreline based on the coordinate system;
[0080] Step 5.2. As the threshold in the Douglas-Puk algorithm, all the pixels that make up the original shoreline are used as data points in the Douglas-Puk algorithm, and the fitting result is obtained through the Douglas-Puk algorithm.
[0081] Step 5.3. Calculate based on fitness function The fitness of the fitted result and the original shoreline of the corresponding block is used as the standard to measure the degree of agreement. The formula for the fitness function is:
[0082]
[0083] in for The corresponding fitness values, α, β, and γ are all weighting coefficients, α = 0.6, β = 0.3, γ = 0.1, H i Let Hausdorff distance be assumed. Let l be the distance between any data point in the fitting result and any pixel in the original shoreline. The maximum value that l can take is the Hausdorff distance, R. i and N i L represents the number of data points in the fitting result and the number of pixels in the original shoreline, respectively. i The number of missing keypoints is recorded. Keypoints are pixels that constitute key terrain features in the original shoreline; a keypoint is considered missing if no data point in the fitting result has the same coordinates as it. The corresponding fitness and fitting results;
[0084] In all currently generated The one with the smallest corresponding fitness value That is, gbest. If a smaller fitness value appears in subsequent iterations... Then use that Replace the current gbest; in all currently generated j, the same The one with the smallest corresponding fitness value pbest is the iteration sequence corresponding to the iteration sequence, where the iteration sequence is all sequences with the same j. The set consists of a set where each iteration sequence has a corresponding pbest. In subsequent iterations, if a sequence with a smaller fitness value appears... Then use that Replace the current pbest.
[0085] Step 6. Find the candidate solution with the highest matching degree in each block as the final threshold of the Douglas-Puk algorithm, and take the fitting result corresponding to the final threshold as the final fitting result. Then, combine the final fitting results of all blocks according to the block number to obtain the final output result.
Claims
1. A shoreline fitting method based on an optimized Douglas-Puk algorithm, characterized in that, Specifically, the following steps are included: Step 1. Obtain publicly available satellite image data of the area where the coastline to be fitted is located, as the raw data for coastline fitting, and preprocess the raw data; Step 2. Identify the pixels in the original data image, determine whether each pixel corresponds to water or land, filter out the pixels that are superimposed on water and land, and record them as shoreline pixels. All shoreline pixels together constitute the original shoreline. Step 3. Divide the original shoreline into multiple segments using a block-based method. The specific steps are as follows: Step 3.
1. Identify all key topographic features in the original shoreline by morphological characteristics, and then divide the original shoreline into segments. Each segment is taken as an original block, and each original block contains one of the key topographic features. Each original block corresponds to a unique number. Step 3.
2. Calculate the key feature density for each original block and set a density threshold, where the key feature density is the ratio of the number of key terrain features in a block to the length of the shoreline in that block; The key feature density of each original block is compared with the density threshold in numerical order. If the key feature density of two blocks is less than the density threshold and the numbers are consecutive, the two blocks are merged. After all blocks have been compared and merged, a new block sequence is formed. The new block sequence is recorded as the first block sequence and the blocks in it are renumbered. The comparison and merging process is repeated to form the second block sequence. This process is repeated until there are no more blocks to merge in the sequence. The last sequence obtained after comparison and merging is recorded as the final block sequence. Step 4. Use the Douglas-Puk algorithm to fit the shoreline in each block of the final block sequence. The threshold in the algorithm is different when fitting different blocks. Use the particle swarm optimization algorithm to generate multiple values as candidate solutions for the threshold of each block. Step 5. Use each candidate solution as the threshold in the Douglas-Puk algorithm, use the pixels in the original shoreline as the data points in the Douglas-Puk algorithm, and then use the Douglas-Puk algorithm to obtain the corresponding fitting result. Compare the degree of consistency between the obtained fitting result and the original shoreline, and record each candidate solution and its corresponding degree of consistency. Step 6. Find the candidate solution with the highest matching degree in each block as the final threshold of the Douglas-Puk algorithm, and take the fitting result corresponding to the final threshold as the final fitting result. Then, combine the final fitting results of all blocks according to the block number order to obtain the final shoreline.
2. The shoreline fitting method based on the optimized Douglas-Puk algorithm as described in claim 1, characterized in that, The specific steps for searching and preprocessing the raw data in Step 1 are as follows: Step 1.
1. Access relevant servers through web crawlers to retrieve publicly available satellite remote sensing images of the area where the shoreline to be fitted is located as the raw data for shoreline fitting; Step 1.
2. Use ENVI remote sensing image processing software to perform atmospheric correction processing on the raw data. The atmospheric correction processing is based on the FLAASH model. Step 1.
3. Use an adaptive median filter to denoise the original data.
3. The shoreline fitting method based on the optimized Douglas-Puk algorithm as described in claim 2, characterized in that, The specific steps for identifying the region corresponding to the pixel and constructing the original shoreline in Step 2 are as follows: Step 2.
1. Use Convolutional Neural Networks (CNN) as a pixel-to-pixel type recognition tool. By learning from a large number of water and land images, CNN can acquire the ability to recognize water and land features. Step 2.
2. Number all pixels in the original data, take any pixel in the original data as the specified pixel, and take a 1×3 pixel area centered on the specified pixel. The pixel arrangement in the area can be horizontal or vertical. All areas taken in the same original data have the same pixel arrangement. If the specified pixel is located at the edge of the image, take a 1×2 pixel area. Step 2.
3. Use CNN to identify two non-adjacent pixels in a 1×3 pixel region and identify pixels in a 1×2 pixel region that are not located at the edge of the image. Pixels with the identification type of water are marked with an identification value of 1, and pixels with the identification type of land are marked with an identification value of 0. After identification, the specified pixels are marked with an identification mark. Step 2.
4. After completing the identification and recording, randomly select one pixel from the unmarked identified pixels in the original data as the specified pixel, and then repeat step 2.3 until all pixels in the original data are marked as identified. Step 2.
5. Compare whether the two recognition values corresponding to each pixel in the original data are the same, and record the number corresponding to the pixel with different recognition values; Step 2.
6. After comparing the identification values of all pixels in the original data, the pixels with recorded numbers are used as shoreline pixels to construct the original shoreline.
4. The shoreline fitting method based on the optimized Douglas-Puk algorithm as described in claim 3, characterized in that, The specific steps for generating candidate solutions in Step 4 are as follows: Step 4.
1. Determine the range of initial candidate solutions for each block based on the complexity of the morphological features of the original shoreline in each block; Step 4.
2. Randomly select a value from the range described in Step 4.1 as the initial candidate solution, i.e., the initial position value for iteration. During the iteration process, each candidate solution corresponds to one particle; the formula for iterative calculation is as follows: Where t is the iteration number (t=0 in the initial candidate solution), i is the block number, and j is the particle number. Let be the position of the j-th particle in the i-th block after the t-th iteration. This value is the numerical value of the newly generated candidate solution. w is the velocity of the particle. i As inertia weights, pbest is the individual historical best solution, and gbest is the group historical best solution. The corresponding values of pbest and gbest are in the generated... Take the value from c i1 With c i2 The learning factors are r1 and r2, which are random numbers in the range (0, 1). The values of r1 and r2 are different in each iteration. Step 4.
3. Determine the iteration threshold T corresponding to each block based on the complexity of the original shoreline shape in each block, and stop iterating after t = T.
5. The shoreline fitting method based on the optimized Douglas-Puk algorithm as described in claim 4, characterized in that, The specific steps for determining the degree of consistency in Step 5 are as follows: Step 5.
1. Establish a corresponding Cartesian coordinate system in each block, and determine the coordinates of each pixel that constitutes the original shoreline based on the coordinate system; Step 5.
2. As the threshold in the Douglas-Puk algorithm, all the pixels that make up the original shoreline are used as data points in the Douglas-Puk algorithm, and the fitting result is obtained through the Douglas-Puk algorithm. Step 5.
3. Calculate based on fitness function The fitness between the fitted result and the original shoreline of the corresponding block is used as the standard to measure the degree of agreement; the formula for the fitness function is: in for The corresponding fitness, α, β, γ are all weighting coefficients, H i Let Hausdorff distance be assumed. Let l be the distance between any data point in the fitting result and any pixel in the original shoreline. The maximum value that l can take is the Hausdorff distance, R. i and N i L represents the number of data points in the fitting result and the number of pixels in the original shoreline, respectively. i The number of missing keypoints refers to the pixels that constitute key terrain features in the original shoreline. Keypoints that do not have the same coordinates as data points in the fitting results are considered missing keypoints. Record each The corresponding fitness and fitting results; In all currently generated The one with the smallest corresponding fitness value That is, gbest. If a smaller fitness value appears in subsequent iterations... Then use that Replace the current gbest; in all currently generated j, the same The one with the smallest corresponding fitness value pbest is the iteration sequence corresponding to the iteration sequence, where the iteration sequence is all sequences with the same j. The set consists of a set where each iteration sequence has a corresponding pbest. In subsequent iterations, if a sequence with a smaller fitness value appears... Then use that Replace the current pbest.
6. The shoreline fitting method based on the optimized Douglas-Puk algorithm as described in claim 5, characterized in that: For each block, a corresponding convergence threshold G is selected. The difference between gbest in the current iteration step and gbest in the previous iteration step is denoted as δ. δ is calculated after each iteration. If the calculated δ is less than G for multiple consecutive iterations, the iteration calculation is considered to have met the convergence condition. Once the convergence condition is met, the iteration calculation is stopped.