An efficient pixel filling method and system based on adaptive boundary detection technology

Through adaptive multi-scale grid division, minimum cut algorithm and deep learning technology, the boundary detection resolution and filling step size are dynamically adjusted, which solves the problems of low pixel filling efficiency and insufficiently accurate boundary detection in the existing technology, and achieves efficient and Accurate pixel fill effects.

CN119068007BActive Publication Date: 2025-01-24NANJING ARTIFICIAL INTELLIGENCE CHIPS RES INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411579976.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-01-24
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

The prior art, when processing complex images, pixel filling efficiency is low and boundary detection is not accurate enough, making it difficult to find a balance between speed and accuracy.

Method used

Put forward an efficient pixel filling method for adaptive boundary detection technology, through adaptive multi -scale grid division, minimum cutting algorithm, local frequency analysis, improved scanning line algorithm and deep learning -based image enhancement technology, dynamically adjust boundary detection Resolution and filling steps to achieve efficient pixel filling.

Benefits of technology

Improve the efficiency and accuracy of the pixel filling, reduce unnecessary calculations, and achieve high -precision boundary processing and rapid pixel filling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068007B_ABST
    Figure CN119068007B_ABST
Patent Text Reader

Abstract

The present invention discloses an efficient pixel filling method and system of adaptive boundary detection technology, the method comprising obtaining original image data and performing preprocessing and initialization to obtain processed image data; performing adaptive multi-scale grid division to obtain initial grid division data; constructing an energy function; using a minimum cut algorithm to solve the optimal segmentation of the energy function to obtain a region segmentation result; performing post-processing to obtain filling region division data; performing local frequency analysis on each filling region to obtain an analysis result; dynamically adjusting the boundary detection resolution to obtain adaptive resolution data; performing initial sampling and curve subdivision on the boundary of each filling region to generate a fine boundary point set; executing an improved scan line algorithm to perform region filling to obtain a filling result; merging the filling results to obtain filling data of the entire image. The present invention improves the pixel filling efficiency of the image and also realizes high-precision boundary processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image processing, and in particular to an efficient pixel filling method and system of an adaptive boundary detection technology. Background Art

[0002] In computer graphics, pixel filling is one of the basic steps in generating and rendering images. Traditional pixel filling algorithms are usually based on scan line, flood filling or recursive algorithms. These methods are often inefficient when processing complex images, especially in terms of the speed and accuracy of boundary detection and pixel filling. Existing technologies are difficult to ensure the filling speed while taking into account the boundary accuracy and filling integrity of complex graphics.

[0003] Therefore, an innovative method that can efficiently handle pixel filling and accurately handle boundaries is urgently needed. Summary of the invention

[0004] The purpose of the invention is to propose an efficient pixel filling method and system based on adaptive boundary detection technology to solve the above-mentioned problems existing in the prior art.

[0005] Technical solution, an efficient pixel filling method using adaptive boundary detection technology, comprising the following steps:

[0006] S1, obtaining original image data, preprocessing and initializing the original image data to obtain processed image data; based on the processed image data, performing adaptive multi-scale grid division to obtain initial grid division data;

[0007] S2. Based on the initial grid division data, a similarity graph of image pixels is constructed. Based on the similarity graph, an energy function including data terms and smoothing terms is constructed; the minimum cut algorithm is used to solve the optimal segmentation of the energy function to obtain a preliminary region segmentation result; the preliminary region segmentation result is post-processed to obtain the final filling region division data;

[0008] S3, performing local frequency analysis on each filling area in the filling area division data to obtain analysis results; based on the analysis results, dynamically adjusting the boundary detection resolution to obtain adaptive resolution data;

[0009] S4. Perform initial sampling and curve subdivision on the boundary of each filling area in the filling area division data to generate a fine boundary point set; based on the boundary point set and adaptive resolution data, execute the improved scan line algorithm to perform area filling to obtain the filling result; merge the filling results to obtain the filling data of the entire image.

[0010] An efficient pixel filling system with adaptive boundary detection technology, comprising:

[0011] at least one processor; and,

[0012] a memory communicatively connected to at least one of the processors; wherein,

[0013] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the efficient pixel filling method of the adaptive boundary detection technology.

[0014] Beneficial effect: The present invention proposes an adaptive boundary detection technology, which dynamically adjusts the resolution of boundary detection by calculating the complexity of each filling area, reduces unnecessary calculations, and improves the pixel filling efficiency of the image; at the same time, it also achieves high-precision boundary processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flow chart of the present invention.

[0016] Figure 2 This is a flow chart of step S1 of the present invention.

[0017] Figure 3 This is a flow chart of step S2 of the present invention.

[0018] Figure 4 This is a flow chart of step S3 of the present invention.

[0019] Figure 5 This is a flow chart of step S4 of the present invention.

[0020] Figure 6 This is a pixel filling flow chart of the adaptive boundary detection technology according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] like Figure 1 As shown, the present application proposes an efficient pixel filling method using an adaptive boundary detection technology, comprising the following steps:

[0022] S1, obtaining original image data, preprocessing and initializing the original image data to obtain processed image data; based on the processed image data, performing adaptive multi-scale grid division to obtain initial grid division data;

[0023] S2. Based on the initial grid division data, a similarity graph of image pixels is constructed. Based on the similarity graph, an energy function including data terms and smoothing terms is constructed; the minimum cut algorithm is used to solve the optimal segmentation of the energy function to obtain a preliminary region segmentation result; the preliminary region segmentation result is post-processed to obtain the final filling region division data;

[0024] S3, performing local frequency analysis on each filling area in the filling area division data to obtain analysis results; based on the analysis results, dynamically adjusting the boundary detection resolution to obtain adaptive resolution data;

[0025] S4. Perform initial sampling and curve subdivision on the boundary of each filling area in the filling area division data to generate a fine boundary point set; based on the boundary point set and adaptive resolution data, execute the improved scan line algorithm to perform area filling to obtain the filling result; merge the filling results to obtain the filling data of the entire image.

[0026] like Figure 2 As shown, according to one aspect of the present application, step S1 is further:

[0027] S11, acquiring original image data, reading graphic features of the original image data, including width, height, and two-dimensional pixel matrix of the original image data; determining graphic processing parameters based on the graphic features and pre-stored device performance parameters, including minimum and maximum values ​​of graphic complexity, and minimum and maximum values ​​of resolution; storing the graphic processing parameters and the original image data as an initialization data set;

[0028] S12. Based on the initialization data set, use the Sobel operator to perform convolution operation to obtain horizontal gradient and vertical gradient; based on the horizontal gradient and vertical gradient, calculate the gradient amplitude of each pixel; calculate the average of the gradient amplitudes of all pixels as a global complexity index; add the global complexity index to the initialization data set to obtain an updated initialization data set;

[0029] S13, using the updated initialization data set as the initial grid and calculating the local complexity index; if the local complexity index is greater than a preset threshold, dividing the initial grid into a predetermined number of sub-grids; repeating the division process for each sub-grid until the local complexity index is less than the preset threshold, and obtaining the divided grid information; using a quadtree data structure to store the divided grid information as the initial grid division data.

[0030] In one embodiment of the present application, the original image data to be processed is obtained, and the width M, height N and two-dimensional pixel matrix I information of the original image data are read. According to the pre-stored device performance parameters and the current graphic features, the minimum value C of the graphic complexity is determined. min and the maximum value C max , and the minimum resolution R min and the maximum value R max . Store these parameters along with the original image data as an initialization dataset.

[0031] Get the initialization data set and calculate the global complexity index G of the entire image: Use the Sobel operator to perform convolution operation on the entire image to obtain the horizontal gradient G x and the vertical gradient G y . Calculate the gradient magnitude of each pixel G(x, y) = sqrt(G x 2 + G y 2 ), calculate the mean value of all pixel gradient amplitudes as the global complexity index G. Add the global complexity index G to the initialization data set.

[0032] Get the updated initialization data set and perform adaptive multi-scale grid division: regard the entire image as an initial grid, calculate the local complexity index L of the grid, and the local complexity index L is equal to the standard deviation of the gradient amplitude G(x, y) of all pixels in the grid. If the local complexity index L is greater than the preset threshold T (T=k*G, where k is a preset coefficient), the grid is divided into four sub-grids. Repeat this process for each sub-grid until the predetermined minimum grid size (such as 4x4 pixels) is reached or the local complexity index L is less than the threshold T. In this process, a quadtree data structure is used to store grid division information, and each leaf node corresponds to a final grid unit. The quadtree data structure is used as the grid division data, and together with the initialization data set, it constitutes the initial grid division data.

[0033] This embodiment determines the graphics processing parameters by reading the graphic features of the original image data and combining the device performance parameters, thereby ensuring that the image processing process can be optimized according to the performance of the device, thereby improving the processing efficiency and effect. By storing the graphics processing parameters and the original image data as an initialization data set, basic data support is provided for subsequent processing steps. The Sobel operator is used for convolution operation to obtain the gradients in the horizontal and vertical directions, and the gradient amplitude of each pixel is calculated, which can effectively extract the edge information of the image, and the mean of the gradient amplitudes of all pixels is calculated as the global complexity index, which provides an important basis for the complexity analysis of the image. The global complexity index is added to the initialization data set to further enrich the content of the data set. Through adaptive grid division, the grid size can be dynamically adjusted according to the local complexity of the image, thereby improving the accuracy and efficiency of image processing. The quadtree data structure is used to store the grid information after division as the initial grid division data. This data structure can efficiently manage and query grid information, which provides convenience for subsequent image processing and analysis. This embodiment can achieve efficient preprocessing and initialization of the original image data, laying a solid foundation for subsequent image analysis and processing. It not only improves the efficiency and accuracy of image processing, but also can dynamically adjust processing parameters according to the complexity of the image, thereby achieving better processing effects.

[0034] According to one aspect of the present application, step S13 is further:

[0035] S131, obtain the updated initialization data set, divide the image into overlapping blocks. According to the available computing resources, determine the number of blocks N and the overlap ratio O (such as 20%). Divide the image evenly into N blocks, and expand each block by a ratio of O at the edge to ensure overlap. Store the division information as image block data.

[0036] S132, obtain image block data, and process each image block in parallel. For each block, perform the following operations: calculate the local complexity index L of the pixels in the block, and if the local complexity index L is greater than a preset threshold T, divide the block into four equal parts. Repeat this process for each sub-block until a predetermined minimum block size is reached or the local complexity is less than the threshold. Use a quadtree structure to store the partition information of each block. Store the quadtree structure of all blocks as parallel partition data.

[0037] S133, obtain parallel partitioning data, and merge the partitioning results of the overlapping areas. For the overlapping areas of adjacent blocks, compare the partitioning details of the two blocks in the area. If the partitioning is inconsistent, select a more detailed partitioning. Use the graph cut algorithm to resolve the partitioning conflict and ensure the continuity of the overall partitioning. Convert the merged partitioning information into a unified quadtree structure as the initial grid partitioning data.

[0038] This embodiment achieves efficient initialization and preprocessing of the image by introducing adaptive multi-scale grid division technology. The complexity and resolution range are dynamically set according to the device performance and graphic characteristics to ensure the adaptability and scalability of subsequent processing. The quadtree structure is used to implement adaptive grid division, and smaller grids are used in detail-rich areas, and larger grids are used in smooth areas, which effectively balances the calculation accuracy and efficiency. The parallel implementation of adaptive multi-scale grid division improves the efficiency and accuracy of large-scale image processing. The image is divided into overlapping blocks, and then each block is processed in parallel, and the results are finally merged, which effectively utilizes the computing power of modern multi-core processors. The overlapping block strategy solves the boundary discontinuity problem in traditional parallel methods and ensures the global consistency of the division results. Parallel processing reduces the time complexity of grid division from O(MN) to O(MN / P), where M and N are the image sizes, and P is the number of parallel processing units. When processing high-resolution images, the speed is increased by 3-5 times. In particular, in adaptive boundary detection and pixel filling scenarios, it is possible to reduce redundant calculations in smooth areas while maintaining boundary accuracy. For example, for images containing complex textures and large uniform areas, the amount of calculation is reduced by 40%-60% compared to the traditional fixed grid method. In addition, the use of a quadtree structure to store partition information not only optimizes memory usage, but also provides an ideal initial structure for subsequent region segmentation and filling. In the merging stage, the graph cut algorithm is used to resolve partition conflicts, ensure the global consistency of the partition results, avoid the boundary discontinuity problem in the traditional parallel method, and further improve the accuracy of the results. In practical applications, when processing complex images containing multi-scale structures, the partition accuracy is improved by 15%-25%, while maintaining a high computational efficiency. For adaptive boundary detection and pixel filling tasks, high-quality initial grid division directly affects the effect of subsequent processing. The grid structure generated in this embodiment not only retains the detailed features of the image, but also provides an efficient data organization form, laying a solid foundation for the boundary detection and filling process. Through intelligent parallel preprocessing, the performance and adaptability of the algorithm in processing large-scale, complex scene images are improved, providing key technical support for the entire adaptive boundary detection and efficient pixel filling process.

[0039] like Figure 3 As shown, according to one aspect of the present application, step S2 is further:

[0040] S21. Based on the initial grid division data, use the Gaussian kernel function to calculate the color similarity and spatial distance similarity between grid units, combine the color similarity and the spatial distance similarity to obtain a comprehensive similarity; based on the comprehensive similarity, construct an undirected graph as similarity graph data;

[0041] S22, based on the similarity graph data, analyzing the color features of the grid unit; based on the color features and the pre-trained color model, calculating the data item of the energy function; based on the comprehensive similarity, calculating the smoothing item of the energy function; constructing the energy function based on the data item and the smoothing item; using the minimum cut algorithm to minimize the energy function, and obtaining the optimal segmentation label as the preliminary segmentation result data;

[0042] S23. Based on the preliminary segmentation result data, count the size of each area; for an area smaller than a preset threshold, calculate its similarity with the adjacent area, and merge the area smaller than the preset threshold into the adjacent area with the greatest similarity; repeat until there are no more areas smaller than the threshold, and obtain the segmentation result data; assign a unique identifier to each area of ​​the segmentation result data, and calculate the boundary pixel coordinates of the area; organize the identifier, size and boundary pixel coordinates of the area into fill area partition data.

[0043] In one embodiment of the present application, an initialization data set and grid division data are obtained to construct a similarity graph of image pixels. For each grid unit, its similarity with adjacent grid units is calculated. Specifically, the color similarity and spatial distance similarity between grid units are calculated using a Gaussian kernel function, and the two are combined to obtain a comprehensive similarity. An undirected graph G=(V, E) is constructed, where the vertex V represents the grid unit, the edge E represents the connection between the grid units, and the weight of the edge is the inverse of the comprehensive similarity. The constructed graph G is stored as similarity graph data.

[0044] Get the similarity graph data, define the energy function and use the minimum cut algorithm to segment the image. The energy function E(f) contains the data item E d (f) and the smoothing term E s (f), where f is the segmentation label. Data item E d (f) represents the probability that a grid cell belongs to a certain region, which is calculated based on the color features of the grid cell and the pre-trained color model. s (f) indicates the tendency of adjacent grid cells to have the same label, which is defined based on comprehensive similarity. Use a minimum cut algorithm (such as the Boykov-Kolmogorov algorithm) to minimize the energy function E(f) and obtain the optimal segmentation label f*. The optimal segmentation label f* is stored as the preliminary segmentation result data.

[0045] Get the preliminary segmentation result data and perform post-processing to obtain the final filling area division. Count the size of each segmented area (the number of grid cells it contains). For areas that are smaller than a preset threshold (such as 1% of the total number of grid cells), merge them into the most similar adjacent area. The similarity is calculated based on the average color difference and boundary length between regions. Repeat this process until there are no more areas smaller than the threshold. Assign a unique identifier to each region and calculate the boundary pixel coordinates of the region. Organize the information such as region identifier, region size, region boundary coordinates into filling area division data as filling area division data.

[0046] This embodiment uses a Gaussian kernel function to calculate the color similarity and spatial distance similarity between grid cells, and combines the two to obtain a comprehensive similarity, which can more accurately reflect the similarity of different regions in the image. Not only does it take into account color information, but it also combines spatial position information, making the similarity calculation more comprehensive and accurate. An undirected graph is constructed based on the comprehensive similarity, and the minimum cut algorithm is used to minimize the energy function, which can effectively achieve the preliminary segmentation of the image. The minimum cut algorithm can find the optimal segmentation label by minimizing the energy function, thereby obtaining preliminary segmentation result data, while ensuring segmentation accuracy, while improving calculation efficiency. By post-processing the preliminary segmentation result data, counting the size of each region, and merging the region less than the preset threshold into the adjacent region with the greatest similarity, it is possible to effectively eliminate the too small segmentation region, further optimize the segmentation result, ensure the coherence and consistency of the segmentation result, and improve the overall quality of the segmentation. Assigning a unique identifier to each region of the segmentation result data and calculating the boundary pixel coordinates of the region can provide accurate regional information for subsequent image processing and analysis, achieve fine segmentation and accurate identification of the image, and lay a solid foundation for subsequent image processing and analysis.

[0047] According to one aspect of the present application, step S21 is further:

[0048] S211, based on the initial grid division data, use the pre-trained deep convolutional neural network to extract feature maps; pool the values ​​of the area corresponding to each grid unit in each feature map to obtain a feature vector of fixed dimension; organize the feature vectors of all grid units into deep feature data;

[0049] S212, based on the deep feature data, calculating the feature similarity of each pair of adjacent grid cells; obtaining the spatial position of the grid cells and constructing the spatial distance weight; combining the feature similarity and the spatial distance weight to obtain the comprehensive similarity; storing the comprehensive similarity of all adjacent grid cell pairs as similarity matrix data;

[0050] S213, constructing an undirected graph based on the similarity matrix data; performing sparse processing on the undirected graph to obtain a processed undirected graph; and storing the processed undirected graph as similarity graph data.

[0051] In one embodiment of the present application, an initialization data set and grid partitioning data are obtained, and features are extracted using a pre-trained deep convolutional neural network. The image is input into the network, and feature maps of multiple convolutional layers are extracted. For each grid unit, the values ​​of its corresponding area in each feature map are pooled to obtain a feature vector of fixed dimension. The feature vectors of all grid units are organized into deep feature data.

[0052] Get the deep feature data and calculate the feature similarity between grid cells. For each pair of adjacent grid cells, calculate the cosine similarity of their feature vectors. At the same time, consider the spatial position of the grid cells and introduce spatial distance weights. Combine the feature similarity and spatial distance weights to get the comprehensive similarity. Store the comprehensive similarity of all adjacent grid cell pairs as similarity matrix data.

[0053] Get the similarity matrix data and construct a similarity graph. Create an undirected graph G=(V, E), where the vertex V represents the grid unit and the edge E represents the connection between adjacent grid units. The weight of the edge is set to the corresponding comprehensive similarity. Sparsely process the graph and only retain the connections of the K most similar neighbors of each vertex (K is a preset parameter). Store the processed graph structure as similarity graph data.

[0054] This embodiment achieves high-precision and high-efficiency image similarity graph construction by introducing a similarity measurement method based on deep learning. It is particularly suitable for adaptive boundary detection and pixel filling scenarios because it can accurately capture complex structures and subtle boundaries in images. A pre-trained deep convolutional neural network is used to extract multi-level image features, which contain rich information from low-level textures to high-level semantics, improving the accuracy and robustness of similarity measurement. Compared with traditional hand-designed features, deep learning features show advantages in processing complex textures and fuzzy boundaries, and the accuracy of similarity calculation is improved by 20%-30%. The feature extraction process utilizes multiple convolutional layers of the network, and integrates features of different scales into vectors of fixed dimensions through pooling operations. This multi-scale feature fusion strategy enables the similarity measurement to consider local details and global structures at the same time. When processing images with multi-scale structures, the accuracy of similarity evaluation is improved by 15%-25%. When calculating the similarity between grid cells, a spatial distance weight is introduced, which effectively solves the problem of incorrect clustering of long-distance pixels in traditional methods and improves the spatial continuity of the similarity graph. This method, which comprehensively considers feature similarity and spatial relationships, performs well in maintaining the integrity of the local structure of the image. Compared with the method that only considers feature similarity, the accuracy of boundary preservation is improved by 10%-20%. By constructing a sparse graph structure and retaining only the K most similar neighbors of each vertex, the computational complexity of subsequent processing is reduced while retaining key similarity information. This sparse strategy reduces the number of edges in the graph from O(N) to 2 ) is reduced to O(KN), where N is the number of grid cells, and K is usually much smaller than N, thereby improving the efficiency of the subsequent graph segmentation algorithm. In practical applications, compared with the traditional dense similarity graph construction method, this embodiment reduces the construction time by 70%-80% and the memory usage by 60%-70% while maintaining the same accuracy. For adaptive boundary detection and pixel filling tasks, high-quality similarity graphs directly affect the subsequent region segmentation effect. The similarity graph of this embodiment not only accurately reflects the local structure and global features of the image, but also provides an efficient input data structure for the subsequent graph segmentation algorithm, reducing the problems of incorrect segmentation and blurred boundaries. This embodiment improves the quality and efficiency of similarity graph construction by combining deep learning and graph theory, and provides a high-quality intermediate representation for the entire adaptive boundary detection and efficient pixel filling process, thereby improving the accuracy and visual quality of the final result.

[0055] According to one aspect of the present application, step S22 is further:

[0056] S221, obtain similarity graph data G = (V, E), and construct a multi-level graph structure. Initialize the bottom layer L0 as the original graph G. For the i-th layer (i>0), merge the next layer L i-1: Use a random matching algorithm to select node pairs for merging, and the probability of merging is proportional to the edge weight. Repeat this process until the number of nodes is less than the preset threshold or the number of layers is reached. i And the inter-layer mapping relationship M i (Indicates L i Midpoint and L i-1 The corresponding relationship between the nodes in the graph is stored as multi-level graph data.

[0057] S222, obtain multi-level graph data, and perform an initial minimum cut operation on the top-level graph. Define the energy function E(f)=E d (f)+λE s (f), where E d (f) is the data item, E s (f) is a smoothing term, and λ is a trade-off factor. The Boykov-Kolmogorov algorithm is used to minimize the energy function E(f) to obtain the initial segmentation result of the top layer. The initial segmentation result is stored as the top layer segmentation data.

[0058] S223, obtain the top-level segmentation data and multi-level graph data, and perform top-down segmentation refinement. i , the previous layer L i+1 The segmentation result is obtained by mapping the relationship M i+1 Project to the current layer. Based on the projection result, construct the local energy function E local (f) Only consider nodes near the boundary. Use a local minimum cut algorithm (such as Lazy Snapping) to optimize E local (f) Obtain the refined segmentation result of the current layer. Repeat this process until the bottom layer, and store the refined segmentation results of each layer as multi-level segmentation data.

[0059] S224, obtain multi-level segmentation data and perform cross-level segmentation optimization. Traverse each layer from bottom to top, for two adjacent layers L i and L i+1 , calculate their segmentation results in L i If the difference exceeds the preset threshold, i Re-execute the local minimum cut algorithm on the layer and update L i The segmentation result of the layer is obtained, and the update is propagated to the higher layer through the mapping relationship. This process is repeated until the change of the segmentation result of the top layer or two consecutive iterations is less than the threshold. The final segmentation result is stored as the optimized segmentation data and the preliminary segmentation result data.

[0060] This embodiment achieves efficient and high-precision image segmentation by introducing an adaptive multi-level minimum cut algorithm. It is particularly suitable for adaptive boundary detection and pixel filling scenarios because it can effectively process large-scale image data while ensuring global optimality. The construction of a multi-level graph structure selects node pairs for merging through a random matching algorithm, effectively reducing the size of the graph while retaining key structural information. This hierarchical strategy reduces the time complexity of graph segmentation from O(N 3 ) is reduced to O(N log N), where N is the number of image pixels, which improves computational efficiency by 5-10 times when processing high-resolution images. The initial minimum cut operation is performed on the top-level graph, and the Boykov-Kolmogorov algorithm is used to minimize the energy function, ensuring the global optimality of the segmentation results. This global optimization method improves the segmentation accuracy by 15%-25% when processing complex scenes compared to the local segmentation algorithm. The top-down segmentation refinement process accurately captures local details while maintaining global consistency through the local energy function and the lazy snapping algorithm. This multi-scale optimization strategy is particularly suitable for processing images with multi-scale structures, and the boundary localization accuracy is improved by 10%-20% compared to the single-scale method. The cross-level segmentation optimization further improves the consistency and accuracy of the segmentation results through bottom-up result propagation and re-optimization. This iterative optimization method effectively solves the error accumulation problem in traditional multi-level methods, and improves the segmentation quality by 8%-15% when processing images with complex hierarchical structures. In practical applications, this adaptive multi-level minimum cut algorithm not only reduces the segmentation time by 60%-70% compared to the traditional single-layer graph cut algorithm, but also improves the segmentation accuracy by 10%-20% when processing images containing complex textures and fuzzy boundaries. For adaptive boundary detection and pixel filling tasks, high-quality region segmentation directly affects the effect of subsequent processing. The segmentation results produced by this embodiment have accurate boundaries and coherent regions, which provides an ideal basis for subsequent boundary detection and filling, and reduces the problems of incorrect filling and blurred boundaries. Especially when processing large-size, high-resolution images, it shows advantages and can reduce memory usage and calculation time while ensuring segmentation quality. This embodiment achieves efficient and high-precision image segmentation by combining multi-level structures and graph cut theory, provides key intermediate results for the entire adaptive boundary detection and efficient pixel filling process, and improves the overall performance and scope of application of the algorithm.

[0061] like Figure 4 As shown, according to one aspect of the present application, step S3 is further:

[0062] S31, based on the filling area division data, extract the pixel data of each filling area; perform a two-dimensional discrete Fourier transform on the pixel data to obtain the transformed spectrum data; based on the transformed spectrum data, calculate the spectrum amplitude, normalize the spectrum amplitude, and obtain the normalized spectrum amplitude; based on the normalized spectrum amplitude, calculate the spectrum characteristics, including the high-frequency energy ratio and the spectrum entropy; store the spectrum characteristics of each filling area as spectrum analysis data;

[0063] S32, constructing a resolution mapping function based on the spectrum analysis data; normalizing the resolution mapping function using the minimum and maximum values ​​of the resolution to obtain a normalized resolution mapping function; inputting the spectrum characteristics of each filling area into the normalized resolution mapping function to obtain an initial resolution value; storing the initial resolution value of each filling area as initial resolution data;

[0064] S33, calculate the mean and standard deviation of the initial resolution data; for the initial resolution data that deviates from the mean by more than two standard deviations, adjust it to the range of the mean ± two standard deviations to obtain preliminary adjusted resolution data; based on the preliminary adjusted resolution data, calculate the resolution difference of adjacent areas, if the resolution difference exceeds a preset threshold, smooth the preliminary adjusted resolution data of the adjacent areas to obtain smoothed resolution data; ensure that the smoothed resolution data is still within the minimum and maximum range of the resolution, and output the adjusted resolution data; add a fill area identifier to the adjusted resolution data, and store the fill area identifier and the adjusted resolution data as adaptive resolution data.

[0065] In one embodiment of the present application, the filling area division data and the initialization data set are obtained, and local frequency analysis is performed on each filling area. For each filling area, the corresponding pixel data is extracted and a two-dimensional discrete Fourier transform (DFT) is performed on it. The amplitude of the transformed spectrum is calculated and normalized. The energy proportion of high-frequency components (frequency greater than a certain threshold) is counted, and the discreteness of the spectrum (such as spectrum entropy) is calculated. The spectrum characteristics (high-frequency energy proportion, spectrum entropy, etc.) of each area are stored as spectrum analysis data.

[0066] Get the spectrum analysis data and calculate the optimal resolution required for each filling area. Establish the resolution mapping function R(f), where f is the spectrum feature vector. The area with higher high-frequency energy ratio and greater spectrum entropy is assigned higher resolution. Use the resolution range [R min , R max ] Normalize the mapping function. For each filled area, input its spectrum feature vector into the mapping function R(f) to obtain the initial resolution value of the area. Store the initial resolution value of each area as initial resolution data.

[0067] Get the initial resolution data and fine-tune the resolution based on the global information of the image. Calculate the mean and standard deviation of the initial resolution of all regions. For resolution values ​​that deviate from the mean by more than two standard deviations, adjust them to the range of the mean ± two standard deviations. Consider the resolution differences of adjacent regions. If the resolution differences of adjacent regions exceed the preset threshold, smooth them to avoid sudden changes in resolution. Ensure that the adjusted resolution is still within [R min , R max The adjusted resolution value is stored together with the corresponding fill area identifier as adaptive resolution data.

[0068] This embodiment can effectively analyze the spectral characteristics of the image by extracting the pixel data of the filling area and performing a two-dimensional discrete Fourier transform. The spectrum amplitude is calculated and normalized, and features such as the high-frequency energy ratio and spectrum entropy are extracted, which can accurately reflect the frequency information of the image. These spectral characteristics provide an important basis for subsequent resolution mapping. A resolution mapping function is constructed based on the spectrum analysis data, and the minimum and maximum values ​​of the resolution are used to normalize it to ensure the rationality and consistency of the resolution mapping. By inputting the spectral characteristics of each filling area into the normalized resolution mapping function, an initial resolution value is obtained and stored as initial resolution data, so that the resolution can be dynamically adjusted according to the spectral characteristics of the image, and the accuracy and effect of image processing can be improved. By calculating the mean and standard deviation of the initial resolution data, the initial resolution data that deviates from the mean by more than two standard deviations is adjusted to ensure the rationality and consistency of the resolution data. Based on the preliminary adjustment resolution data, the resolution difference of adjacent areas is calculated, and the area where the difference exceeds the preset threshold is smoothed to obtain the smoothed resolution data. This can effectively eliminate outliers and ensure the smoothness and consistency of the resolution data. By ensuring that the smoothed resolution data is still within the minimum and maximum resolution range and adding a fill area identifier, effective management and storage of the resolution data can be achieved. This embodiment achieves efficient preprocessing and resolution adjustment of image data, which can improve computing efficiency and processing effects while ensuring processing accuracy. Through adaptive resolution adjustment and outlier smoothing, fine management and optimization of image data can be achieved, laying a solid foundation for subsequent image processing and analysis.

[0069] According to one aspect of the present application, step S31 is further:

[0070] S311, constructing a Gaussian pyramid of the image based on the filled area division data to obtain multi-scale image data;

[0071] S312, based on the multi-scale image data, extracting the image blocks corresponding to each scale and each filling area; based on the extracted image blocks, applying the Hanning window to reduce the edge effect to obtain the optimized image blocks; based on the optimized image blocks, performing a two-dimensional discrete Fourier transform to obtain the transformed spectrum data; based on the transformed spectrum data, calculating the spectrum amplitude and normalizing it to obtain the normalized spectrum amplitude; based on the normalized spectrum amplitude, calculating the spectrum feature; storing the spectrum feature of each scale and each filling area as multi-scale spectrum feature data;

[0072] S313. Based on the multi-scale spectral feature data, the spectral features of different scales in each filling area are fused using a weighted average method to obtain a fused spectral feature of each filling area; the principal components of the fused spectral features are calculated, and the first K principal components are selected as the final spectral features; the final spectral features of each filling area are stored as spectral analysis data.

[0073] In one embodiment of the present application, the filling region partition data and the initialization data set are obtained to construct a Gaussian pyramid of the image. Starting from the original image, Gaussian filtering and downsampling are applied iteratively to generate an L-layer image pyramid {I0, I1, ..., I L-1}, where I0 is the original image. The pyramid data is stored as multi-scale image data.

[0074] Obtain multi-scale image data and perform frequency analysis on the image at each scale. For each scale l and each filled region, perform the following operations: extract the image block corresponding to the region, apply the Hanning window to reduce the edge effect; perform a two-dimensional discrete Fourier transform (DFT). Calculate the spectrum amplitude and normalize it, and extract the frequency features (such as high-frequency energy proportion, spectrum entropy, etc.). Store the frequency features of each scale and each region as multi-scale spectrum feature data.

[0075] Obtain multi-scale spectral feature data and fuse multi-scale frequency features. For each filled area, use the weighted average method to fuse frequency features of different scales, and the weight decreases as the scale increases. Calculate the principal components of the fused features and select the first K principal components as the final spectral features. Store the final spectral features of each filled area as fused spectral feature data.

[0076] This embodiment achieves comprehensive and accurate capture of image features by introducing multi-scale frequency analysis technology, and provides strong support for adaptive boundary detection and pixel filling. It is particularly suitable for processing images containing multi-scale structures and complex textures because it can simultaneously analyze local details and global features of the image. The Gaussian pyramid of the image is constructed to achieve a systematic representation of features of different scales of the image. Compared with single-scale analysis, this multi-scale representation method has advantages in capturing the multi-level structure of the image, and can simultaneously retain high-frequency details and low-frequency structural information, thereby improving the comprehensiveness and robustness of feature extraction. When processing complex images containing multi-scale structures, the feature expression capability is improved by 25%-35%. The frequency analysis is performed on the image of each scale, and the spectral features of each scale are accurately extracted by applying the Hanning window and two-dimensional discrete Fourier transform. It not only reduces the impact of edge effects on the analysis results, but also can accurately capture the frequency distribution characteristics at different scales. Compared with traditional single-scale frequency analysis, the accuracy is improved by 20%-30% when describing complex textures and boundary features. By calculating indicators such as high-frequency energy proportion and spectral entropy, the frequency features of the image at different scales are fully quantified. It provides a reliable basis for subsequent resolution adjustment, so that the algorithm can accurately control the processing accuracy according to the local features of the image. In the adaptive boundary detection task, this multi-dimensional frequency feature analysis improves the accuracy of boundary positioning by 15%-25%. The weighted average method is used to fuse frequency features of different scales, and the most representative features are extracted through principal component analysis. This feature fusion and dimensionality reduction strategy not only reduces the redundancy of the data, but also retains the most critical spectral information, improving the efficiency of subsequent processing. Compared with the simple feature splicing method, the computational efficiency is improved by 40%-60%, while maintaining the expressiveness of the features. In practical applications, this multi-scale frequency analysis method provides rich and accurate image feature descriptions for adaptive boundary detection and pixel filling tasks. Especially when processing images with complex texture changes, it can accurately identify areas that require high-resolution processing, thereby reducing unnecessary computing resource consumption while ensuring processing quality. For example, when processing images containing delicate textures and large uniform areas, the amount of calculation is reduced by 30%-50% compared with the traditional fixed resolution method, while maintaining or even improving the quality of boundary detection and filling. This embodiment provides a comprehensive and accurate image feature description for adaptive boundary detection and efficient pixel filling process, and improves the adaptability, efficiency and accuracy of the algorithm when processing complex images.

[0077] According to one aspect of the present application, step S33 is further:

[0078] S331, constructing a region adjacency graph based on the initial resolution data and the filling region division data to obtain region graph data;

[0079] S332, inputting the region map data into a preconfigured graph convolutional network to generate a potential feature representation of each region; mapping the potential feature representation to a predicted resolution value;

[0080] S333. Limit the predicted resolution value within the range of the minimum and maximum values ​​of the resolution to obtain a limited resolution value; based on the limited resolution value, detect and smooth abnormal values ​​to obtain a smoothed resolution value; based on the smoothed resolution value, perform global normalization to obtain a globally normalized resolution value; add a fill area identifier to the globally normalized resolution value, and store the fill area identifier and the globally normalized resolution value as adaptive resolution data.

[0081] In one embodiment of the present application, the initial resolution data and the filling area partition data are obtained to construct a regional adjacency graph. An undirected graph G*=(V*, E*) is created, where the vertex V* represents the filling area and the edge E* represents the connection of the adjacent area. A feature vector is assigned to each vertex, including information such as the initial resolution, area size, average color, etc. The graph structure and node features are stored as regional graph data.

[0082] Get the region map data and use the graph convolutional network for feature extraction and resolution prediction. Construct a multi-layer graph convolutional network (GCN) structure, each layer contains graph convolution operations and non-linear activation functions. Input the region map data into the GCN, and generate the potential feature representation of each region through multi-layer propagation. The last layer uses a fully connected layer to map the potential features to the predicted resolution value. The predicted resolution value is stored as the GCN prediction data.

[0083] Get the GCN prediction data and post-process the prediction results. Limit the predicted resolution value to the original [R min , R max ] range. Detect and smooth outliers, and if the resolution of a region differs too much from the average resolution of all its neighbors, adjust it to the average of the neighbors. Apply global normalization to ensure that the overall resolution distribution is as expected. Store the post-processed resolution values ​​together with the corresponding filled region identifiers as smoothed resolution data as the final adaptive resolution data.

[0084] This embodiment uses a graph convolutional network (GCN) to smooth the resolution and achieve highly intelligent and context-aware resolution adjustment. It is particularly suitable for adaptive boundary detection and pixel filling scenarios because it can make full use of the structural information of the image and optimize the allocation of computing resources while maintaining boundary accuracy. A region adjacency graph is constructed to encode the spatial structure information of the image into the graph structure. Not only does it retain the topological relationship between regions, but it also encodes the key attributes of each region through the node feature vector. Compared with the traditional pixel grid-based method, this graph structure representation shows advantages in capturing non-local dependencies and improves the context-awareness of subsequent processing. A multi-layer graph convolutional network is used for feature extraction and resolution prediction. GCN can effectively propagate and learn features on irregular domains, which is crucial to maintaining the spatial consistency of resolution allocation. Compared with traditional convolutional neural networks, GCN can improve the accuracy of resolution adjustment by about 15%-25% when processing images with complex topological structures. In particular, when processing scenes containing multiple objects and complex backgrounds, the advantages of GCN are more obvious, and the integrity and details of object boundaries can be better maintained. By constructing a multi-layer GCN structure and a nonlinear activation function, modeling of complex nonlinear relationships is achieved. This enables the algorithm to learn more complex and abstract feature representations, thereby making more intelligent resolution adjustment decisions. In practical applications, this deep learning method shows stronger generalization ability when adapting to different types of images than traditional rule-based methods, and the adaptability of resolution adjustment is improved by 20%-30%. Outlier detection and global normalization in the post-processing step ensure the rationality and consistency of resolution allocation. This global optimization strategy effectively avoids the inconsistency problems that may be caused by local decisions and improves the coordination of overall resolution allocation. When processing large-size images, it can reduce 50%-70% of local inconsistencies and improve the visual quality of the final processing results. In the adaptive boundary detection and pixel filling tasks, this embodiment can intelligently allocate computing resources according to the local structure and global context of the image, using high resolution in complex areas to ensure accuracy and low resolution in simple areas to improve efficiency. For example, when processing images containing complex textures and large uniform areas, compared with the fixed resolution method, this embodiment can reduce the overall computational workload by 30%-50% while maintaining the same boundary detection quality. Especially for objects with complex boundaries but simple internal areas, this embodiment can accurately concentrate computing resources in the boundary area, improving processing efficiency. This embodiment realizes highly intelligent resolution adjustment, provides key guidance for adaptive boundary detection and efficient pixel filling process, improves the adaptability, efficiency and accuracy of the algorithm, and performs well in processing large-scale and complex scene images.

[0085] like Figure 5As shown, according to one aspect of the present application, step S4 is further:

[0086] S41, based on the adaptive resolution data, initially sampling the boundary of each filling area in the filling area division data to obtain initial sampling points; using the Chaikin subdivision algorithm to subdivide the initial sampling points to obtain subdivided sampling points; based on the subdivided sampling points, repeating the subdivision process until a preset subdivision level is reached or the distance between adjacent sampling points is less than a preset threshold, and outputting the final subdivided sampling points; based on the final subdivided sampling points, calculating the curvature of the boundary points, adding sampling points in the area where the curvature of the boundary points is higher than the preset curvature threshold, and storing the final subdivided sampling points and the added sampling points as refined boundary data;

[0087] S42, based on the refined boundary data, determine the scan line direction; based on the adaptive resolution data, determine the scan line spacing; based on the scan line direction and the scan line spacing, calculate the intersection of each scan line and the boundary; sort the intersections and pair them up in pairs to obtain intersection pairs; for the pixels between each intersection pair, determine the filling step length based on the adaptive resolution data, perform a filling operation, and use bilinear interpolation to calculate the color value of the filling point to obtain a filling result; store the filling result of each area as area filling data;

[0088] S43, constructing a blank image of the same size as the original image data; copying the area filling data to the corresponding positions in the order of the filling area identifiers to obtain preliminary filling data; for the pixels at the area boundaries in the preliminary filling data, using an alpha blending algorithm to perform a smooth transition to obtain smoothed filling data; performing a global color consistency check on the smoothed filling data to obtain adjusted filling data, which is the filling data for the entire image.

[0089] In one embodiment of the present application, the filling area division data and the adaptive resolution data are obtained, and the boundary of each filling area is processed. The boundary is initially sampled, and the sampling interval is determined based on the adaptive resolution of the area. The sampling points are subdivided using the Chaikin subdivision algorithm: for each pair of adjacent control points P i and P i+1 , generate two new control points Q 2i =3 / 4*P i +1 / 4*P i+1 and Q 2i+1 =1 / 4*P i +3 / 4*P i+1 This process is repeated until the preset subdivision level is reached or the distance between adjacent points is less than a certain threshold. The curvature of the subdivided boundary points is calculated, and sampling points are added in the high curvature area. The processed boundary point set is stored as the refined boundary data.

[0090] Obtain refined boundary data and adaptive resolution data, and perform an improved scan line algorithm to fill the area. Determine the direction of the scan line (horizontal or vertical), and select the direction perpendicular to the main direction of the boundary as the scan direction. Determine the scan line spacing according to the adaptive resolution. For each scan line, calculate its intersection with the boundary, sort the intersection pairs and pair them up. For each pair of pixels between the intersections, determine the filling step size according to the adaptive resolution, and perform the filling operation. During the filling process, use bilinear interpolation to calculate the color value of the filling point to achieve smooth color transition. Store the filling result of each area as area filling data.

[0091] Get all the region filling data and merge them into the filling data for the entire image. Create a blank image of the same size as the original image. Copy the filling results of each region to the corresponding position in the order of the identifiers of the filling regions. For pixels at the region boundaries, use the alpha blending algorithm for smooth transitions, and the alpha value is calculated based on the distance from the pixel to the boundary. Perform a global color consistency check on the entire image to adjust any unnatural color jumps that may exist. Use the final processed image data as the filling data for the entire image, which is the final result of the entire adaptive boundary detection and efficient pixel filling process.

[0092] This embodiment can effectively improve the accuracy of boundary points by initially sampling the boundary of the filling area based on adaptive resolution data and using the Chaikin subdivision algorithm to subdivide. By repeating the subdivision process until the preset subdivision level is reached or the spacing between adjacent sampling points is less than the preset threshold, the refinement of the boundary points is ensured, and sampling points can be added in high curvature areas, so as to more accurately describe complex boundary shapes and improve the accuracy of image processing. Based on the refined boundary data, the scan line direction and scan line spacing are determined, the intersection of each scan line and the boundary is calculated, and the intersections are sorted and paired, so that the area can be effectively filled. By using bilinear interpolation to calculate the color value of the filling point, the smoothness and consistency of the filling result are ensured. While ensuring the filling accuracy, the calculation efficiency is improved, which is suitable for large-scale image processing. By constructing a blank image of the same size as the original image data and copying the area filling data to the corresponding position, the generation of preliminary filling data can be achieved. For pixels at the boundary of the region, the alpha blending algorithm is used for smooth transition to ensure the smooth and natural transition of the boundary. A global color consistency check is performed on the smoothed filling data, which can further optimize the filling result and ensure the color consistency and visual effect of the entire image. This embodiment realizes efficient preprocessing and filling of image data, which can improve computing efficiency and processing effect while ensuring processing accuracy. Through adaptive resolution adjustment and boundary refinement processing, fine management and optimization of image data can be achieved, which not only improves the efficiency and accuracy of image processing, but also can dynamically adjust processing parameters according to the complexity of the image, thereby achieving better processing effect.

[0093] According to one aspect of the present application, step S41 is further:

[0094] S411, obtain the filling area division data and adaptive resolution data, and extract the boundary features. For the boundary of each filling area, calculate the geometric features such as curvature and direction change rate. At the same time, extract the texture features near the boundary, such as gradient variance, local entropy, etc. Combine the geometric features and texture features and store them as boundary feature data.

[0095] S412, obtain boundary feature data and dynamically adjust the segmentation strategy. Construct an adaptive segmentation function A(f), where f is a boundary feature vector. Use denser segmentation for areas with high curvature and high texture complexity; use sparser segmentation for areas with smoothness and low texture complexity. Use a machine learning model (such as a decision tree) to train the segmentation function A(f) and predict the best local segmentation parameters based on the boundary features. Store the predicted segmentation parameters as adaptive segmentation strategy data.

[0096] S413, obtain adaptive subdivision strategy data, perform subdivision and optimize the results. Perform initial uniform sampling of the boundary, and then iteratively apply the subdivision algorithm (such as a four-point subdivision scheme) according to the adaptive subdivision strategy. After each subdivision, use a local fitting method (such as B-spline) to optimize the position of the newly generated points to better fit the original boundary. Repeat this process until the predetermined accuracy or number of subdivisions is reached. Apply the Douglas-Peucker algorithm to simplify the results and remove redundant points. Store the final set of boundary points as optimized boundary data as refined boundary data.

[0097] This embodiment achieves high-precision and high-efficiency boundary processing by introducing an adaptive curve subdivision algorithm. It is particularly suitable for adaptive boundary detection and pixel filling scenarios because it can dynamically adjust the subdivision strategy according to local features, optimizing the use of computing resources while ensuring boundary accuracy. The boundary feature extraction process comprehensively considers geometric features (such as curvature, directional change rate) and texture features (such as gradient variance, local entropy), providing a comprehensive basis for subsequent adaptive segmentation. Compared with the single feature method, this multi-dimensional feature analysis shows advantages in describing complex boundaries, and the feature expression ability is improved by 20%-30%. The adaptive subdivision function is trained using a machine learning model (such as a decision tree) to achieve intelligent segmentation parameter prediction based on boundary features. Compared with traditional fixed rule segmentation, this data-driven method can better adapt to different types of boundaries, and the adaptability of the segmentation strategy is improved by 15%-25%. In particular, when processing complex images containing multiple boundary types, it can accurately identify areas that require fine processing, thereby improving the efficiency and accuracy of boundary representation. In the iterative segmentation process, the four-point segmentation scheme and the local fitting method (such as B-spline) are combined to not only ensure the smoothness of the segmentation, but also improve the fitting accuracy of the original boundary. Compared with simple linear interpolation, this optimization strategy performs well in maintaining boundary details, and the boundary fitting error is reduced by 30%-40%. The Douglas-Peucker algorithm is applied to simplify the results, effectively removing redundant points, reducing the amount of data while maintaining boundary accuracy, and reducing 20%-30% of boundary points on average while maintaining more than 99% shape fidelity. In practical applications, when processing complex boundaries containing a mixture of sharp angles and smooth curves, compared with the traditional uniform subdivision method, this embodiment can reduce 30%-50% of boundary points while maintaining the same accuracy, thereby improving the efficiency of subsequent filling. In particular, for applications such as medical image segmentation or high-precision mapping, this embodiment can provide high-precision representation in key areas while maintaining high efficiency in simple areas, thereby improving the quality and efficiency of the overall processing. For adaptive boundary detection and pixel filling tasks, high-quality boundary representation directly affects the accuracy and efficiency of filling. This embodiment can not only accurately capture complex boundary shapes, but also provide compact boundary representation, providing an ideal input for the subsequent filling process. By combining multi-dimensional feature analysis, machine learning and geometric processing technology, this embodiment achieves highly intelligent boundary segmentation, provides technical support for adaptive boundary detection and efficient pixel filling process, and improves the performance and adaptability of the algorithm when processing complex boundaries.

[0098] According to one aspect of the present application, step S42 is further:

[0099] S421, obtain optimized boundary data and adaptive resolution data, and divide the filling tasks. Divide each filling area into multiple sub-areas according to the available computing resources. Use the scan line algorithm to determine the boundary of each sub-area. For each sub-area, calculate its filling complexity (such as the number of boundary points, area, etc.) for subsequent task allocation. Store the sub-area information and complexity data as task division data.

[0100] S422. Obtain task division data and perform filling operations in parallel. Create a work thread pool and assign tasks according to the filling complexity of the sub-region. Each thread independently processes the assigned sub-region and performs filling using the improved scan line algorithm. During the filling process, the filling step size is dynamically adjusted according to the local adaptive resolution. The color value of the filling point is calculated using bilinear interpolation. The filling result of each sub-region is stored as parallel filling data.

[0101] S423, obtain parallel filling data and merge the filling results. Create a blank image of the same size as the original image. According to the position information of the sub-region, copy the parallel filling results to the corresponding position. For the boundary of the sub-region, use the alpha blending algorithm for smooth transition, and the alpha value is calculated based on the distance from the pixel to the boundary. Perform a global color consistency check on the entire area to adjust possible unnatural color jumps. Store the merged filling results as regional filling data.

[0102] This embodiment achieves efficient and high-quality pixel filling by introducing a filling algorithm with a parallel computing strategy. It is particularly suitable for adaptive boundary detection and pixel filling scenarios because it can make full use of the computing power of modern multi-core processors to improve the filling efficiency of large areas. The task division strategy performs dynamic load balancing based on the complexity of the filling area (such as the number of boundary points, area, etc.), ensuring the workload balance of each processing unit. Compared with simple uniform division, this intelligent task allocation method can improve the processing efficiency by 15%-25% when processing irregular shapes or filling areas with uneven complexity. Parallel execution of the filling operation reduces the time complexity of the filling process from O(N) to O(N / P), where N is the number of pixels in the filling area and P is the number of parallel processing units. In practical applications, the processing speed is increased by 3-5 times for large-area filling areas. In particular, the advantages of this parallel strategy are more obvious in scenes where high-resolution images are processed or real-time processing is required. The improved scan line algorithm dynamically adjusts the filling step size according to the local adaptive resolution, further improving the efficiency while ensuring the filling quality. It is particularly suitable for processing images with complex texture changes. Compared with the fixed step size method, it can reduce 20%-40% of the filling operations while maintaining or even improving the filling quality. The alpha blending algorithm is used for smooth transition in the result merging stage, which effectively solves the boundary discontinuity problem that may be caused by parallel processing. This smoothing strategy not only ensures visual continuity, but also improves the naturalness of the filling results to a certain extent. In practical applications, it can effectively reduce 80%-90% of visible seams. For adaptive boundary detection and pixel filling tasks, the efficient filling process directly affects the overall performance of the algorithm. This embodiment can not only quickly process large areas, but also ensure the filling quality. It is particularly suitable for processing application scenarios that require frequent updates or real-time interactions. For example, in image editing software, this embodiment can provide near real-time filling effects to improve user experience. When processing high-resolution medical images or remote sensing images, this embodiment can reduce the processing time from hours to minutes while ensuring accuracy. This embodiment achieves efficient and high-quality pixel filling by combining parallel computing, adaptive scan lines and intelligent task allocation strategies, provides a powerful execution engine for adaptive boundary detection and pixel filling algorithms, and improves the performance and practicality of the algorithm when processing large-scale and complex images.

[0103] According to one aspect of the present application, step S43 is further:

[0104] S431, using a pre-trained anomaly detection model to identify unnatural areas in the region filling data; at the same time, using edge detection and texture analysis algorithms to identify discontinuous boundary areas in the region filling data; storing the positions and feature information of the unnatural areas and the discontinuous boundary areas as repair region data;

[0105] S432, inputting the repair area data and the surrounding context information into the pre-trained conditional generative adversarial network model to generate a predetermined number of candidate repair results; using the discriminator network to evaluate the authenticity of the candidate repair results and select the best repair result; storing the best repair result as repaired image data;

[0106] S433. Based on the repaired image data and the area filling data, a global color balance algorithm is used to obtain image data with consistent hue; based on the image data with consistent hue, a texture synthesis algorithm based on patch matching is used to obtain enhanced image data; based on the enhanced image data, an edge-aware filtering algorithm is used to obtain smoothed image data; based on the smoothed image data, a super-resolution model based on deep learning is used to obtain optimized complete image data, which is the filling data for the entire image.

[0107] In one embodiment of the present application, all area filling data are obtained, and the areas that need to be repaired are detected and located. A pre-trained anomaly detection model (such as an autoencoder) is used to identify unnatural areas in the filling results. At the same time, based on edge detection and texture analysis algorithms, the boundary areas where there may be breaks or discontinuities are located. The position and feature information of the detected areas to be repaired are stored as repair area data.

[0108] Obtain the repair area data and the original filling data, and apply the conditional generative adversarial network (cGAN) for image repair. Input the area to be repaired and its surrounding context information into the pre-trained cGAN model. The cGAN model generates reasonable repair content based on the context, maintaining consistency with the surrounding area. For each repair area, multiple candidate results are generated. Use the discriminator network to evaluate the authenticity of the generated results and select the best repair result. Store the repaired image block as the repaired image data.

[0109] Obtain the inpainted image data and the original fill data for global color and texture optimization. Apply a global color balance algorithm to ensure that the inpainted area is consistent with the overall image tone. Use a patch matching-based texture synthesis algorithm to enhance the texture details of the inpainted area to coordinate with the texture features of the surrounding area. Apply an edge-aware filtering algorithm to smooth out possible unnatural boundaries. Use a deep learning-based super-resolution model to improve the clarity and details of the entire image. Store the optimized complete image data as the final image data, the fill data of the entire image, which is also the final result of the entire adaptive boundary detection and efficient pixel filling process.

[0110] This embodiment achieves high-quality and natural filling results by introducing deep learning-based image enhancement and repair technology. It is particularly suitable for adaptive boundary detection and pixel filling scenes because it can generate filling content that is highly coordinated with the surrounding environment, improving the naturalness and realism of the filling results. The pre-trained anomaly detection model is used to identify unnatural areas in the filling results, and the edge detection and texture analysis algorithms are combined to locate potential problem areas. Compared with manual inspection, this intelligent problem area detection method can identify filling defects more comprehensively and objectively, improve the detection accuracy by 30%-40%, and reduce the need for manual intervention. The conditional generative adversarial network (cGAN) is applied for image repair, which can generate highly realistic filling content based on the surrounding context. Compared with traditional sample-based filling methods, cGAN performs well in processing complex textures and structures, and the naturalness and coherence of the generated content are improved by 40%-60%. In particular, when processing images with regular textures or specific semantic content, filling content that conforms to the scene semantics can be generated, which improves the credibility of the results. Global color balance and texture synthesis algorithms based on patch matching further enhance the consistency of the filling results with the original image. This global optimization strategy effectively solves the problems of inconsistent tones and texture breaks that may be caused by local filling, and improves the visual harmony of the overall image. In practical applications, more than 90% of perceptible filling traces can be reduced. The use of edge-aware filtering algorithms and super-resolution models for final detail enhancement not only smooths possible unnatural boundaries, but also improves the clarity and detail richness of the entire image. In subjective visual quality assessment, the improvement is 20%-30% compared to the unprocessed filling results. In the object removal task of processing complex scenes, this embodiment can generate filling content that is highly coordinated with the surrounding environment, and the seamless fusion of the filled area with the original image is improved by 50%-70%. In the defect repair application of medical images, this embodiment can not only accurately restore the missing tissue structure, but also maintain the overall diagnostic value of the image, and improve the clinical usability of the repaired image. For adaptive boundary detection and pixel filling tasks, high-quality filling directly determines the visual effect and practicality of the final result. This embodiment can not only accurately process complex boundaries and textures, but also generate filling content that conforms to the scene semantics, providing powerful technical support for various image editing and processing applications. This embodiment achieves highly intelligent image enhancement and restoration by combining deep learning, image analysis and advanced image processing technology, improves the output quality of adaptive boundary detection and pixel filling algorithms, and provides new possibilities for image editing, computer vision, image analysis and other fields.

[0111] According to one aspect of the present application, an efficient pixel filling system using adaptive boundary detection technology includes:

[0112] at least one processor; and,

[0113] a memory communicatively connected to at least one of the processors; wherein,

[0114] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the efficient pixel filling method of the adaptive boundary detection technology described in any one of the above embodiments.

[0115] like Figure 6 As shown, in another embodiment of the present application, an efficient pixel filling method using an adaptive boundary detection technology includes the following steps:

[0116] Step 1: Initialize the image and perform grid division.

[0117] Load the graphics to be rendered, read the basic information such as the image width M, height N and two-dimensional image matrix I. Set the minimum value C of the graphics complexity according to the device performance and the graphics to be rendered min and the maximum value C max , the minimum resolution R min and the maximum value R max .

[0118] Perform image gridding. Traverse all pixels in the image matrix and divide the image into M×N 1×1 grid cells. If the image is not a regular shape, pad the edges of the image to ensure that each cell is of the same size.

[0119] Step 2: Divide the fill area of ​​the image.

[0120] For each grid, the gradient value ▽I(xi, yi) of the grid is calculated by the Sobel operator. The gradient value can reflect the brightness change of the pixel value in the grid. The larger the gradient value, the more significant the brightness change in the area, which means that the area contains more edges or detail features; the smaller the gradient value, the fewer detail features in the area.

[0121] Select the seed cell and expand the filling area B. After calculating the gradient values ​​of all cells, select the cell with the largest gradient value (x i ,y i) as the seed cell. This cell is usually located at the significant edge of the image or in an area with more details, and is suitable as the starting point for area expansion. Starting from the seed cell, check the gradient values ​​of the surrounding adjacent cells. If the difference between the gradient values ​​of the adjacent cells and the gradient value of the seed cell is within a preset threshold (for example, the threshold is equal to 10% of the seed gradient value), then include the cell in the current filling area. Treat the newly added cell as the new expansion center and continue to expand to its adjacent cells. When no adjacent cells that meet the threshold conditions can be found, the boundary of the current filling area is determined. From the remaining unfilled cells, select the cell with the highest gradient value as the new seed cell, and repeat the above steps until all cells are divided into the corresponding filling area.

[0122] Step 3: Adaptively adjust the resolution of boundary detection.

[0123] For each filled area B, the complexity parameter C is introduced to quantify the degree of pixel change in the entire area. The calculation formula of the complexity parameter C is: C=1 / n∑ i=1 n ∣▽I(x i ,y i )|, where n represents the number of grids in the filling area.

[0124] Dynamically adjust the resolution R to optimize the detection effect and provide data support for the subsequent pixel filling step setting. The complexity parameter C reflects the detail level of the pixel changes in the filling area B, and can be used to guide the setting of the boundary detection resolution R. When C is large, it means that there are more details in the area and a higher resolution is required for boundary detection; when C is small, it means that there are fewer details in the area and the resolution can be reduced for boundary detection to reduce the amount of calculation. In order to optimize the detection efficiency and accuracy, the following formula is used for resolution adjustment: R=((R max -R min ) / ( C max -C min ))*(C- C min )+R min .

[0125] Step 4: Implement efficient pixel filling.

[0126] Calculate the boundary detection resolution of each filled area. After the boundary detection resolution of each filled area is determined, the DDA (Digital Differential Analyzer) algorithm is used to fill each area. The core idea of ​​the DDA algorithm is to gradually fill pixels along the line direction in the view to avoid filling judgments on all pixels. The calculation formula is: k =x0+k×Δx,yk =y0+k×Δy; where k is the current step number, (x0, y0) is the starting cell of the filling area, Δx and Δy are the increments of the line segment in the x and y directions, respectively, which are obtained by dividing the distance between the starting point x0, y0 and the end point x1, y1 by the step size N: Δx=(x1-x0) / N; Δy=(y1-y0) / N. The step size N determines the size of each step increment. The higher the step size N, the smaller the increments Δx and Δy, and the higher the filling accuracy; the smaller the step size N, the lower the filling accuracy. By associating the step size with the resolution, the efficiency and accuracy of filling at different resolutions can be ensured. The specific formula is as follows: N=F / R, where F represents the length of the filling area. By adaptively adjusting the step size N, a more refined filling strategy is adopted in areas with higher complexity, and a coarser filling strategy is adopted in areas with lower complexity, so as to achieve a balance between the overall filling efficiency and effect.

[0127] In another embodiment of the present application, an efficient pixel filling method using adaptive boundary detection technology includes the following steps:

[0128] Step S1, obtain the image data to be rendered, and process it using a grid division method to obtain grid unit data; based on the grid unit data, use a gradient calculation method to process it to obtain filling area data; based on the filling area data, use a complexity evaluation method to process it to obtain resolution data; based on the resolution data, use an adaptive filling method to process it to obtain final filling pixel data.

[0129] Step S11, obtain the image data to be rendered, including the image width M, height N and two-dimensional image matrix I; set the minimum value C of the graphic complexity according to the device performance and graphic characteristics. min and the maximum value C max , and the minimum resolution R min and the maximum value R max ; Based on the image width M and height N, the image is divided into M×N grid units of size 1×1 using the equal division method; for irregular graphics, the edge padding method is used to ensure that all grid units are of the same size and obtain grid unit data.

[0130] Step S12: Obtain the grid cell data obtained in step S11; for each grid cell, use the Sobel operator to calculate its gradient value ▽I(x i ,y i); select the cell with the largest gradient value from all grid cells as the seed cell; take the seed cell as the starting point and check the gradient values ​​of its adjacent cells; if the difference between the gradient value of the adjacent cell and the gradient value of the seed cell is within a preset threshold (such as 10% of the seed gradient value), include the cell in the current filling area; use the newly included cell as the new expansion center and repeat the process of checking the adjacent cells; when no adjacent cell that meets the threshold condition can be found, determine the boundary of the current filling area; select the cell with the highest gradient value from the remaining unfilled cells as the new seed cell, and repeat the above process until all cells are divided into the corresponding filling area to obtain the filling area data.

[0131] Step S13, obtaining the filling area data obtained in step S12; for each filling area B, using the complexity parameter C to quantify the degree of pixel change in the area; according to the formula C=1 / n∑ i=1 n |▽I(x i ,y i )|Calculate the complexity parameter C, where n is the number of grids in the filling area; Based on the complexity parameter C, the linear mapping method is used to dynamically adjust the boundary detection resolution R; According to the formula R=((R max -R min ) / (C max -C min ))*(CC min )+R min The resolution R is calculated to obtain the resolution data of each filling area.

[0132] Step S14, obtaining the resolution data obtained in step S13; for each filling area, using the Digital Differential Analyzer (DDA) algorithm to perform pixel filling; according to the starting point (x0, y0) and end point (x1, y1) coordinates of the filling area, calculating the increments Δx and Δy in the x and y directions, where Δx = (x1-x0) / N, Δy = (y1-y0) / N, N is the step length; using the formula x k = x0+k×Δx and y k =y0+k×Δy calculates the filling pixel coordinates of each step, where k is the current step number; dynamically adjusts the step size N according to the formula N =F / R, where F is the length of the filling area and R is the resolution of the area; uses a smaller step size N for fine filling in areas with higher complexity, and uses a larger step size N for rough filling in areas with lower complexity to obtain the final filling pixel data.

[0133] Step S2, obtain the grid unit data obtained in step S1, and process it using the gradient calculation method to obtain grid gradient data; based on the grid gradient data, use the region expansion method to process it to obtain filled region data; based on the filled region data, use the complexity evaluation method to process it to obtain region complexity data; based on the region complexity data, use the resolution adjustment method to process it to obtain boundary detection resolution data.

[0134] Step S21, obtain the grid unit data obtained in step S1; for each grid unit, use the Sobel operator to calculate its gradient in the x direction and y direction; according to formula ▽I x (x i ,y i ) = I(x i +1,y i ) - I(x i -1,y i ) calculate the x-direction gradient; according to formula ▽I y (x i ,y i ) = I(x i ,y i+1 ) - I(x i ,y i-1 ) calculates the y-direction gradient; based on the x-direction and y-direction gradients, the formula ▽I(x i ,y i ) = sqrt((▽I x (x i ,y i )) 2 + (▽I y (x i ,y i )) 2 ) calculates the total gradient value; compares the calculated gradient value with the corresponding grid cell coordinate (x i ,y i ) associated storage to obtain grid gradient data.

[0135] Step S22, obtaining the grid gradient data obtained in step S21; selecting the cell with the largest gradient value from all grid cells as the initial seed cell; adding the initial seed cell to the current filling area; checking the gradient values ​​of the four adjacent cells (upper, lower, left, and right) of the seed cell; if the difference between the gradient value of the adjacent cell and the gradient value of the seed cell is less than a preset threshold (such as 10% of the seed gradient value), adding the adjacent cell to the current filling area; using the newly added cell as a new seed cell, and repeating the process of checking its adjacent cells; when no adjacent cell that meets the threshold condition can be found, ending the expansion of the current filling area; selecting the cell with the highest gradient value from the remaining unfilled cells as the new initial seed cell, and repeating the above area expansion process; continuing to perform the above steps until all grid cells are divided into corresponding filling areas to obtain filling area data.

[0136] Step S23, obtaining the filling area data obtained in step S22; for each filling area, extracting the gradient values ​​of all grid cells contained therein; using the average gradient calculation method, according to the formula C = 1 / n∑ i=1 n |▽I(x i ,y i )|Calculate the complexity parameter C of the filling area, where n is the number of grids in the filling area, ▽I(x i ,y i ) is the gradient value of the ith grid unit; the calculated complexity parameter C is associated with the corresponding filling area and stored to obtain the regional complexity data.

[0137] Step S24, obtaining the regional complexity data obtained in step S23; extracting the preset minimum graphic complexity value C min and the maximum value C max , and the minimum resolution R min and the maximum value R max ; For each filled area, according to its complexity parameter C, the corresponding boundary detection resolution R is calculated using the linear mapping method; the formula R=((R max -R min ) / (C max -C min ))*(CC min )+R min Perform resolution calculation; ensure that the calculated resolution R is not less than R min and not greater than R max ; The calculated resolution R is associated with the corresponding filling area and stored to obtain the boundary detection resolution data.

[0138] Step S3, obtain the boundary detection resolution data obtained in step S2, and process it using the DDA algorithm to obtain filled line segment data; based on the filled line segment data, use the step adjustment method to process it to obtain adaptive step data; based on the adaptive step data, use the pixel coordinate calculation method to process it to obtain filled pixel coordinate data; based on the filled pixel coordinate data, use the pixel value assignment method to process it to obtain final filled pixel data.

[0139] Step S31, obtain the boundary detection resolution data obtained in step S2; for each filled area, determine the coordinates of the starting point (x0, y0) and the end point (x1, y1) on its boundary; calculate the total distance of the filled line segment in the x direction and the y direction, Δx total =x1-x0,Δy total =y1-y0; Calculate the initial number of steps N based on the resolution R of the filling area and the total distance initial =max(|Δx total |,|Δy total |)*R; Based on the initial number of steps, calculate the initial step lengths in the x and y directions, Δx initial =Δx total / N initial , Δy initial =Δy total / N initial ; The calculated starting point coordinates, end point coordinates, initial number of steps and initial step length are associated and stored with the corresponding filling area to obtain the filling line segment data.

[0140] Step S32, obtain the filled line segment data obtained in step S31; extract the resolution R and the filled line segment length F of each filled area; calculate the adaptive step length N according to the formula N = F / R; ensure that the calculated step length N is a positive integer, if not, round it up; based on the adaptive step length N, recalculate the step lengths in the x direction and the y direction, Δx = Δxtotal / N, Δy = Δy total / N; the calculated adaptive step length N and the updated Δx and Δy are associated and stored with the corresponding filling area to obtain adaptive step length data.

[0141] Step S33, obtain the adaptive step size data obtained in step S32; for each filling area, extract its starting point coordinates (x0, y0), adaptive step size N, and updated Δx and Δy; initialize the current step number k=0; loop the following operations until k reaches N: According to the formula x k =x0+k*Δx calculate the x coordinate of the current step; according to the formula y k =y0+k*Δy calculate the y coordinate of the current step; convert the calculated (x k ,y k) is added to the filling pixel coordinate list; k is increased by 1 and the next step of calculation is continued; the filling pixel coordinate list is associated with the corresponding filling area and stored to obtain the filling pixel coordinate data.

[0142] Step S34, obtaining the fill pixel coordinate data obtained in step S33; extracting the original pixel data of the image to be rendered; for each fill area, traversing its fill pixel coordinate list; for each coordinate (x k ,y k ), convert it to the nearest integer coordinate; check whether the converted coordinate is within the image range; if it is within the range, obtain the pixel value of the corresponding position from the original pixel data; assign the obtained pixel value to the filling pixel; if the coordinate exceeds the image range, skip the coordinate; store all valid filling pixels and their coordinate information to obtain the final filling pixel data.

[0143] The present invention realizes high efficiency, high precision and high adaptability of image processing. The adaptive multi-scale grid division technology establishes an efficient processing structure for complex images in the initialization stage, reducing the amount of subsequent calculations, especially when processing large-scale images, the processing speed is increased by 2-3 times. The similarity measurement based on deep learning and the regional segmentation of graph cuts improve the accuracy of image segmentation. In scenes with complex textures and fuzzy boundaries, the segmentation accuracy is improved by 15%-25%, laying a solid foundation for subsequent processing. Multi-scale frequency analysis and resolution adjustment algorithms based on graph convolution networks realize highly intelligent resource allocation, while maintaining the quality of boundary detection, the overall amount of calculation is reduced by 30%-50%. Adaptive curve subdivision and parallel filling algorithms improve the efficiency and quality of pixel filling, especially when processing complex boundaries, the boundary fitting accuracy is improved by 15%-25%, and the filling speed is increased by 3-5 times. The image enhancement and restoration technology based on deep learning improves the naturalness and realism of the filling results, and the improvement is 30%-50% in subjective visual quality evaluation. The present invention performs well in processing various complex image scenes, such as object removal in high-resolution landscape photos and defect repair in medical images. It can not only accurately restore boundary details, but also generate filling content that is highly coordinated with the surrounding environment. Compared with traditional methods, the present invention improves processing efficiency by 2-4 times and image quality by 20%-40%. At the same time, it has stronger adaptability and can automatically adjust processing strategies to adapt to different image features. The present invention provides strong technical support for fields such as image editing, computer vision and image analysis, and is expected to have a significant impact in practical applications.

[0144] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.

Claims

1. An efficient pixel filling method based on adaptive boundary detection technology, characterized in that: The steps include: S1, obtaining original image data, preprocessing and initializing the original image data to obtain processed image data; based on the processed image data, performing adaptive multi-scale grid division to obtain initial grid division data; S2. Based on the initial grid division data, a similarity graph of image pixels is constructed. Based on the similarity graph, an energy function including data terms and smoothing terms is constructed; the minimum cut algorithm is used to solve the optimal segmentation of the energy function to obtain a preliminary region segmentation result; the preliminary region segmentation result is post-processed to obtain the final filling region division data; S3, performing local frequency analysis on each filling area in the filling area division data to obtain analysis results; Based on the analysis results, the boundary detection resolution is dynamically adjusted to obtain adaptive resolution data; S4, performing initial sampling and curve subdivision on the boundary of each filling area in the filling area division data to generate a fine boundary point set; based on the boundary point set and the adaptive resolution data, executing the improved scan line algorithm to perform area filling to obtain a filling result; merging the filling results to obtain filling data for the entire image; Step S1 is further as follows: S11, acquiring original image data, reading graphic features of the original image data, including width, height, and two-dimensional pixel matrix of the original image data; determining graphic processing parameters based on the graphic features and pre-stored device performance parameters, including minimum and maximum values ​​of graphic complexity, and minimum and maximum values ​​of resolution; storing the graphic processing parameters and the original image data as an initialization data set; S12. Based on the initialization data set, use the Sobel operator to perform convolution operation to obtain the horizontal gradient and the vertical gradient; based on the horizontal gradient and the vertical gradient, calculate the gradient amplitude of each pixel; calculate the mean of the gradient amplitudes of all pixels as the global complexity index; Add the global complexity index to the initialization data set to obtain an updated initialization data set; S13, using the updated initialization data set as the initial grid and calculating the local complexity index; if the local complexity index is greater than a preset threshold, dividing the initial grid into a predetermined number of sub-grids; repeating the division process for each sub-grid until the local complexity index is less than the preset threshold, and obtaining the grid information after division; using a quadtree data structure to store the grid information after division as the initial grid division data; Step S2 is further as follows: S21. Based on the initial grid division data, use the Gaussian kernel function to calculate the color similarity and spatial distance similarity between grid cells, combine the color similarity and the spatial distance similarity to obtain a comprehensive similarity; based on the comprehensive similarity, construct an undirected graph as similarity graph data; S22, analyzing the color features of the grid cells based on the similarity graph data; Calculate data items of energy function based on color features and pre-trained color model; Based on the comprehensive similarity, the smoothing term of the energy function is calculated; based on the data term and the smoothing term, the energy function is constructed; Use the minimum cut algorithm to minimize the energy function and obtain the optimal segmentation label as the preliminary segmentation result data; S23, based on the preliminary segmentation result data, counting the size of each region; For an area smaller than a preset threshold, calculate its similarity with adjacent areas, and merge the area smaller than the preset threshold into the adjacent area with the greatest similarity; repeat until there is no area smaller than the threshold, and obtain segmentation result data; assign a unique identifier to each area of ​​the segmentation result data, and calculate the boundary pixel coordinates of the area; organize the identifier, size and boundary pixel coordinates of the area into filling area division data; Step S3 is further as follows: S31, extracting pixel data of each filling area based on the filling area division data; Perform a two-dimensional discrete Fourier transform on the pixel data to obtain transformed spectrum data; based on the transformed spectrum data, calculate the spectrum amplitude, normalize the spectrum amplitude to obtain the normalized spectrum amplitude; based on the normalized spectrum amplitude, calculate the spectrum characteristics, including the high-frequency energy ratio and the spectrum entropy; store the spectrum characteristics of each filling area as spectrum analysis data; S32, constructing a resolution mapping function based on the spectrum analysis data; The resolution mapping function is normalized using the minimum and maximum values ​​of the resolution to obtain a normalized resolution mapping function; the spectrum characteristics of each filling area are input into the normalized resolution mapping function to obtain an initial resolution value; storing the initial resolution value of each filled area as initial resolution data; S33, calculating the mean and standard deviation of the initial resolution data; For initial resolution data that deviated from the mean by more than two standard deviations, they were adjusted to be within the range of mean ± two standard deviations to obtain preliminary adjusted resolution data; Based on the preliminary adjusted resolution data, the resolution difference of adjacent areas is calculated. If the resolution difference exceeds a preset threshold, the preliminary adjusted resolution data of the adjacent areas is smoothed to obtain smoothed resolution data; ensuring that the smoothed resolution data is still within the minimum and maximum ranges of the resolution, the adjusted resolution data is output; Adding a filling area identifier to the adjusted resolution data, and storing the filling area identifier and the adjusted resolution data as adaptive resolution data; Step S4 is further as follows: S41, based on the adaptive resolution data, initially sampling the boundary of each filling area in the filling area division data to obtain initial sampling points; using the Chaikin subdivision algorithm to subdivide the initial sampling points to obtain subdivided sampling points; based on the subdivided sampling points, repeating the subdivision process until a preset subdivision level is reached or the distance between adjacent sampling points is less than a preset threshold, and outputting the final subdivided sampling points; Based on the sampling points after the final subdivision, the curvature of the boundary points is calculated, sampling points are added in the area where the curvature of the boundary points is higher than a preset curvature threshold, and the sampling points after the final subdivision and the added sampling points are stored as refined boundary data; S42, determining the scanning line direction based on the refined boundary data; Based on the adaptive resolution data, the scan line spacing is determined; based on the scan line direction and the scan line spacing, the intersection point of each scan line with the boundary is calculated; The intersection points are sorted and paired in pairs to obtain intersection point pairs; for the pixels between each intersection point pair, the filling step length is determined based on the adaptive resolution data, and the filling operation is performed, and the color value of the filling point is calculated using bilinear interpolation to obtain the filling result; the filling result of each area is stored as area filling data; S43, constructing a blank image of the same size as the original image data; copying the region filling data to the corresponding position in the order of the filling region identifiers to obtain preliminary filling data; using an alpha blending algorithm to perform a smooth transition on pixels at the region boundary in the preliminary filling data to obtain smoothed filling data; performing a global color consistency check on the smoothed filling data to obtain adjusted filling data, which is the filling data for the entire image; Step S21 is further as follows: S211, based on the initial grid division data, use the pre-trained deep convolutional neural network to extract feature maps; pool the values ​​of the area corresponding to each grid unit in each feature map to obtain a feature vector of fixed dimension; organize the feature vectors of all grid units into deep feature data; S212, based on the deep feature data, calculating the feature similarity of each pair of adjacent grid cells; obtaining the spatial position of the grid cells, and constructing a spatial distance weight; Combine feature similarity and spatial distance weight to obtain comprehensive similarity; store the comprehensive similarity of all adjacent grid cell pairs as similarity matrix data; S213, constructing an undirected graph based on the similarity matrix data; performing sparse processing on the undirected graph to obtain a processed undirected graph; and storing the processed undirected graph as similarity graph data; Step S33 is further as follows: S331, constructing a region adjacency graph based on the initial resolution data and the filling region division data to obtain region graph data; S332, inputting the region map data into a preconfigured graph convolutional network to generate a potential feature representation of each region; Mapping latent feature representations to predicted resolution values; S333, limiting the predicted resolution value within the range of the minimum and maximum values ​​of the resolution to obtain a limited resolution value; based on the limited resolution value, detecting and smoothing abnormal values ​​to obtain a smoothed resolution value; based on the smoothed resolution value, performing global normalization to obtain a globally normalized resolution value; Adding a fill region identifier to the globally normalized resolution value, and storing the fill region identifier and the globally normalized resolution value as adaptive resolution data; Step S43 is further as follows: S431, using a pre-trained anomaly detection model to identify unnatural areas in the region filling data; at the same time, using edge detection and texture analysis algorithms to identify discontinuous boundary areas in the region filling data; storing the positions and feature information of the unnatural areas and the discontinuous boundary areas as repair region data; S432, inputting the repair area data and the surrounding context information into the pre-trained conditional generative adversarial network model to generate a predetermined number of candidate repair results; Use the discriminator network to evaluate the authenticity of candidate restoration results and select the best restoration result; storing the best restoration result as restoration image data; S433, based on the repaired image data and the area filling data, a global color balance algorithm is used to obtain image data with consistent tone; Based on the image data with consistent tone, the texture synthesis algorithm based on patch matching is used to obtain enhanced image data; Based on the enhanced image data, an edge-aware filtering algorithm is used to obtain smooth image data; based on the smoothed image data, a super-resolution model based on deep learning is used to obtain optimized complete image data, which is the filling data of the entire image; Step S31 is further as follows: S311, constructing a Gaussian pyramid of the image based on the filled area division data to obtain multi-scale image data; S312, based on the multi-scale image data, extracting the image blocks corresponding to each scale and each filling area; based on the extracted image blocks, applying the Hanning window to reduce the edge effect to obtain the optimized image blocks; based on the optimized image blocks, performing a two-dimensional discrete Fourier transform to obtain the transformed spectrum data; based on the transformed spectrum data, calculating the spectrum amplitude and normalizing it to obtain the normalized spectrum amplitude; based on the normalized spectrum amplitude, calculating the spectrum features; The spectrum characteristics of each scale and each filling area are stored as multi-scale spectrum characteristic data; S313, based on the multi-scale spectrum feature data, using a weighted average method to fuse the spectrum features of different scales in each filling area to obtain a fused spectrum feature of each filling area; The principal components of the fused spectrum features are calculated, and the first K principal components are selected as the final spectrum features; the final spectrum features of each filled area are stored as spectrum analysis data.

2. An efficient pixel filling system based on adaptive boundary detection technology, characterized in that: include: at least one processor; as well as, a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the efficient pixel filling method of the adaptive boundary detection technology described in claim 1.

Citation Information

Patent Citations

  • De-screening method of halftone image based on dot detection and dot padding

    CN101552860A

  • High-resolution image reconstruction method and device and hidden crack nondestructive testing system

    CN110211091A