A stripe center extraction method and device based on GVF and semi-implicit variation, and a medium

By employing GVF and a semi-implicit variational method, the robustness of laser fringe centerline extraction under topological breaks and high reflectivity noise was solved, achieving efficient and stable fringe centerline extraction and improving the accuracy and efficiency of 3D reconstruction.

CN123160634APending Publication Date: 2026-11-24INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611226355.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing laser stripe centerline extraction methods suffer from poor robustness under conditions such as the inability to automatically repair topological fractures, high reflectivity, and strong noise interference, and the curve evolution model struggles to balance large-scale convergence and numerical stability.

Method used

Using GVF and semi-implicit variational methods, the fracture region is coarsely located and repaired by interpolation through the gray-scale centroid method. A normalized gradient vector flow field is constructed as the external force field, and a five-diagonal stiffness matrix is ​​constructed and iteratively solved. By combining natural boundary conditions and an iterative matrix pre-decomposition strategy, the stable evolution of the curve is achieved.

Benefits of technology

The algorithm's robustness and wide-range convergence capability are improved in high reflectivity and strong noise environments, significantly enhancing numerical stability and computational efficiency, and ensuring sub-pixel accuracy in 3D reconstruction quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160634A_ABST
    Figure CN123160634A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, and medium for extracting fringe centers using GVF and semi-implicit variational methods, relating to the field of image processing technology. The method includes: preprocessing the target image to obtain a smoothed image; calculating the gray-level centroid and performing break interpolation repair on the smoothed image to generate a topologically continuous initial contour; constructing a normalized gradient vector flow field as an external force field based on the gradient field of the smoothed image; constructing the stiffness matrix of the curve and pre-calculating and iteratively solving the stiffness matrix; using the initial contour as the current curve, entering an iterative loop, updating the curve position according to the external force field in each iteration until the convergence condition is met, and outputting the final curve coordinates as the laser fringe center line. This application achieves topologically continuous and numerically stable extraction of the laser fringe center line in complex industrial environments such as high reflectivity, strong noise, and fringe breakage using the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus and medium for fringe center extraction using GVF and semi-implicit variational methods. Background Technology

[0002] Line structured light 3D reconstruction technology projects a linear laser line onto the surface of an object, acquires an image containing deformed laser stripes, and calculates the 3D spatial coordinates of the object's surface using triangulation principles. It has been widely applied in fields such as industrial online inspection, robot guidance and positioning, and reverse engineering. In the 3D reconstruction process, the accuracy of extracting the laser stripe centerline directly determines the reconstruction quality of the 3D point cloud and the system resolution. Currently, mainstream laser stripe centerline extraction methods in the industry include grayscale centroid method, skeleton extraction method, Gaussian surface fitting method, Steger algorithm, and template matching method.

[0003] However, the aforementioned existing technologies still have the following shortcomings in practical industrial applications: First, oil stains, rust, or geometric occlusion on the surface of the object being measured can cause physical breaks in the laser stripes on the image. Traditional methods are based on local neighborhood pixel calculations and lack global geometric constraints, making it impossible to perceive the overall topological structure of the lines. The broken line segments output result in missing subsequent 3D point cloud data. Second, high reflectivity, speckle noise, or complex background textures on the object's surface can form false bright noise points in the image. Traditional methods are easily attracted by such noise points, causing the center line to jump or produce false points, which seriously interferes with the accuracy of 3D reconstruction. Third, although active contour models can achieve curve evolution through energy functional minimization, traditional gradient vector flow fields have a small capture range in flat areas and are prone to numerical overflow at strong edges. Furthermore, fully implicit solutions have a large computational load, and fully explicit solutions are prone to oscillations, making it difficult to achieve a balance between accuracy, stability, and computational efficiency.

[0004] Based on the above analysis, the problems and shortcomings of the existing technology are as follows: Existing laser stripe centerline extraction methods suffer from poor robustness under conditions such as the inability to automatically repair topological fractures, high reflectivity, and strong noise interference, and the curve evolution model struggles to balance large-scale convergence and numerical stability. Summary of the Invention

[0005] This application provides a method, device, and medium for extracting fringe centers using GVF and semi-implicit variational methods. These methods can solve the problems of existing laser fringe centerline extraction methods, such as the inability to automatically repair topological breaks, poor robustness under strong noise interference such as high reflectivity, and the difficulty in balancing large-scale convergence and numerical stability of curve evolution models.

[0006] In a first aspect, embodiments of this application provide a method for extracting fringe centers using GVF and semi-implicit variational methods. The method includes: preprocessing a target image to obtain a smoothed image; performing grayscale centroid calculation and break interpolation repair on the smoothed image to generate a topologically continuous initial contour; constructing a normalized gradient vector flow field as an external force field based on the gradient field of the smoothed image; constructing the stiffness matrix of the curve and pre-calculating and iteratively solving the stiffness matrix; using the initial contour as the current curve, entering an iterative loop, updating the curve position according to the external force field in each iteration until the convergence condition is met, and outputting the final curve coordinates as the laser fringe center line.

[0007] In one implementation of this application, grayscale centroid calculation and breakage interpolation repair are performed on a smooth image, specifically including: calculating the grayscale centroid column by column of the smooth image to obtain a centroid point column; performing outlier detection on the centroid point column, marking centroid points that are determined to be outliers as invalid points, and the rest as valid points; and using the nearest valid points on both sides of the invalid point to perform linear interpolation to fill the region corresponding to the invalid point.

[0008] In one implementation of this application, a normalized gradient vector flow field is constructed as an external force field based on the gradient field of the smoothed image. Specifically, this includes: calculating the image gradient field based on the smoothed image; constructing a normalized weight function based on the gradient magnitude of the image gradient field; using the normalized weight function as the coefficient of the reaction term, iteratively solving the normalized gradient vector flow diffusion equation to obtain a steady-state vector field as the external force field.

[0009] In one implementation of this application, the stiffness matrix of the curve is constructed, and the iterative solution of the stiffness matrix is ​​pre-calculated. Specifically, this includes: constructing the five-diagonal stiffness matrix of the curve based on preset elastic parameters and rigidity parameters; constructing the iterative solution matrix based on the five-diagonal stiffness matrix and a preset time step; performing sparse matrix decomposition on the iterative solution matrix, and pre-storing the decomposition results.

[0010] In one implementation of this application, the curve position is updated according to the external force field in each iteration, specifically including: interpolating the external force at each point in the external force field based on the current curve position; constructing the right-hand side of the linear equation system based on the current curve position and the external force; and solving the linear equation system using the iterative solution matrix to obtain the updated curve position.

[0011] In one implementation of this application, the method further includes: extracting the coordinate vectors of each discrete point of the current curve and the curve coordinate vector corresponding to the previous iteration; calculating the internal elastic force generated by the elastic deformation of the curve and the internal rigid force generated by the bending deformation of the curve in the coordinate vector using an implicit discretization scheme with the unknown curve position at the current moment as the variable, to obtain the implicit solution of the internal force; and calculating the external driving force provided by the external force field at the current curve position using an explicit discretization scheme with the known curve position at the previous moment as the variable, to obtain the explicit solution of the external force.

[0012] In one implementation of this application, after constructing the five-diagonal stiffness matrix of the curve based on preset elastic and rigid parameters, the method further includes: modifying the row vectors in the five-diagonal stiffness matrix corresponding to the discrete points at the beginning of the curve to make the bending moment at the beginning of the curve zero; modifying the row vectors in the five-diagonal stiffness matrix corresponding to the discrete points at the end of the curve to make the bending moment at the end of the curve zero; modifying the column vectors in the five-diagonal stiffness matrix corresponding to the discrete points at the beginning of the curve to make the shear force at the beginning of the curve zero; and modifying the column vectors in the five-diagonal stiffness matrix corresponding to the discrete points at the end of the curve to make the shear force at the end of the curve zero.

[0013] In one implementation of this application, a normalized weight function is constructed based on the gradient magnitude of the image gradient field. Specifically, this includes: calculating the square of the gradient magnitude of each pixel in the image gradient field to obtain a gradient magnitude square matrix; traversing the gradient magnitude square matrix to determine the maximum value; and dividing the square of each gradient magnitude in the gradient magnitude square matrix by the algebraic sum of the maximum value and a preset infinitesimal value to obtain a normalized weight matrix.

[0014] Secondly, embodiments of this application also provide a fringe center extraction device using GVF and semi-implicit variational methods. The device includes at least one processor and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform any step of a fringe center extraction method using GVF and semi-implicit variational methods.

[0015] Thirdly, embodiments of this application also provide a non-volatile computer storage medium for fringe center extraction using GVF and semi-implicit variational methods, storing computer-executable instructions configured to perform any one of the steps of a fringe center extraction method using GVF and semi-implicit variational methods.

[0016] This application provides a method, device, and medium for fringe center extraction using GVF and semi-implicit variational methods. It employs an improved grayscale centroid method for coarse localization, calculates the centroid column by column, detects outliers using a jump threshold, and repairs broken areas using linear interpolation. This automatically generates a topologically continuous initial contour, effectively solving the data loss problem caused by fringe breaks under conditions such as oil contamination and occlusion in traditional methods. Furthermore, by constructing a normalized weight function to compress the image gradient magnitude to the [0,1] interval and iteratively solving the gradient vector flow diffusion equation to obtain a steady-state vector field as an external driving force, it overcomes the limitations of traditional methods. Traditional gradient vector flow suffers from limitations such as a small capture range in flat regions and numerical overflow at strong edges. This algorithm significantly improves robustness and wide-range convergence in highly reflective and noisy industrial scenarios. By constructing a five-diagonal stiffness matrix and applying natural boundary conditions to make the bending moment and shear force at the endpoints of open curves zero, a semi-implicit iterative scheme is used to implicitly solve internal forces to ensure unconditional stability and explicitly solve external forces to reduce computational load. Furthermore, a pre-decomposition strategy of the iterative matrix is ​​employed to achieve a step where only previous and back iterations are required. This significantly improves numerical stability and computational efficiency while maintaining sub-pixel accuracy. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a fringe center extraction method using GVF and semi-implicit variational methods provided in this application embodiment; Figure 2 This is a schematic diagram of the internal structure of a fringe center extraction device using GVF and semi-implicit variational methods, provided as an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] This application provides a method, device, and medium for extracting fringe centers using GVF and semi-implicit variational methods. It solves the problems of existing laser fringe centerline extraction methods, such as the inability to automatically repair topological breaks, poor robustness under strong noise interference such as high reflectivity, and the difficulty in balancing large-scale convergence and numerical stability of curve evolution models.

[0020] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0021] Figure 1 This is a flowchart illustrating a fringe center extraction method using GVF and semi-implicit variational methods, provided as an embodiment of this application. Figure 1 As shown in the figure, the fringe center extraction method of GVF and semi-implicit variational methods provided in this application specifically includes the following steps: Step 10: Preprocess the target image to obtain a smooth image.

[0022] In this step, the input image is the raw laser stripe image captured by an industrial camera, denoted as I(x,y), where (x,y) represents the pixel coordinates. Since image sensors inevitably introduce background noise and high-frequency speckle noise during the acquisition process, which can interfere with the accurate positioning of the stripe center, the input image is first preprocessed with smoothing. Specifically, Gaussian smoothing filtering suppresses high-frequency noise by convolving the image with a Gaussian kernel, while preserving the edge structure of the stripes as much as possible.

[0023] Step 20: Perform grayscale centroid calculation and break interpolation repair on the smoothed image to generate a topologically continuous initial contour.

[0024] In this step, after obtaining the smooth image, the improved gray-scale centroid method is used to coarsely locate the laser stripes. The purpose is to obtain an initial contour that is topologically continuous, without breaks, and roughly located at the center of the stripes, so as to provide a good initial position for the accurate evolution of the subsequent variational model and avoid the model from getting trapped in local minima.

[0025] Since the laser stripes projected by a line laser projector usually appear as bright bands in the horizontal or near-horizontal direction in the image, the center position of the stripes in each column is located by calculating the gray-scale centroid column by column. If the projection direction of the laser stripes is vertical, the calculation method can be used row by row. Those skilled in the art can make adaptive adjustments according to the actual laser projection direction.

[0026] As an optional embodiment, grayscale centroid calculation and breakage interpolation repair are performed on the smooth image, specifically including: Step 201: Calculate the grayscale centroid column by column for the smooth image to obtain the centroid point column.

[0027] In this step, for each column x in the smoothed image, the gray-level centroid coordinates y of the laser stripe region in that column are calculated. c (x), the formula for calculating the grayscale centroid is as follows:

[0028] Where Ω is the set region of interest, and the initial centroid column is obtained by traversing all columns of the image or only traversing the range of columns containing laser stripes.

[0029] Step 202: Perform outlier detection on the centroid point column, mark the centroid points that are determined to be outliers as invalid points, and the rest are valid points.

[0030] In this step, in actual industrial scenarios, highly reflective areas, speckle noise, or complex background textures on the surface of the object being tested may form false bright areas in the image. These bright areas are not the true center of the laser stripes, but because of their high brightness, they will deflect the calculation results of the grayscale centroid, causing the centroid to deviate from the true stripe position and form outliers.

[0031] To remove outliers, anomaly detection is performed on the centroid column, and the difference between the centroids of adjacent columns is calculated:

[0032] Where Δy represents the absolute value of the difference between the centroid coordinates of column x and column (x-1), Δy is compared with a preset transition threshold: if Δy is greater than the threshold, then the current point y is determined. c (x) is an outlier and is marked as an invalid point; otherwise, it is considered a valid point.

[0033] Step 203: Use the nearest valid points on both sides of the invalid point to perform linear interpolation to fill the region corresponding to the invalid point.

[0034] In this step, there may be one or more consecutive regions marked as invalid points in the centroid point series. These invalid regions correspond to physical breaks in the laser stripes or highly reflective noise areas. In order to obtain an initial contour with topological continuity, these invalid regions need to be filled.

[0035] For each consecutive invalid point region, search for the nearest valid centroid to the left and right sides respectively. Let P be the nearest valid centroid to the left side. L =(x L ,y L The nearest valid centroid on the right is P. R =(x R ,y R ), then for any column x (x) within the invalid region L <x<x R The interpolation point coordinates are calculated using the following linear interpolation formula: y interp (x)=y L + (x x L ) The calculated interpolation points are filled into the column positions corresponding to the invalid regions to obtain a complete initial centroid column, which serves as the initial contour for the subsequent evolution of the variational model. .

[0036] Step 30: Based on the gradient field of the smoothed image, construct a normalized gradient vector flow field as an external force field.

[0037] In this step, the application introduces a normalized gradient vector flow field as an external force field, which propagates the image gradient information from the edge region outward through a diffusion mechanism, significantly expanding the capture range of the external force; the normalization process compresses the gradient magnitude to a finite range, eliminating the risk of numerical overflow.

[0038] As an optional embodiment, a normalized gradient vector flow field is constructed as an external force field based on the gradient field of the smoothed image. Specifically, this may include: Step 301: Calculate the image gradient field based on the smoothed image.

[0039] In this step, the gradient field is calculated for the smoothed image. f = (fx, fy), where fx and fy are the partial derivatives of the image in the horizontal and vertical directions, respectively; after obtaining the gradient field, the gradient magnitude of each pixel is further calculated:

[0040] Step 302: Construct a normalized weight function based on the gradient magnitude of the image gradient field; As an optional embodiment, a normalized weight function is constructed based on the gradient magnitude of the image gradient field, which may specifically include: Step 3021: Calculate the squared value of the gradient magnitude of each pixel in the image gradient field to obtain the gradient magnitude square matrix.

[0041] In this step, for the image gradient field For each pixel (x, y) in f, calculate the squared value of the gradient magnitude. f(x,y)|², iterates through all pixels in the entire image, and constructs a gradient magnitude square matrix with the same size as the original image.

[0042] Step 3022: Traverse the gradient magnitude square matrix to determine the maximum value.

[0043] In this step, we iterate through all elements of the gradient magnitude squared matrix and find the maximum value, denoted as max(| f|²) represents the squared value of the gradient magnitude in the region with the most dramatic gradient change in the entire image.

[0044] Step 3023: Divide the square of each gradient magnitude in the gradient magnitude square matrix by the algebraic sum of the maximum value and a preset infinitesimal value to obtain the normalized weight matrix.

[0045] In this step, each element value in the gradient magnitude square matrix is ​​| f(x,y)|², divided by the maximum value max(| The algebraic sum of f|² and a pre-defined infinitesimal ε (i.e., max(| f|²)+ε), to obtain the normalized weight value b(x,y) of the corresponding pixel:

[0046] In this step, all pixels are traversed to obtain the normalized weight matrix. The value range of b(x,y) is strictly controlled within the interval [0,1], which completely eliminates the numerical problem caused by excessive gradient magnitude. ε is a preset small positive number used to prevent the denominator from being zero.

[0047] Step 303: Using the normalized weight function as the coefficient of the reaction term, iteratively solve the normalized gradient vector flow diffusion equation to obtain the steady-state vector field as the external force field.

[0048] In this step, solving the normalized GVF field is transformed into solving the steady-state reaction-diffusion equations:

[0049]

[0050] Where u and v are two components of the GVF field, i.e., V(x,y)=[u(x,y),v(x,y)] μ is a preset diffusion coefficient that controls the degree of gradient information diffusion from the edge region to the flat region; b(x,y) is the weight value corresponding to each pixel in the normalized weight matrix constructed in step 302. ² represents the Laplace operator.

[0051] The diffusion equations are solved iteratively until they converge to a steady state. After obtaining the steady-state solutions u and v, the normalized GVF field is V. final (x,y)=[u(x,y),v(x,y)] This vector field is the external force field used in the subsequent curve evolution.

[0052] Step 40: Construct the stiffness matrix of the curve and pre-calculate and iteratively solve the stiffness matrix.

[0053] In this step, after obtaining the initial profile and external force field, the curve evolution equation in continuous space is discretized to construct a stiffness matrix for solving. The decomposition and storage of the iterative solution matrix are completed in advance to improve the computational efficiency of subsequent iterations.

[0054] As an optional embodiment, the stiffness matrix of the curve is constructed, and the stiffness matrix is ​​pre-calculated and iteratively solved. Specifically, it may include: Step 401: Construct the five-diagonal stiffness matrix of the curve according to the preset elastic parameters and rigidity parameters.

[0055] In this step, the initial contour will be... The internal force terms in the Euler-Lagrange equations are discretized into N discrete points, arranged in order of the curve's direction. The finite difference method is used to discretize these internal force terms. The spatial derivative is approximated using the central difference method, representing the internal force αv''(s)-βv. (s) is transformed into matrix form -AV, where A is a pentagonal stiffness matrix, α is a preset elastic parameter (controlling the continuity of the curve), and β is a preset stiffness parameter (controlling the smoothness of the curve).

[0056] Step 402: Construct the iterative solution matrix based on the five-diagonal stiffness matrix and the preset time step. In this step, according to the semi-implicit iterative scheme, the time-discrete form of the curve evolution equation is:

[0057] Where τ is the preset time step, which controls the advance distance of each iteration; γ is the preset external force weight coefficient, which controls the degree of influence of external forces on the curve evolution.

[0058] After simplification, we obtain the following system of linear equations:

[0059] Let the iterative solution matrix be M = I + τA, where I is the identity matrix.

[0060] Step 403: Perform sparse matrix decomposition on the iterative solution matrix and pre-store the decomposition results.

[0061] In this step, since M remains unchanged during the iteration process (α, β, and τ are all constants) and is independent of the image content, a matrix decomposition of M can be performed before the iteration begins, and the decomposition result can be pre-stored. Thus, in each iteration, only the previous and back substitutions are needed to quickly solve the problem.

[0062] Step 50: Using the initial contour as the current curve, enter the iteration loop. In each iteration, update the curve position according to the external force field until the convergence condition is met, and output the final curve coordinates as the center line of the laser stripe.

[0063] In this step, after obtaining the initial profile, external force field, and pre-decomposed iterative solution matrix through the aforementioned steps, a semi-implicit iterative evolution of the curve is performed, so that the initial profile gradually approaches the actual center position of the laser stripe under the combined action of the external force field and internal constraints.

[0064] As an optional embodiment, the curve position is updated according to the external force field in each iteration, which may specifically include: Step 501: Based on the current curve position, interpolate the external force at each point in the external force field.

[0065] In this step, let the current curve position be... For each discrete point on the curve, it is necessary to obtain the value from the external force field F. ext To obtain the external force vector at a given point, since the coordinates of curve points are usually floating-point numbers and may not fall exactly on the image grid points, interpolation is required. This embodiment uses bilinear interpolation, which involves locating the grid cell containing the coordinates of each discrete point in the two-dimensional grid of the external force field, and then using bilinear interpolation within each grid cell to calculate the external force vector at each discrete point.

[0066] Step 502: Based on the current curve position and external force, construct the right-hand side of the linear equation system.

[0067] In this step, the obtained external force vector is substituted into the semi-implicit iterative scheme to construct the right-hand side of the linear equation system:

[0068] Where b is the right-hand vector. τ is the coordinate vector of the current curve position, τ is the preset time step, and γ is the preset external force weighting coefficient.

[0069] Step 503: Solve the linear equation system using the iterative solution matrix to obtain the updated curve position.

[0070] In this step, using the pre-stored matrix decomposition results, the linear equation system is:

[0071] Solve the problem to obtain the updated curve position vector. The updated curve position is used as the current curve position, and the next iteration begins. Steps 501 to 503 are repeated until the convergence condition is met. The convergence condition is determined as follows: if the change in position between two consecutive iterations is less than a threshold, or if the maximum number of iterations is reached, the iteration stops.

[0072] As an optional embodiment, the method may further include: extracting the coordinate vectors of each discrete point of the current curve, and the curve coordinate vector corresponding to the previous iteration; calculating the internal elastic force generated by the elastic deformation of the curve and the internal rigid force generated by the bending deformation of the curve in the coordinate vector using an implicit discretization scheme with the unknown curve position at the current moment as the variable, to obtain the implicit solution of the internal force; and calculating the external driving force provided by the external force field at the current curve position using an explicit discretization scheme with the known curve position at the previous moment as the variable, to obtain the explicit solution of the external force.

[0073] In this step, based on curve evolution theory, the center line of the laser stripe is modeled as a parameterized curve v(s), and its evolution process is controlled by the Euler-Lagrange equations:

[0074] Where αv''(s) is the internal elastic force generated by the elastic deformation of the curve, and -βv''''(s) is the internal rigid force generated by the bending deformation of the curve. Together, they constitute the internal force term, which determines the smoothness and continuity of the curve; P(v) represents the external driving force, which propels the curve toward the target position based on image data. To balance stability and computational efficiency in the numerical solution, this application employs a semi-implicit time-mapping strategy, using an implicit scheme for the linear internal force, i.e., using the current unknown curve position as the time-mapping parameter. Discretize the variables, transforming the internal force term αv''-βv'''' into -A Where A is the pentagonal stiffness matrix, this scheme has unconditional stability, allowing for larger time steps without numerical oscillations. For external forces, an explicit scheme is used, calculating the external force value from the known curve position at the previous time step, treating it as a known quantity to avoid the complex calculations of solving nonlinear equations. The specific iterative scheme for separating internal and external forces is as follows:

[0075] The left side of the equal sign represents the time difference of the curve's position, and the first term on the right side is -A. For implicitly handled internal forces, the second term on the right. For external forces that are explicitly processed, the two are calculated separately and then jointly drive the curve evolution. This not only ensures numerical stability but also avoids the problem of solving large-scale nonlinear equations caused by nonlinear coupling of external forces in fully implicit schemes. It has significant computational efficiency advantages in industrial online measurement scenarios.

[0076] As an optional embodiment, after constructing the five-diagonal stiffness matrix of the curve based on preset elastic and rigidity parameters, the method may further include: modifying the row vectors in the five-diagonal stiffness matrix corresponding to the discrete points at the beginning of the curve so that the bending moment at the beginning of the curve is zero; modifying the row vectors in the five-diagonal stiffness matrix corresponding to the discrete points at the end of the curve so that the bending moment at the end of the curve is zero; modifying the column vectors in the five-diagonal stiffness matrix corresponding to the discrete points at the beginning of the curve so that the shear force at the beginning of the curve is zero; and modifying the column vectors in the five-diagonal stiffness matrix corresponding to the discrete points at the end of the curve so that the shear force at the end of the curve is zero.

[0077] In this step, the center line of the laser stripe is a non-closed curve, with its two endpoints located at the image boundary or the start / end position of the stripe. During the curve evolution, if no constraints are applied to the endpoints, the lack of support from adjacent points makes them prone to unnatural bending or drifting under the pull of external forces, affecting the extraction accuracy of the entire curve. Therefore, this application applies natural boundary conditions to the curve endpoints: the application of natural boundary conditions is achieved by modifying the rows and columns of the five-diagonal stiffness matrix A. For the first discrete point, the corresponding row vector is modified to make the second derivative at the first discrete point of the curve zero, i.e., the bending moment at the first discrete point is zero; at the same time, the corresponding column vector is modified to make the third derivative at the first discrete point of the curve zero, i.e., the shear force at the first discrete point is zero; for the last discrete point, the corresponding row and column vectors are modified in the same way to make both the bending moment and shear force at the last discrete point zero.

[0078] After performing the above row and column corrections on the five-diagonal stiffness matrix, the evolution of the endpoints is controlled by the natural boundary conditions of the Euler-Lagrange equations. This is equivalent to applying a free end constraint to the curve at the endpoints, which allows the endpoints to move freely in space while ensuring a natural transition of curvature at the endpoints without generating additional bending stress. This ensures the smoothness of the entire curve while avoiding the problem of endpoint distortion. The stiffness matrix only needs to be processed once before the iteration begins, without increasing the computational burden during the iteration process.

[0079] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide a fringe center extraction device using GVF and semi-implicit variational methods, the structure of which is as follows: Figure 2 As shown.

[0080] Figure 2 This is a schematic diagram of the internal structure of a fringe center extraction device using GVF and semi-implicit variational methods, provided as an embodiment of this application. Figure 2 As shown, the device includes: At least one processor 201; And a memory 202 that is communicatively connected to at least one processor; The memory 202 stores instructions that can be executed by at least one processor, which is executed by at least one processor 201 to enable at least one processor 201 to: perform any step of a fringe center extraction method of GVF and semi-implicit variation.

[0081] Some embodiments of this application provide corresponding to Figure 1 A non-volatile computer storage medium for fringe center extraction using GVF and semi-implicit variational methods is provided, storing computer-executable instructions configured to execute any step of a fringe center extraction method using GVF and semi-implicit variational methods.

[0082] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for IoT devices and media are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0083] The systems, media, and methods provided in this application are one-to-one correspondences. Therefore, the systems and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be repeated here.

[0084] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0085] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0086] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0087] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0088] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0089] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0090] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0091] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0092] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for fringe center extraction using GVF and semi-implicit variational methods, characterized in that, The method includes: The target image is preprocessed to obtain a smooth image; The smoothed image is subjected to grayscale centroid calculation and break interpolation repair to generate an initial contour with topological continuity. Based on the gradient field of the smoothed image, a normalized gradient vector flow field is constructed as an external force field; Construct the stiffness matrix of the curve and pre-calculate and iteratively solve the stiffness matrix; The initial contour is used as the current curve, and an iterative loop is entered. In each iteration, the curve position is updated according to the external force field until the convergence condition is met. The final curve coordinates are then output as the center line of the laser stripe.

2. The fringe center extraction method of GVF and semi-implicit variational geometry according to claim 1, characterized in that, The smoothed image undergoes grayscale centroid calculation and breakage interpolation repair, specifically including: Calculate the gray-level centroids column by column for the smoothed image to obtain the centroid point column; Anomaly detection is performed on the centroid point sequence. Centroid points that are determined to be abnormal are marked as invalid points, and the rest are valid points. Linear interpolation is performed using the nearest valid points on both sides of the invalid point to fill the region corresponding to the invalid point.

3. The fringe center extraction method of GVF and semi-implicit variational geometry according to claim 1, characterized in that, Based on the gradient field of the smoothed image, a normalized gradient vector flow field is constructed as an external force field, specifically including: Calculate the image gradient field based on the smoothed image; A normalized weighting function is constructed based on the gradient magnitude of the image gradient field; Using the normalized weighting function as the coefficient of the reaction term, the normalized gradient vector flow diffusion equation is solved iteratively to obtain the steady-state vector field as the external force field.

4. The fringe center extraction method of GVF and semi-implicit variational geometry according to claim 1, characterized in that, Constructing the stiffness matrix of the curve and pre-calculating and iteratively solving the stiffness matrix specifically includes: The five-diagonal stiffness matrix of the curve is constructed based on the preset elastic and stiffness parameters; An iterative solution matrix is ​​constructed based on the five diagonal stiffness matrices and the preset time step. The iterative solution matrix is ​​subjected to sparse matrix decomposition, and the decomposition results are pre-stored.

5. The fringe center extraction method of GVF and semi-implicit variational geometry according to claim 1, characterized in that, In each iteration, the curve position is updated based on the external force field, specifically including: Based on the current curve position, the external force at each point is obtained by interpolation in the external force field; Based on the current curve position and the external force, construct the right-hand side terms of the linear equation system; The linear equations are solved using the iterative solution matrix to obtain the updated curve position.

6. The fringe center extraction method of GVF and semi-implicit variational geometry according to claim 5, characterized in that, The method further includes: Extract the coordinate vectors of each discrete point on the current curve, as well as the curve coordinate vector corresponding to the previous iteration. The internal elastic force generated by the elastic deformation of the curve and the internal rigid force generated by the bending deformation of the curve in the coordinate vector are calculated using an implicit discrete scheme with the unknown curve position at the current moment as the variable, so as to obtain the implicit solution of the internal force. The external driving force provided by the external force field at the current curve position is calculated using an explicit discrete scheme with the known curve position at the previous moment as the variable, to obtain an explicit solution for the external force.

7. The fringe center extraction method of GVF and semi-implicit variational geometry according to claim 4, characterized in that, After constructing the pentagonal stiffness matrix of the curve based on preset elastic and stiffness parameters, the method further includes: The row vectors corresponding to the discrete points at the beginning of the curve in the five-diagonal stiffness matrix are modified so that the bending moment at the beginning of the curve is zero. The row vectors corresponding to the discrete points at the end of the curve in the five-diagonal stiffness matrix are modified so that the bending moment at the end of the curve is zero. The column vectors corresponding to the discrete points at the beginning of the curve in the five-diagonal stiffness matrix are modified to make the shear force at the beginning of the curve zero. The column vectors corresponding to the discrete points at the end of the curve in the five-diagonal stiffness matrix are modified to make the shear force at the end of the curve zero.

8. The fringe center extraction method of GVF and semi-implicit variational geometry according to claim 3, characterized in that, The construction of the normalized weight function based on the gradient magnitude of the image gradient field specifically includes: Calculate the squared value of the gradient magnitude of each pixel in the image gradient field to obtain the gradient magnitude square matrix; Traverse the gradient magnitude square matrix to determine the maximum value; The normalized weight matrix is ​​obtained by dividing the square of each gradient magnitude in the gradient magnitude square matrix by the algebraic sum of the maximum value and a preset infinitesimal value.

9. A fringe center extraction device based on GVF and semi-implicit variational methods, characterized in that, The device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Perform the steps of the fringe center extraction method of GVF and semi-implicit variation as described in any one of claims 1-8.

10. A non-volatile computer storage medium for fringe center extraction using GVF and semi-implicit variational methods, storing computer-executable instructions, characterized in that... The computer-executable instructions are set as follows: Perform the steps of the fringe center extraction method of GVF and semi-implicit variation as described in any one of claims 1-8.