A method for extracting a mars impact crater profile line with adaptive constant-height-distance optimization
The Mars impact crater contour extraction method based on adaptive contour interval optimization solves the problem of insufficient accuracy of impact crater geometric domain information, realizes accurate extraction of impact crater contours and segmentation of internal landforms, and improves the accuracy of impact crater features and attribute domain analysis capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING FORESTRY UNIV
- Filing Date
- 2025-07-09
- Publication Date
- 2026-06-09
Smart Images

Figure CN121033441B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of deep space exploration, and in particular relates to a method for extracting the contour lines of Martian impact craters with adaptive contour spacing optimization. Background Technology
[0002] Impact craters hold significant scientific value in planetary science research and deep space exploration missions. Their distribution, location, and size are crucial for determining geological age, lander site selection, and extrapolating planetary evolution. With the advancement of deep space exploration, the need for extracting impact crater information is increasing. Research requires not only determining the location and size of impact craters but also extracting multi-dimensional information such as edge contours, internal morphology, and degree of degradation, in conjunction with their internal geomorphological structure. In recent years, research on impact crater information extraction has primarily focused on two aspects: the geometric domain and the attribute domain. The geometric domain includes spatial information such as location, shape, and boundaries, while the attribute domain encompasses quantitative indicators such as category, degradation level, and topographic relief. A complete impact crater catalog generated by combining information from both domains can serve various planetary science research and deep space exploration projects.
[0003] In recent years, research on the geometric domain has typically relied on object detection networks to predict the location and size of impact craters. The specific method involves cropping coordinate and diameter information from impact crater catalog databases onto remote sensing imagery to generate a training sample set. This set is then used to train deep learning models such as Faster R-CNN and the YOLO series to predict the coordinates and size of impact craters. However, these models usually only provide a rough location of impact craters and struggle to achieve precise terrain segmentation. Especially in detailed terrain segmentation tasks, most impact crater catalogs lack realistic edge and internal structure information, making them unsuitable as label sources for segmentation networks. Therefore, creating detailed impact crater edge and internal structure labels suitable for segmentation networks requires extensive manual annotation, resulting in low efficiency.
[0004] In terms of attribute domains, existing technologies generally rely on the location and size of impact craters in the geometric domain. This is achieved by cropping corresponding areas from remote sensing images or digital elevation models (DEMs) and combining methods such as slope calculation, profile fitting, and expert scoring to quantitatively analyze or classify the characteristics of impact craters. This enables tasks such as impact crater classification, morphological feature extraction, and degradation assessment. Therefore, the comprehensiveness and accuracy of impact crater attribute domain information extraction often depend on the fineness of the geometric domain information extraction. However, current target detection methods for impact crater geometric domain information often suffer from insufficient granularity and accuracy, limiting the accuracy of refined mapping of impact crater geometric features and hindering a deeper understanding of impact crater characteristics and their evolution. Summary of the Invention
[0005] Purpose of the Invention: Current target detection methods for impact crater geometry often suffer from insufficient granularity and accuracy, limiting the accuracy of refined mapping of impact crater geometry and hindering a deeper understanding of impact crater features and their evolution. The purpose of this invention is to provide an adaptive contour-optimized method for extracting Martian impact crater outlines. This lays the foundation for high-precision mapping of impact crater geometry and accurate extraction and inversion of comprehensive information from the attribute domain.
[0006] Technical solution: The present invention provides an adaptive contour-optimized method for extracting Martian impact crater outlines, comprising the following steps:
[0007] Step 1: Acquire Mars DEM images and perform data augmentation processing to obtain processed image data;
[0008] Step 2: Extract and optimize the impact crater contours of the processed image data based on the Bayesian optimization algorithm to obtain the optimized impact crater contours.
[0009] Step 3: Perform progressive correction on the optimized impact crater profile;
[0010] Step 4: Based on the unsupervised SAM model and the morphology and topological relationship of the internal landform elements of the impact crater, the internal structure of the corrected impact crater bounding box is segmented to complete the extraction of the Martian impact crater outline.
[0011] Furthermore, step 1 specifically involves: firstly, segmenting the elevation range of the DEM data. Let the input DEM data matrix be P, and its elevation value range be [H...]. min H max The elevation values are divided into n contour segments, and the contour interval Δh of each segment is defined as follows:
[0012]
[0013] Among them, H min and H max These represent the lowest and highest elevation values in the DEM data, respectively, where n is the number of contour interval segments.
[0014] For each pixel in the DEM data, its elevation value P i,j The elevation value P' is moduloed with the contour interval Δh to map it to a new interval range, making the boundary differences more obvious; the mapped elevation value P' i,j The calculation formula is as follows:
[0015]
[0016] Among them, the modulo operation P i,jmodΔh redivides the elevation values into the range [0, Δh]; by multiplying the redivised values by 255 / Δh, P' i,j The value is limited to the range [0, 255]. After mapping, the elevation value between each contour interval will be mapped to the range of 0-255, so that different contour intervals visually form a layered nested contour line.
[0017] Furthermore, step 2 specifically includes the following steps:
[0018] Step 2.1: Determine the optimal threshold based on the Otsu thresholding method, select the threshold that maximizes the inter-class variance, and realize dynamic threshold binarization;
[0019] Step 2.2: Use the Suzuki contour tracking algorithm to obtain all potential closed contours of the impact crater terrain region;
[0020] Step 2.3: Optimize the contour based on adaptive contour interval. By constructing an objective optimization function, the optimal contour interval is determined by comprehensively considering factors such as the volume of the impact crater area, the roundness and compactness of the crater contour line, and the constraints of the bounding point of the map frame. The closed contour line that best matches the contour characteristics of the impact crater is extracted to obtain the optimized impact crater contour.
[0021] Furthermore, step 2.1 specifically involves determining the optimal threshold T using the Ostu thresholding method. * Values greater than T * The pixels defined are assigned to the impact crater boundary, and the rest are assigned to the background. The objective function of the Otsu thresholding method is to maximize the inter-class variance, and the specific formula is as follows:
[0022]
[0023] Where ω0 and ω1 represent the proportions of pixels in the background and the crater boundary, respectively, and μ0 and μ1 represent the average gray values of pixels in the background and the crater boundary, respectively.
[0024] Further, step 2.2 specifically involves: using the Suzuki contour tracking algorithm to obtain all potential closed contours of the impact crater terrain region; the i-th closed impact crater contour C i This represents a set of points connected according to topological relationships, as shown in formula (4):
[0025] C i ={(x i1 ,y i1 ),(x i2 ,y i2 ),…,(x in ,y in (4)
[0026] Where n is the i-th closed contour C i Total number of points included;
[0027] The Douglas-Peucker algorithm is used to simplify all potential closed contours C. i While ensuring that the shape remains unchanged within the allowable tolerance range, reduce the number of polygons C. i The vertices are simplified to make the geometry compact and lightweight, and the tolerance parameter of the Douglas-Peucker algorithm is expressed by formula (5):
[0028] ∈=α·Perimeter(C i (5)
[0029] Where α is the scaling factor, set to 0.001, Perimeter(C i ) is the outline C i The perimeter.
[0030] Furthermore, step 2.3 specifically involves constructing the following objective function:
[0031]
[0032] Where C is the contour line generated based on Δh, and its initial value is set to C. max ;f volume This represents the percentage of the filling volume; the larger the filling volume within the outline, the smaller this item is. SI This is the shape index of the polygon formed by the outline; the closer the outline shape is to a circle, the smaller this term is; f compact This is the ratio of the area of the convex hull of the polygon to its own area; the more compact the shape of the contour, the smaller this term. boundary This is a penalty term, representing the proportion of points on the edge bounding box to points on the contour, used to penalize confusion between the bounding box and the contour; the higher this proportion, the larger the objective function value; the objective is to minimize the objective function to obtain the optimal contour interval Δh. * This makes the optimized contour C optimal It gets closer to the actual edge of the impact crater;
[0033] Outline C max Volume of the enclosed area depression-filling To reflect the relationship between the area and depth of a region, when calculating the volume of the filled depression, the area of each pixel is first multiplied by the depth after filling, and then C is calculated. max Integrating the volumes of all pixels within the region yields the final depression-filling volume, theoretically calculated as follows:
[0034]
[0035] Where z(x, y) is the elevation value of the DEM data within the depression area, H fill R represents the uniform elevation value after filling the depression, R is the projected area of the depression in the vertical direction, and dx and dy are the resolution / differential of the remote sensing image in the x and y directions, respectively; H fill Use outline C max Average elevation HC of all points max To approximate the impact crater contour C, the feature f shown in formula (8) is constructed. volume :
[0036]
[0037] Volume C Let C be the volume of the prism enclosed by the contour line of the impact crater.
[0038] F SI (C) Used to assess the roundness of the contour shape; the contour of the impact crater should be close to a circle, therefore f SI The value of (C) should be close to the minimum. When the outline is irregular, the shape index will increase, indicating that the shape is much different from a circle. The calculation formula is as follows:
[0039]
[0040] Where P is the perimeter of the polygon with outline C, A is the area of the polygon, and for a circle, the shape index f SI (C) equals 1, and the shape index value will gradually increase as the contour shape becomes more complex or irregular.
[0041] f compact (C) The ratio of the area of the convex hull of the contour polygon to its own area is used to evaluate the regularity of the shape. The convex hull is the smallest convex polygon that completely encloses the contour polygon. The contour of the impact crater should be a convex polygon, so this ratio should be close to 1. When there is a significant indentation in the contour, the area of the enclosed polygon will be significantly smaller than the area of the convex hull. Its formula is defined as:
[0042]
[0043] Among them, A total A represents the actual area of the polygon. convex Let be the area of the convex hull of the polygon;
[0044] P boundary The proportion of the bounding box points in the contour is used as a penalty term to limit the optimization algorithm from including the bounding box in the impact crater contour. Its formula is defined as:
[0045]
[0046] Where N boundary N represents the number of points near the image boundary. total λ is the total number of contour points, λ is the penalty factor (λ>0), and T' is the threshold for the proportion of boundary points. When the proportion of the points in the frame where the impact crater contour C is located exceeds the threshold T', the penalty term is not 0, and the larger the proportion of the frame points, the larger the penalty term value.
[0047] Furthermore, in step 2, the Bayesian optimization algorithm specifically includes:
[0048] Randomly select n initial points, i.e., contour line intervals Δh i Evaluate the objective function at each point And form the initial dataset
[0049] Fit a Gaussian process GP to a dataset With approximate objective function The alternative model is defined as follows:
[0050]
[0051] Where m(Δh) is the mean function, k(Δh,Δh') represents the covariance function, the squared exponent kernel is chosen, and the variables Δh and Δh' represent the interval values of two contour lines in the parameter space;
[0052] The Gaussian process substitution model is used to predict the next evaluation point Δh by maximizing the acquisition function. next The definition is as follows:
[0053]
[0054] Where EI(·) represents the desired improvement of the acquisition function, and the operator Calculate the expected value of the improvement in The prediction based on Gaussian processes is modeled as a Gaussian random variable. item This represents the best target value observed to date.
[0055] In Δh next Calculate the objective function and update the dataset. Refit the Gaussian process model using the updated D;
[0056] Based on the proportional coefficient of the maximum elevation difference within the contour line outline, the range of values for the contour interval Δh is defined, and the Bayesian optimization algorithm is applied within this range to search for the optimal solution, as expressed below:
[0057] Δh∈[k1(H max -Hmin ),k2(H max -H min (14)
[0058] Where H max and H min K1 and K2 are the maximum and minimum elevation values within the contour, respectively, and k1 and k2 are the proportional coefficients for the maximum elevation difference.
[0059] Furthermore, step 3 specifically involves: by analyzing the topological relationship between the foreground and the bounding box, adaptively adjusting the position and size of the bounding box until the impact crater is completely and compactly surrounded by a suitable bounding box, thereby outputting accurate impact crater position, size, and segmentation results.
[0060] Furthermore, step 4 specifically involves: SAM is a cue-based VIT model, which is trained on the SA-1B dataset containing images. The impact crater foreground extracted from the impact crater contour based on the Bayesian optimization algorithm is input into the SAM model, and a "segment everything" mode is adopted, that is, 32×32 points are uniformly selected as cues in the entire image area, and the output is a segmentation mask covering the entire image.
[0061] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method of the present invention.
[0062] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:
[0063] (1) Adaptive Contour Spacing Impact Crater Contour Extraction Method: This invention enhances the recognizability of terrain boundary features in digital elevation model (DEM) data of impact craters. Based on this, the outermost closed contour lines are extracted as the initial contour of the impact crater. To further optimize the initial contour, this invention proposes a "global impact crater contour optimization based on adaptive contour spacing" method. This method uses a Bayesian optimization algorithm to adaptively adjust the contour spacing, and finally extracts the optimal contour of the Martian impact crater and the corresponding impact crater foreground mask.
[0064] (2) Progressive Iterative Correction Method for Impact Crater Target Box: By judging the overlap between the impact crater foreground mask and the impact crater target box, this invention proposes a "progressive iterative correction method for impact crater target boxes." This method gradually adjusts the width and height of the target box during the iteration process, making the target box gradually more compact and more completely surrounding the impact crater target. This method can effectively correct the geometric position and size of the target box obtained based on target detection networks or impact crater cataloging data, thereby significantly improving the geometric accuracy of the target box.
[0065] (3) Unsupervised impact crater interior landform segmentation: Based on the unsupervised SAM (SegmentAnything Model), this invention segments the landforms inside impact craters. By combining the morphological and topological relationships of the landform elements within the impact crater, semantic information is further assigned to the segmentation results. This provides an important basis for subsequent attribute domain analysis of impact crater classification and structural morphology feature extraction. Attached Figure Description
[0066] Figure 1 This is a flowchart of the algorithm of the present invention;
[0067] Figure 2 This is an enhanced DEM image of the impact crater based on the contour-segmented processing of the present invention.
[0068] Figure 3 This is an enhanced DEM image of the impact crater after dynamic threshold binarization according to the present invention.
[0069] Figure 4 The results of edge tracking and contour extraction in this invention;
[0070] Figure 5 f is the percentage of depression filling amount in this invention. volume A schematic diagram of one-dimensional calculation;
[0071] Figure 6 This is a diagram illustrating the Bayesian optimization effect of the present invention;
[0072] Figure 7 This refers to the case where the bounding box of the present invention is offset in both the horizontal and vertical directions;
[0073] Figure 8 This is a flowchart illustrating the correction process for two types of horizontal offsets in the bounding box according to the present invention.
[0074] Figure 9 These are DEM enhancement and SAM segmentation results for different types of impact craters according to the present invention.
[0075] Figure 10 This is the Mars research area of the present invention;
[0076] Figure 11 A comparison of impact crater contour extraction results under different enhancement methods of the present invention;
[0077] Figure 12 A comparison of the effects of different impact crater contour extraction methods of the present invention;
[0078] Figure 13 The figure shows the experimental results of the ablation of the objective function of this invention;
[0079] Figure 14The impact crater contour extraction performance of this invention varies with the size and morphological complexity of the impact crater. Detailed Implementation
[0080] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0081] The algorithm flowchart of this invention is as follows: Figure 1 As shown. This method uses the target detection bounding box or coordinates and diameter in the cataloging data of Martian impact craters as a reference to crop the corresponding area from the Martian HRSC DEM image. Figure 1 (a) Next, DEM data augmentation processing is performed. Figure 1 (b) and dynamic threshold binarization processing ( Figure 1 (c) and trace the outermost contour lines from them to obtain the initial impact crater outline. Figure 1 (d)). Based on this initial contour, the contour is further optimized using an adaptive contour-distance target optimization equation, ultimately yielding the optimized impact crater contour. Figure 1 (e) and its foreground mask. By determining the degree of overlap between the impact crater foreground mask and the target bounding box, the impact crater target bounding box is iteratively corrected to make it more compact and completely surround the target. Figure 1 (f)). Finally, the resulting final foreground mask ( Figure 1 (g) Perform internal morphology segmentation and assign corresponding semantic information to the segmentation results. Figure 1 (h)). The algorithm consists of four parts: 1. DEM enhancement, 2. Impact crater contour extraction and optimization, 3. Detection box correction, and 4. Internal terrain segmentation.
[0082] 1. DEM Enhancement Based on Elevation Spacing Segmentation
[0083] Topographic feature details in elevation data are crucial for accurate detection of impact crater boundaries. However, resolution limitations and noise interference in raw DEM data often lead to blurred topographic features. Therefore, this invention proposes a "DEM enhancement based on contour interval segmentation" method to improve the discriminability of topographic boundary features in DEM data, which is beneficial for subsequent edge extraction and internal topographic unit segmentation.
[0084] To significantly enhance the local differences in elevation variations, this invention first segments the elevation range of the DEM data. Let the input DEM data matrix be P, and its elevation value range be [H...]. min H max The elevation values are divided into n contour segments, and the contour interval Δh of each segment is defined as follows:
[0085]
[0086] Among them, Hmin and H max These represent the lowest and highest elevation values in the DEM data, respectively, where n is the number of contour interval segments, which can be dynamically set according to actual needs. Subsequently, for each pixel in the DEM data, its elevation value P... i,j The elevation value P' is then moduloed with the contour interval Δh to map it to a new interval range, making the boundary differences more obvious. i,j The calculation formula is as follows:
[0087]
[0088] Among them, the modulo operation P i,j modΔh redivides the elevation values into the range [0, Δh]. Then, by multiplying the redivised values by 255 / Δh, P' can be calculated. i,j The values are limited to the range [0, 255]. After mapping, the elevation values between each contour interval will be mapped to the range of 0-255, thus visually forming layered nested contour lines between different contour intervals. Due to the steeper slope of the impact crater rim and wall areas, the resulting contour lines are denser, contrasting with the relatively flat areas outside and at the bottom of the crater, highlighting the terrain boundaries, and the enhanced effect is as follows: Figure 2 As shown in (a)-(d), the left column is the original DEM data of the impact crater, and the right column is the result after contour interval segmentation enhancement.
[0089] 2. Impact crater contour extraction and optimization based on Bayesian optimization algorithm
[0090] The impact crater contours are extracted from the enhanced DEM in three steps: dynamic threshold binarization, edge tracking and closed contour extraction, and contour optimization based on adaptive contour spacing.
[0091] (1) Dynamic threshold binarization
[0092] The boundaries of elevation changes typically correspond to high-contrast regions in a grayscale image. Therefore, this invention employs the Ostu thresholding method to automatically determine the optimal threshold T. * Values greater than T * Pixels that meet the criteria are assigned to the impact crater boundary, while the rest are assigned to the background. The objective function of the Otsu thresholding method is to maximize the inter-class variance, as shown in the following formula:
[0093]
[0094] Where ω0 and ω1 represent the proportions of pixels in the background and the crater boundary, respectively, and μ0 and μ1 represent the average gray values of pixels in the background and the crater boundary, respectively. The Otsu method iterates through all possible thresholds T to select the one that maximizes the inter-class variance. The threshold is set to achieve the best binarization effect. Figure 3 The original impact crater DEM was enhanced by contour-segmented data and then subjected to dynamic threshold binarization, resulting in multiple distinct ring-shaped contours within the impact crater region at contour intervals. (a)-(c) represent the original impact crater DEM data, the contour-segmented DEM enhanced image, and the dynamic threshold binarized image, respectively.
[0095] (2) Edge tracking and closed contour extraction
[0096] After performing dynamic threshold binarization of the impact crater, this invention employs the Suzuki contour tracking algorithm to identify all potential closed contours of the impact crater terrain region. The i-th closed impact crater contour C... i This represents a set of points connected according to a certain topological relationship, as shown in formula (4):
[0097] C i ={(x i1 ,y i1 ),(x i2 ,y i2 ),…,(x in ,y in (4)
[0098] Where n is the i-th closed contour C i The total number of points included. To ensure a more compact extracted closed boundary and eliminate potential local noise interference, this invention employs the Douglas-Peucker algorithm to further simplify all potential closed contours C. i While ensuring that the shape does not change significantly within the allowable tolerance range, reduce the number of polygons C. i The vertices are simplified to ensure a compact and lightweight representation. This invention uses formula (5) to represent the tolerance parameter ∈ of the Douglas-Peucker algorithm:
[0099] ∈=α·Perimeter(C i (5)
[0100] Where α is a scaling factor, which is set to 0.001 in this invention. Perimeter(C i ) is the outline C i The perimeter.
[0101] After edge tracking and geometric simplification, the impact crater region can be obtained. Figure 4 (a) has multiple closed contours, see Figure 4 (b) Multiple green closed contours. The present invention selects the closed contour with the largest area as the outer edge contour of the impact crater, denoted as C. max ,like Figure 4As shown in (c). Based on the dynamic threshold binarization in (a), edge tracking and closed contour extraction are performed to obtain multiple closed contours shown by the green line in (b). Among them, the closed contour with the largest area constitutes the initial impact crater contour, as shown in (c).
[0102] (3) Contour optimization based on adaptive contour interval
[0103] The enhancement effect of DEM enhancement and contour extraction methods on the outer contour of impact craters depends on the setting of the contour interval Δh. When the value of Δh is unreasonable, errors can easily occur where the impact crater contour is confused with the bounding box of the input DEM image, such as... Figure 4 (c) As shown in the upper right corner border, the closed outline C is now complete. max It cannot truly represent the closed contour of the corresponding impact crater. To address this problem, this invention proposes an "adaptive adjustment strategy for contour spacing Δh," further optimizing C. max This allows the algorithm to better approximate the true edge contour of the impact crater. By constructing an objective optimization function, the algorithm comprehensively considers factors such as the crater's filling volume, the roundness and compactness of its shape, and the constraints of the bounding box points to determine the optimal contour interval Δh and extract the closed contour line C that best matches the impact crater's contour characteristics. optimal .
[0104] To construct a reasonable objective function, this invention utilizes three characteristics of the impact crater edge: 1) The area enclosed by the impact crater edge should be the region with the largest water catchment in that local area, therefore its corresponding contour line should have the largest depression volume among all contour lines; 2) The impact crater is approximately circular, and the polygon enclosed by its edge should have a shape exponent f closest to 1. SI 3) The edges of impact craters are typically regular, compact, and smooth; therefore, their enclosing area and the area of the convex hull should be as consistent as possible. Based on the above characteristics, the objective function constructed in this invention is as follows:
[0105]
[0106] Where C is the contour line generated based on Δh, and its initial value can be set to C. max ;f volume This represents the percentage of the filling volume; the larger the filling volume within the outline, the smaller this item is. SI This is the shape index of the polygon formed by the outline; the closer the outline shape is to a circle, the smaller this term is; f compact This is the ratio of the area of the convex hull of the polygon to its own area; the more compact the shape of the contour, the smaller this term. boundary This is a penalty term, representing the proportion of points on the edge bounding box to points on the contour, used to penalize confusion between the bounding box and the contour. The higher this proportion, the larger the objective function value. Therefore, the objective of this invention is to minimize the objective function, thereby obtaining the optimal contour interval Δh. *This makes the optimized contour C optimal It gets closer to the actual edge of the impact crater.
[0107] The specific explanations of each term in the objective function (6) are as follows: Contour C max Volume of the enclosed area depression-filling This reflects the area-depth relationship of the region, ensuring to a certain extent that the contour lines can obtain the largest possible depression area when optimizing the objective function. When calculating the depression-filling volume, the area of each pixel is first multiplied by the depth after filling, and then C... max Integrating the volumes of all pixels within the region yields the final depression-filling volume, theoretically calculated as follows:
[0108]
[0109] Where z(x, y) is the elevation value of the DEM data within the depression area, H fill Let R be the uniform elevation value after filling the depression, R be the projected area of the depression in the vertical direction, and dx and dy be the resolution / differential of the remote sensing image in the x and y directions, respectively. In the algorithm implementation, H... fill Use outline C max The average elevation H of all points above Cmax Approximately. In order to maintain a large filling volume for the impact crater contour C, the present invention constructs the feature f shown in formula (8). volume :
[0110]
[0111] Volume C Let C be the volume of the prism enclosed by the contour line C of the impact crater. In practice, this invention directly calculates C. max The area of the enclosed pixels and their average elevation H Cmax Discrete integral of the product. Volume depression-filling To fill the depression volume, in practice, this invention directly calculates C. max The discrete integral of the product of the enclosed pixel area and the DEM normalized elevation. The DEM normalized elevation is defined in formula (7) as H. Cmax With C max The elevation Z of the m pixels enclosed i The difference between (i = 0, 1, ..., m). Formula (8) is calculated as shown in the diagram. Figure 5 As shown.
[0112] f SI (C) Used to evaluate the roundness of the contour shape. Ideally, the contour of an impact crater should be as close to a circle as possible; therefore, f SIThe value of (C) should be close to its minimum. When the outline is irregular, the shape index will increase, indicating that the shape differs significantly from a circle. The calculation formula is as follows:
[0113]
[0114] Where P is the perimeter of the polygon with outline C, and A is the area of the polygon. For a circle, the shape index f SI (C) equals 1, and the shape index value will gradually increase as the contour shape becomes more complex or irregular.
[0115] f compact (C) The ratio of the area of the convex hull of the contour polygon to its own area is used to evaluate the regularity of the shape. The convex hull is the smallest convex polygon that can completely contain the contour polygon. Ideally, the contour of an impact crater should be a convex polygon, so this ratio should be close to 1. When there is a significant indentation in the contour, the area of the enclosed polygon will be significantly smaller than the area of the convex hull. The formula is defined as:
[0116]
[0117] Among them, A total A represents the actual area of the polygon. convex Let be the area of the convex hull of the polygon.
[0118] P boundary The proportion of the bounding box points in the contour is used as a penalty term to limit the optimization algorithm from including the bounding box in the impact crater contour. Its formula is defined as:
[0119]
[0120] Where N boundary N represents the number of points near the image boundary. total Let be the total number of points in the contour, λ be the penalty factor (λ > 0), and T' be the threshold for the proportion of boundary points. When the proportion of points within the bounding box of the impact crater contour C exceeds the threshold, the penalty term is not zero, and the larger the proportion of bounding box points, the larger the penalty term value.
[0121] Formula (6) consists of multiple objective terms, making it a typical multi-objective optimization problem. When calculating key indicators such as regularity, boundary point ratio, and volume, contour detection and geometric shape calculation are used. These calculation operations are inherently nonlinear and difficult to optimize using explicit expressions or analytical gradients. Therefore, a global optimization algorithm is needed that can handle both multi-objective optimization problems and nonlinear objective functions. This invention selects the Bayesian optimization algorithm for solving this problem.
[0122] The Bayesian optimization iterative process is described as follows:
[0123] 1) Initialization
[0124] Randomly select n initial points (contour line interval Δh) i The objective function F(Δh) is evaluated at each point, forming the initial dataset.
[0125] 2) Constructing an alternative model
[0126] Fit a Gaussian process (GP) to dataset D to approximate the objective function F(Δh). An alternative model is defined as follows:
[0127]
[0128] Here, m(Δh) is the mean function, usually set to a constant "0". k(Δh,Δh') represents the covariance function, usually chosen as the squared exponent kernel. Variables Δh and Δh' represent the interval values of two contour lines in the parameter space.
[0129] 3) Calculate and maximize the acquisition function
[0130] This invention utilizes a Gaussian process substitution model to predict the next evaluation point Δh by maximizing the acquisition function. next The definition is as follows:
[0131]
[0132] Where EI(·) represents the desired improvement in the acquisition function. The operator E[·] calculates the expected improvement value max(F(Δh)). + )-F(Δh),0)
[0133] Where F(Δh) is modeled as a Gaussian random variable F(Δh) ~ N(μ(Δh),σ) based on Gaussian process prediction. 2 (Δh)). Term F(Δh) + ) represents the best target value observed so far.
[0134] 4) Evaluate the objective function and update the alternative model.
[0135] This invention is in Δh next Calculate the objective function and update the dataset D←D∪{(Δh)}. next ,F(Δh next Then, the Gaussian process model is refitted using the updated D. This process from steps 1) to 4) is repeated until a predefined number of iterations is reached. In this invention, we set the maximum number of iterations to 15 to obtain the optimal contour interval Δh. *Through the above iterative process, the Bayesian optimization algorithm can minimize the objective function (6) and obtain the optimal solution of Δh, thereby extracting the closest contour line of the impact crater. In specific implementation, the initial value of the objective function directly affects the final optimization result. Therefore, this invention limits the range of values for the contour interval Δh based on the proportional coefficient of the maximum elevation difference within the contour line, and applies the Bayesian optimization algorithm to search for the optimal solution within this range. Its expression is as follows:
[0136] Δh∈[k1(H max -H min ),k2(H max -H min )](14)
[0137] Where H max and H min Let k1 and k2 be the maximum and minimum elevation values within the contour, respectively, and k1 and k2 be the proportional coefficients of the maximum elevation difference, which are set to 1 / 7 and 1 / 2 in this invention. After optimizing the objective function, the adaptive elevation difference used for DEM enhancement can avoid as much as possible... Figure 6 To address the issues of missegmentation and undersegmentation observed in (a), accurate extraction of the outer contour of the impact crater is achieved under unsupervised methods, as shown in the following results. Figure 6 As shown in (b).
[0138] 3. Progressive correction of impact crater boundary boxes
[0139] Since impact crater bounding boxes are typically obtained through target detection based on depth models or by cropping from remote sensing imagery using coordinates and diameters from existing cataloged data, the position and size of the bounding boxes may be inaccurate, resulting in the impact crater target not being fully enclosed or containing too many non-impact crater regions within the bounding box. To address this issue, this invention proposes an algorithm for automatically adjusting the position and size of impact crater bounding boxes. This algorithm analyzes the topological relationship between the foreground and the bounding box, adaptively adjusting the position and size of the bounding box until the impact crater is completely and compactly enclosed within a suitable bounding box, thereby outputting more accurate impact crater location, size, and segmentation results. For the two cases of impact crater targets not being fully enclosed or containing too many non-impact crater regions within the bounding box, the bounding box correction algorithm of this invention is as follows:
[0140] (1) The impact crater is not completely contained within the bounding box.
[0141] Cases where the target is not completely enclosed by a bounding box mainly fall into two categories: the bounding box is too small relative to the target, and the frame position is offset. The former is manifested by the foreground of the impact crater intersecting with both sides of the bounding box, while the latter is manifested by the foreground of the impact crater intersecting with one side of the bounding box. This invention determines the intersection of the impact crater foreground outline with the frame in both the horizontal and vertical directions. Figure 7 As shown, Figure 7(a) and 7(b) respectively demonstrate the cases where the bounding box is too small (the bounding box intersects with both sides of the impact crater) and the case where the position is offset (the bounding box intersects with one side of the impact crater); Figure 7 (c) and 7(d) illustrate cases where the target is too small and its position is offset in the vertical direction. All frame offsets can be decomposed into horizontal and vertical directions for separate analysis. Taking the horizontal direction as an example, if the foreground of the impact crater intersects with both sides of the bounding box, the algorithm will iteratively expand the bounding box to both sides with a step size of 1 / 10 of the current bounding box width. In each iteration, the impact crater contour is extracted using the "adaptive contour optimization" algorithm until the impact crater contour no longer contacts the bounding box. The iterative process is as follows: Figure 8 As shown in (a). If the impact crater foreground only intersects one side of the bounding box, the algorithm will calculate the horizontal deviation between the geometric center of the bounding box and the centroid of the impact crater foreground, and adjust the frame position accordingly. In each iteration, the impact crater contour is extracted using the "adaptive contour optimization" algorithm until the contour leaves the frame edge. The iterative process is as follows: Figure 8 As shown in (b). Finally, the bounding box is tightened according to the coordinate range of the complete crater outline in the expanded bounding box, so that the crater foreground is tightly surrounded by the bounding box. Figure 8 The gray dashed border represents the expanded range of the impact crater bounding box after each iteration. Based on the expanded range shown by the dashed border, the corresponding region is cropped from the HRSC DEM data, and the next iteration is performed until the optimal impact crater bounding box shown by the gray solid line is obtained.
[0142] (2) The bounding box contains too many non-crater areas.
[0143] When the bounding box contains too many non-crater regions, the foreground contour of the crater will not intersect with the bounding box. In this case, the problem can be solved simply by shrinking the bounding box according to the coordinate range of the contour.
[0144] 4. Segmentation of the internal structure of impact craters based on SAM
[0145] Martian impact craters can be classified into basin-type, simple-type, and complex-type based on their internal morphological characteristics. Basin-type craters are not discussed in this invention due to their large size and extremely limited number. Simple-type impact craters are typically bowl-shaped, with their lowest point usually close to their geometric center, such as... Figure 9 (a) Complex impact craters have steeply sloping walls and gently sloping floors, with a relatively clear boundary between the two. Based on the topographical features of their floors, they can be further subdivided into flat-bottomed types, such as... Figure 9 (b) Central peak type, such as Figure 9 (c) Central pit type, such as Figure 9(d) Three types. The flat-bottomed crater has the smallest slope and the largest area. The central peak type and the central pit type have local bulges and depressions at the center of the crater bottom, respectively. The internal structures of the above different types of impact craters are not clearly defined in the original DEM data of HRSC, which makes it difficult for various segmentation algorithms to accurately segment their structures. However, based on the impact crater contour extraction results of this invention, for the foreground area within the impact crater contour, the DEM enhancement algorithm can generate nested dense contour lines in the crater wall area where the elevation decreases rapidly, while suppressing the generation of contour lines in the relatively flat crater bottom area. When the local area of the crater bottom is a central peak with a sudden increase in elevation or a central pit or sub-crater with a sudden decrease in elevation, a closed contour line will appear in the relevant area of the crater bottom, such as... Figure 9 The intermediate subgraphs are shown in (c) and 9(d).
[0146] Based on the generation of a series of contour lines for the impact crater foreground, this invention employs the SAM model to segment the internal topographical structure of the impact crater foreground. SAM is a cue-based VIT model that, trained on the SA-1B dataset containing 11 million images, can perform efficient semantic-free image segmentation without specific labeled data. This invention inputs the impact crater foreground extracted from the crater contour using a Bayesian optimization algorithm into the SAM model and adopts a "segment everything" mode, uniformly selecting 32×32 points across the entire image region as cues, outputting a segmentation mask covering the entire image. The segmentation results of the SAM model are shown in [link to SAM model documentation]. Figure 9 The rightmost column of results shows that for simple pits, the model can segment the pit walls and the lowest elevation point inside. For complex pits, it can segment the boundary between the pit walls and the pit bottom, as well as the central peak and central pit within the pit bottom. However, the unsupervised SAM model cannot predict the segmentation semantics. It needs to infer based on the topological relationships between different segmentation masks, which correspond to the pit walls, pit bottom, and central peak / central pit from the outside in, respectively, thus assigning specific semantic information to different segmentation masks.
[0147] Example
[0148] 1. Digital Elevation Model Remote Sensing Imagery
[0149] This invention selects 50m spatial resolution digital elevation model (DEM) images acquired by the High Resolution Stereo Camera (HRSC) aboard the Mars Express orbiter as the research dataset. This dataset is open-source and includes images of Mars... Figure 10The area shown by the dashed box represents the open-source region of the HRSC imagery, and the area within it, framed in red, is the study area of this invention. This invention further selects the area shown in the red box as the study area. This region is located between 67.5° and 90° east longitude and 0° and 30° north latitude on Mars, situated at the intersection of Arcadia Planitia, Syrtis Major Planum, and Isidis Planitia, exhibiting high geomorphological diversity. Consequently, this region contains impact craters of different ages and tectonic types, effectively validating the robustness of the method of this invention.
[0150] 2. Cataloging data
[0151] This invention further utilizes the RH2012 Mars impact crater catalog vector catalog data to initially locate the impact crater detection bounding boxes. Corresponding HRSC DEM images are then cropped from this data and used as input to the algorithm of this invention to extract the foreground contours of the impact craters, adaptively detect the precise range of the foreground targets, and ultimately segment the internal structure of the impact craters. This catalog data was last updated in 2020 and records in detail the precise coordinates and diameter information of all impact craters on the Martian surface with a diameter exceeding 1 km. This invention is based on... Figure 10 The latitude and longitude range of the study area was determined by selecting the center coordinates and diameters of all impact craters within the study area from the RH2012 catalog data. Based on this, the corresponding areas were cropped in the HRSC DEM image. Specifically, the impact crater coordinates in the catalog vector data were used as the center of the map frame, and the diameter was used as the width and height of the map frame. The position indices of the four corner points of the map frame in the HRSC DEM image were calculated, and cropping was performed accordingly.
[0152] Evaluation indicators
[0153] This invention employs three metrics, including mean intersection-union ratio (mIoU), mean F1 score (mF1-score), and mean normalized Hausdorff distance (mNHD), to quantitatively evaluate the proposed crater contour extraction and bounding box refinement algorithm.
[0154] 1.mIoU
[0155] mIoU is defined as the average of the crossover ratios (IoU) of all impact craters, as follows:
[0156]
[0157] Where N represents the number of impact craters. TP i FP i and FN i Let represent the values of the true positive, false positive, and false negative examples of the i-th Martian crater, respectively.
[0158] 2.mF1-score
[0159] The mF1-score aims to balance the precision and recall of extracted crater contours. It is obtained by averaging the F1 scores of all craters.
[0160]
[0161] For the i-th extracted crater outline, denoted as and its corresponding manually marked real outline and Intersecting pixels are considered real instance pixels and denoted as TP. i False negative pixel FN i By from Subtract TP from the middle i To calculate, and the false positive pixel FP i Then through from Subtract TP from the middle i To obtain. Based on these definitions, the precision and recall of the i-th predicted impact crater are defined as follows: and It is important to note that both mIoU and mF1-score are defined and calculated at the pixel level.
[0162] 3.mNHD
[0163] The mean normalized Hausdorff distance (mNHD) is used to quantify the predicted crater profile C. p With true outline C g The maximum difference between the two contours. The basic Hausdorff distance between these two contours is defined as follows:
[0164]
[0165] in, and Let represent the sets of vertices for the predicted and actual crater outlines, respectively. “sup” and “inf” denote the supremum and infmere, respectively, and “||·||” denote the Euclidean distance between the predicted and actual outline vertices. To mitigate the influence of crater size, the normalized Hausdorff distance (nHD) is obtained by dividing the Hausdorff distance by the diagonal of the crater bounding box. Then, mNHD is defined as the average of the nHD values for all craters.
[0166]
[0167] Among them, nHD i Let represent the normalized Hausdorff distance of the i-th crater.
[0168] Impact crater segmentation accuracy assessment
[0169] 1. Optimizer Comparison Experiment
[0170] Table 1 presents a quantitative comparison of the performance of five different optimization algorithms in contour extraction tasks, with evaluation metrics including mIoU, mF1-score, mNHD, and time cost. It can be observed that Bayesian optimization (BO) is clearly the best choice if accuracy is the primary concern. Differential evolution (DE) provides a compromise for applications requiring a faster yet still efficient solution. While the Nelder-Mead (NM) algorithm is fast, it performs significantly worse in terms of contour quality, making it less suitable for applications with high accuracy requirements. Particle swarm optimization (PSO) and genetic algorithms (GA) perform at a moderate to slightly above-average level in terms of accuracy, with mIoU and mF1-score slightly lower than BO and DE, but better than NM. However, PSO and GA have relatively long running times (approximately 1 second per impact crater), resulting in lower computational efficiency.
[0171] Table 1. Contour extraction accuracy and efficiency under different optimizers
[0172]
[0173] 2. Comparison of contour extraction before and after DEM enhancement
[0174] To demonstrate the effectiveness of the proposed adaptive contour interval, this invention compares it with two methods: a method without enhancement and a method with fixed contour intervals. For the method without enhancement, Otsu binarization followed by Suzuki contour extraction is applied to extract impact crater contours from the original HRSC DEM image. For the fixed contour extraction method, the HRSC DEM visualization is enhanced by setting the contour interval to 1 / 4 of the maximum elevation difference. Both methods are used to extract the contours of all impact craters. Figure 11 Nine randomly selected impact crater samples were shown for comparison.
[0175] Contour extraction results show that the non-enhanced method is relatively accurate in extracting the edges of small and regularly shaped impact craters, such as... Figure 11 As shown in (c)-(e), this accuracy is mainly due to the relatively simple height distribution of these impact craters, with the foreground pixels extracted by the Otsu method closely aligned with the impact crater regions. However, for large, irregularly shaped impact craters, the height distribution pattern is more complex, and the simple threshold binarization of the Otsu method struggles to accurately extract the impact crater edges, such as... Figure 11 As shown in (a), (f) and (g).
[0176] Furthermore, experimental results show that the fixed contour interval method cannot accurately extract the contours of all samples. When the contour interval value is too small, the elevation subdivision is too detailed, leading to confusion between background terrain details or image boundaries and actual impact crater boundaries, such as... Figure 11 As shown in (a)-(e). Conversely, when the contour interval is too large, the elevation division in the DEM data becomes too sparse, resulting in insufficient contour density. The outermost contour lines may deviate significantly from the actual impact crater boundaries, leading to conservative boundary extraction that underestimates the actual impact crater area and size, such as... Figure 11 As verified in (f)-(i). In contrast, the adaptive contour interval method can adaptively determine a reasonable contour interval Δh. * The extracted contour more accurately approximates the actual impact crater boundary.
[0177] Table 2 Comparison of accuracy and efficiency of impact crater contour extraction under different enhancement methods
[0178]
[0179] 3. Comparative Experiment of Contour Extraction Methods
[0180] To demonstrate the superiority of the proposed contour extraction method, this invention compares it with two classic contour extraction algorithms: the depression filling method and the watershed method. Quantitative results are shown in Table 3. Compared to the depression filling method, the proposed method improves performance by 10.26% and 5.93% in mIoU and mF1-score, respectively. Compared to the watershed method, the proposed method shows even more significant improvements in mIoU and mF1-score, reaching 60.01% and 48.35%, respectively. These results indicate that the proposed method significantly outperforms these two baseline methods, exhibiting higher accuracy in terms of spatial coverage consistency with reality. Regarding maximum contour deviation, measured by mNHD, the proposed method reduces deviation by more than 50% compared to the depression filling and watershed methods.
[0181] While the watershed method boasts high computational efficiency, processing each impact crater in just 0.01 seconds, it is highly sensitive to noise in DEM images, such as noise caused by fragmented terrain and other factors. This sensitivity leads to oversegmentation and contour shrinkage of foreground impact craters. Depression-filling methods, though superior to the watershed method, perform poorly in terms of mNHD values, particularly when handling degraded or irregularly shaped impact craters, making them less effective for complex contour extraction tasks. In contrast, the method of this invention achieves optimal performance by simultaneously considering spatial coverage and conformity to the contour shape of the real-world situation. This allows the method to robustly adapt to various types of impact craters, including those with complex and irregular morphologies.
[0182] To visually compare the performance of these three methods on impact craters of different sizes, shapes, and degrees of degradation, this invention selected nine representative impact craters from the study area and extracted their contours using the depression-filling method, the watershed method, and the method proposed in this invention. Figure 12 As shown, the method of this invention outperforms other methods on various types of impact craters. Depression-filling methods tend to overfit, often misclassifying surrounding terrain as part of the impact crater profile. Conversely, watershed methods generate profiles that are too conservative and fail to accurately capture the true impact crater edges. In contrast, the method of this invention demonstrates robustness by effectively delineating impact crater boundaries, achieving higher accuracy even for complex and irregular morphologies.
[0183] Table 3. Accuracy and efficiency of different contour extraction methods
[0184]
[0185] 4. Objective function ablation experiment
[0186] To verify the effectiveness of the sub-terms in the objective function (6), this invention designed an ablation experiment. By retaining other sub-terms while removing ablation terms one by one from the objective function, the potential impact of the ablated sub-terms on the final impact crater optimization results was analyzed. Specifically, while retaining other terms, the crater filling ratio f in the objective function (6) was removed. volume Shape index f SI convex hull area ratio f compact And penalty item P boundary Furthermore, a qualitative comparative analysis was conducted with the objective function containing all sub-items to intuitively evaluate the contribution of each sub-item to the accuracy of impact crater edge extraction, as well as its impact on the final optimization result.
[0187] Eliminate f from the objective function volume The result is as follows Figure 13 The third column shows the contours of impact craters (c) and (e) compared to the results optimized based on the complete objective function. Figure 13 The first column (in the middle section) has more severe defect problems, with large areas of depressions not included in the contour. The ablation of f from the objective function... SI The result is as follows Figure 13 As shown in the fourth column, the optimization algorithm lacking a shape index as the objective function made errors in the contour extraction of impact craters (b) and (e). The contour of impact crater (b) was confused with the bounding box boundary, and the irregular terrain boundary inside impact crater (e) was incorrectly extracted as a contour. Furthermore, both of these erroneous contours exhibited large shape indices. (The last sentence appears to be incomplete and possibly refers to the process of absolving f from the objective function.) compactThe result is as follows Figure 13 As shown in the fifth column, the contour of impact crater (a) exhibits erroneous local depressions, while the result optimized based on the complete objective function shows higher contour compactness and does not show similar problems. The ablation of P from the objective function... boundary The result is as follows Figure 13 As shown in the sixth column, the contours of impact craters (b) and (d) are incorrect, mistakenly treating the frame boundary as part of the contour, thus verifying the necessity of the penalty term in the objective function.
[0188] This invention also conducted quantitative ablation studies to demonstrate the importance of each energy function term. As shown in Table 4, the accuracy of the impact crater profile (measured by mIoU and mF1-score) exhibited a monotonically decreasing trend as each energy term gradually decreased. Specifically, mIoU decreased from a maximum of 0.6975 to a minimum of 0.6876, while mF1-score decreased from 0.8051 to 0.7966. In contrast, mNHD increased from an optimal value of 0.1148 to a worst value of 0.1183.
[0189] Ablation studies show that removing three terms—boundary constraint, shape regularity, and circularity—results in a modest decrease in mIoU and mF1-score, less than 2%. Notably, since most Martian impact craters are located within the DEM image, the boundary constraint term has a limited impact on these craters. However, for the few craters near the image boundaries, this term effectively prevents the generation of crater contours from boundary pixels. The shape regularity and circularity terms encourage the generation of approximately convex hull and circular crater contours, thereby maximizing their geometric accuracy. It is worth noting that the depression filling term F... vol The true edge of the impact crater shape is primarily determined, as demonstrated in the contour extraction accuracy in the last row of Table 3.
[0190] Table 4. Experimental Results of Ablation Based on Objective Function
[0191]
[0192] 5. The Influence of Size and Shape Complexity on Contour Extraction Accuracy
[0193] To investigate the relationship between contour extraction accuracy and impact crater complexity, this invention evaluated how contour extraction performance varies with impact crater size and degradation. Quantitative statistical results are shown in Table 5 and... Figure 14As shown, the contour extraction accuracy is closely related to the degree of degradation; the lower the degree of degradation, the higher the accuracy. Compared with the most degraded impact crater (Level 1), the least degraded impact crater (Level 4) shows a 29.55% improvement in mIoU and a 19.13% improvement in mF1-score. Meanwhile, the maximum deviation between the extracted contour and the true contour gradually decreases from 0.1675 at Level 1 to 0.0624 at Level 4. This trend of increasing accuracy with decreasing degradation is evident in… Figure 14 This is reflected in the three trend lines in (a). The main reason is that the shape of the impact crater becomes increasingly blurred and indistinct as the degree of degradation increases.
[0194] To evaluate the relationship between contour extraction accuracy and impact crater size, this invention roughly divided the impact craters in the experiment into three major groups: 3-5 km, 5-10 km, and ≥10 km. As shown in Table 3, the mIoU and mF1-score values were relatively stable in these three categories, approximately 0.69 and 0.80, respectively. This trend was further... Figure 14 (a) shows the support of nearly flat lines. Superficially, contour extraction accuracy appears unrelated to impact crater size. However, expertise indicates that larger impact craters typically result in higher contour extraction accuracy due to their more stable and prominent morphological features. Surprisingly, the larger size category did not show an improvement in accuracy. To explore the potential reasons for this difference, this invention analyzes the degradation distribution of the three impact crater size categories, such as... Figure 14 As shown in (c), larger impact craters have a higher proportion of severely degraded samples. Given the inverse relationship between degradation and accuracy, this explains why larger impact craters did not exhibit the expected higher contour extraction accuracy.
[0195] Table 5 shows the quantitative comparisons that vary with the size and morphological complexity of the impact crater.
[0196]
Claims
1. A method for extracting the contour lines of Martian impact craters with adaptive contour spacing optimization, characterized in that, Includes the following steps: Step 1: Acquire Mars DEM images and perform data augmentation processing to obtain processed image data; Step 2: Extract and optimize the impact crater contours of the processed image data using the Bayesian optimization algorithm to obtain the optimized impact crater contours; Step 2 specifically includes the following steps: Step 2.1: Determine the optimal threshold based on the Otsu thresholding method, select the threshold that maximizes the inter-class variance, and realize dynamic threshold binarization; Step 2.2: Use the Suzuki contour tracking algorithm to obtain all potential closed contours of the impact crater terrain region; Step 2.3: Optimize the contour based on adaptive contour interval. By constructing an objective optimization function, the optimal contour interval is determined by comprehensively considering factors such as the volume of the impact crater area, the roundness and compactness of the crater contour line, and the constraints of the bounding point of the drawing frame. The closed contour line that best matches the contour characteristics of the impact crater is extracted to obtain the optimized impact crater contour. Step 2.3 specifically involves constructing the following objective function: (6) in, According to The generated contour lines are initially set to... ; This represents the percentage of the filling volume; the larger the filling volume within the outline, the smaller this item becomes. This is the shape index of the polygonal shape enclosed by the outline; the closer the outline shape is to a circle, the smaller this term becomes. This is the ratio of the area of the convex hull of the polygon to its own area; the more compact the shape of the polygon, the smaller this term. This is a penalty term, representing the proportion of points on the edge bounding box to points on the contour, used to penalize confusion between the bounding box and the contour; the higher this proportion, the larger the objective function value; the objective is to minimize the objective function to obtain the optimal contour interval. This makes the optimized contour It gets closer to the actual edge of the impact crater; contour The volume of the depression in the enclosed area To reflect the relationship between the area and depth of a region, when calculating the volume of the filled depression, the area of each pixel is first multiplied by the depth after filling, and then... Integrating the volumes of all pixels within the region yields the final depression-filling volume, theoretically calculated as follows: (7) Where z(x, y) represents the elevation value of the DEM data within the depression area. R is the uniform elevation value after filling the depression, R is the projected area of the depression in the vertical direction, and dx and dy are the resolution / differential of the remote sensing image in the x and y directions, respectively. Use outline Average elevation of all points To approximate the impact crater contour C and maintain the filling volume, the feature shown in formula (8) is constructed. : (8) in, Let C be the volume of the prism enclosed by the contour line of the impact crater. To assess the roundness of the contour shape, the contour of the impact crater should be close to a circle. The value should be close to the minimum. When the outline is irregular, the shape index will increase, indicating that the shape differs greatly from a circle. The calculation formula is as follows: (9) in, For outline The perimeter of the polygon. Let be the area of the polygon, and for a circle, the shape index. The value of the shape index is equal to 1, and the more complex or irregular the outline shape is, the greater the value of the shape index will be. The ratio of the area of the convex hull of a polygon's outline to its own area is used to evaluate the regularity of the shape. The convex hull is the smallest convex polygon that completely encloses the polygon. The outline of an impact crater should be a convex polygon, so this ratio should be close to 1. When there is a significant indentation in the outline, the area of the enclosed polygon will be significantly smaller than the area of the convex hull. The formula is defined as follows: (10) in, Represents the actual area of the polygon. Let be the area of the convex hull of the polygon; The proportion of the bounding box points in the contour is used as a penalty term to limit the optimization algorithm from including the bounding box in the impact crater contour. Its formula is defined as: (11) Where N boundary N represents the number of points near the image boundary. total The total number of points on the outline. For the penalty factor ( >0), The threshold for the proportion of boundary points is used when the impact crater outline... The percentage of points within the bounding box exceeds the threshold. When the penalty term is not zero, the larger the proportion of points in the graph frame, the larger the penalty term value. Step 3: Perform progressive correction on the optimized impact crater profile; Step 4: Based on the unsupervised SAM model and the morphology and topological relationship of the internal landform elements of the impact crater, the internal structure of the corrected impact crater bounding box is segmented to complete the extraction of the Martian impact crater outline.
2. The method for extracting Martian impact crater contours with adaptive contour spacing optimization according to claim 1, characterized in that, Step 1 specifically involves: First, segmenting the elevation range of the DEM data. Let the input DEM data matrix be P, and its elevation value range be [H]. min H max The elevation values are divided into n contour segments, and the contour interval Δh of each segment is defined as follows: (1) Among them, H min and H max These represent the lowest and highest elevation values in the DEM data, respectively, where n is the number of contour interval segments. For each pixel in the DEM data, its elevation value P i,j The elevation value P' is moduloed with the contour interval Δh to map it to a new interval range, making the boundary differences more obvious; the mapped elevation value P' i,j The calculation formula is as follows: (2) Modular operation The elevation values are reclassified to the range [0, Δh]; this is achieved by multiplying the reclassified values by... ,Will The value is limited to the range [0, 255]. After mapping, the elevation value between each contour interval will be mapped to the range of 0-255, so that different contour intervals visually form a layered nested contour line.
3. The method for extracting Martian impact crater contours with adaptive contour spacing optimization according to claim 1, characterized in that, Step 2.1 specifically involves determining the optimal threshold using the Ostu thresholding method. , value greater than The pixels defined are assigned to the impact crater boundary, and the rest are assigned to the background. The objective function of the Otsu thresholding method is to maximize the inter-class variance, and the specific formula is as follows: (3) in, and These represent the proportions of pixels in the background and the crater boundary, respectively. and These represent the average grayscale values of the background and the impact crater boundary pixels, respectively.
4. The method for extracting Martian impact crater contours with adaptive contour spacing optimization according to claim 1, characterized in that, Step 2.2 specifically involves: using the Suzuki contour tracking algorithm to obtain all potential closed contours of the impact crater terrain region; The outline of a closed impact crater This represents a set of points connected according to topological relationships, as shown in formula (4): (4) in, For the first A closed contour Total number of points included; The Douglas-Peucker algorithm is used to simplify all potential closed contours. While ensuring that the shape remains unchanged within the allowable tolerance range, reduce the number of polygons. The vertices are simplified to a compact and lightweight representation of the geometry, and the tolerance parameter of the Douglas-Peucker algorithm is expressed using formula (5). : (5) in The scaling factor is set to 0.
001. For outline The perimeter.
5. The method for extracting Martian impact crater contours with adaptive contour spacing optimization according to claim 1, characterized in that, In step 2, the Bayesian optimization algorithm is specifically as follows: Random selection The initial point is the interval of the contour line. Evaluate the objective function at each point and form the initial dataset. ; Fit a Gaussian process GP to a dataset To approximate the objective function The alternative model is defined as follows: (12) in, It is the mean function. Represent the covariance function, choose the squared exponent kernel, and the variable... and This represents the interval between two contour lines within the parameter space; The Gaussian process substitution model is used to predict the next evaluation point by maximizing the acquisition function. The definition is as follows: (13) in, This indicates a desire to improve the acquisition function, operator Calculate the expected value of the improvement ,in The prediction based on Gaussian processes is modeled as a Gaussian random variable. ,item This represents the best target value observed to date. exist Calculate the objective function and update the dataset. Use the updated version Refit the Gaussian process model; Based on the proportional coefficient of the maximum elevation difference within the contour line outline, the range of values for the contour interval Δh is defined, and the Bayesian optimization algorithm is applied within this range to search for the optimal solution, as expressed below: (14) in and These are the maximum and minimum elevation values within the outline, respectively. and These are the proportional coefficients for the maximum elevation difference.
6. The method for extracting Martian impact crater contours with adaptive contour spacing optimization according to claim 1, characterized in that, Step 3 specifically involves: analyzing the topological relationship between the foreground and the bounding box, adaptively adjusting the position and size of the bounding box until the impact crater is completely and compactly surrounded by a suitable bounding box, thereby outputting accurate impact crater position, size, and segmentation results.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method of claim 1.