Precise micro-displacement photoelectric measurement system and method thereof
By introducing a technical chain of curvature flow profile extraction, geodesic constraints, and Riemann optimization based on differential geometry theory, the problem of insufficient photoelectric measurement accuracy in the processing of non-ideal light spots in existing technologies has been solved, realizing sub-pixel precision photoelectric measurement of micro-displacements and achieving high-precision micro-displacement measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING UNION UNIVERSITY
- Filing Date
- 2025-12-02
- Publication Date
- 2026-05-29
AI Technical Summary
Traditional photoelectric measurement methods suffer from a significant drop in accuracy when dealing with non-ideal light spots, making it difficult to overcome the limitations of pixel resolution and achieve sub-pixel level precision in the measurement of minute displacements.
By employing differential geometry theory, a technical chain is constructed for curvature flow profile extraction, geodesic constraint positioning, and Riemann optimization. Through curvature flow evolution, geodesic distance field identification of candidate circle centers, and Riemann optimization, sub-pixel accuracy displacement measurement is achieved.
The displacement measurement accuracy has been improved to 0.01 pixels, enhancing the system's stability and adaptability in complex environments, significantly improving the ability to handle non-ideal light spots, and enhancing the system's robustness.
Smart Images

Figure CN121363920B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photoelectric measurement technology, and in particular to a precision micro-displacement photoelectric measurement system and method. The system utilizes the principles of differential geometry to perform sub-pixel precision processing on light spot images, thereby achieving high-precision displacement measurement at the micrometer level. Background Technology
[0002] Precision micro-displacement measurement has wide applications in micro-nano manufacturing, precision machining, optical component calibration, and materials science research. Traditional photoelectric measurement methods mainly include gray-scale centroid-based methods, edge interpolation methods, and template matching methods. These methods can achieve measurement accuracy of 0.1 to 0.05 pixels when processing ideal light spots.
[0003] However, in practical applications, due to factors such as uneven illumination, environmental noise, specular reflection, and material surface characteristics, the shape of the light spot often exhibits an irregular form, leading to a significant decrease in accuracy of traditional methods when processing non-ideal light spots. For example, the gray-scale centroid method is prone to systematic deviations under uneven illumination conditions; the edge interpolation method is sensitive to noise and easily produces positioning errors at image edges; and the template matching method is limited by preset templates and has poor adaptability to deformed light spots.
[0004] Furthermore, most existing technologies are based on discrete pixel processing, which makes it difficult to overcome the limitations of pixel resolution, thus creating a bottleneck in the field of high-precision micro-displacement measurement. Therefore, there is an urgent need to develop a new displacement measurement system that can adapt to complex environments, handle non-ideal light spots, and achieve sub-pixel level accuracy. Summary of the Invention
[0005] The purpose of this invention is to provide a precision micro-displacement photoelectric measurement system and method. This system introduces differential geometry theory to construct a complete technical chain from curvature flow profile extraction, geodesic constraint positioning to Riemann optimization, thereby achieving high-precision displacement measurement of non-ideal light spots in complex environments.
[0006] This invention proposes a precision micro-displacement photoelectric measurement system, comprising:
[0007] The curvature flow contour extraction module is used to process the spot image, represent the target contour in the spot image as a parameterized curve, calculate the curvature value of each point on the parameterized curve, perform curvature flow evolution based on the curvature value, and generate optimized contour description data.
[0008] The geodesic constraint positioning module is communicatively connected to the curvature flow contour extraction module. It is used to receive the optimized contour description data, construct a geodesic distance field based on the optimized contour description data, identify local maxima points in the geodesic distance field as candidate circle centers, evaluate the shape matching degree of each candidate circle center, and determine the best candidate circle center.
[0009] The Riemann optimization module, communicatively connected to the geodesic-constrained positioning module, receives the optimal candidate circle center, transforms the sub-pixel positioning problem into an optimization problem on a Riemannian manifold, performs gradient descent based on Riemannian metric in the parameter space, and determines the target coordinates with sub-pixel accuracy; and
[0010] The displacement calculation module is communicatively connected to the Riemann optimization module. It is used to receive the target coordinates with subpixel precision, calculate the displacement changes between adjacent image frames, and output the minute displacement measurement results.
[0011] Preferably, the curvature flow contour extraction module includes:
[0012] A contour parameterization unit is used to extract an initial contour point set from the spot image and represent the initial contour point set as a parametric curve by equidistant sampling.
[0013] The curvature calculation unit is communicatively connected to the contour parameterization unit and is used to calculate the curvature value of each point of the parametric curve using local polynomial fitting to generate a curvature distribution map.
[0014] A curvature flow evolution unit, communicatively connected to the curvature calculation unit, is used to set the evolution step size, move contour points according to the curvature flow direction, perform adaptive step size control, and update the parameter curve; and
[0015] The feature point extraction unit is communicatively connected to the curvature flow evolution unit and is used to identify curvature extrema and zero-crossing points from the updated parameter curve as key feature points to generate an optimized contour containing the key feature points.
[0016] Preferably, the adaptive step size control of the curvature flow evolution unit includes:
[0017] In the high curvature region, the evolution step size is reduced to 0.6 times the original step size;
[0018] In the low curvature region, the evolution step size is increased to 1.2 times the original step size; and
[0019] The evolution step size is limited to the range of 0.01 to 0.1.
[0020] Preferably, the geodesic constraint positioning module includes:
[0021] The distance field construction unit is used to construct a computational domain with the optimized contour description data as the boundary, and to construct a geodesic distance field within the computational domain by applying the fast traversal method.
[0022] A candidate center identification unit, communicatively connected to the distance field construction unit, is used to find local maxima in the geodesic distance field as candidate centers, merge candidate centers that are too close, and generate a set of candidate centers; and
[0023] The circle center evaluation unit is communicatively connected to the candidate circle center identification unit. It is used to evaluate the degree of matching between each candidate circle center in the candidate circle center set and the contour. Based on the uniformity of intersection angle distribution, the number of intersection points and the stability of radius, a comprehensive score is calculated, and the candidate circle center with the highest score is selected as the best candidate circle center.
[0024] Preferably, the center evaluation unit further includes a subpixel optimization unit, which performs a fine search in a 3×3 pixel area around the best candidate center with a step size of 0.1 pixels, and further optimizes the center position through quadratic interpolation.
[0025] Preferably, the Riemann optimization module includes:
[0026] The parameter space construction unit is used to define a parameter vector containing the center coordinates, radius, and deformation parameters, construct an objective function representing the fitting error, and define an appropriate Riemannian metric tensor in the parameter space.
[0027] The optimization search unit, communicatively connected to the parameter space construction unit, is used to set the initial step size and iteration termination condition, calculate the gradient of the objective function on the Riemannian manifold, determine the search direction, perform line search, and iteratively update the parameter vector; and
[0028] The result evaluation unit is communicatively connected to the optimization search unit. It is used to extract target coordinates with sub-pixel accuracy from the optimized parameter vector, calculate the fitting residual and parameter sensitivity, and perform a reliability rating on the results.
[0029] Preferably, the optimization search unit uses the preconditional conjugate gradient method to perform gradient descent on the Riemannian manifold. The optimization search unit also includes a multi-starting-point strategy unit for performing optimization from different initial points and selecting the global optimal solution.
[0030] As a preferred option, it also includes:
[0031] Image acquisition module, used to acquire raw images containing light spots;
[0032] An image preprocessing module, communicatively connected to the image acquisition module, is used to perform grayscale conversion, contrast enhancement, and median filtering on the original image; and
[0033] The threshold segmentation module is communicatively connected to the image preprocessing module. It is used to perform threshold segmentation on the preprocessed image, generate a binary image, extract the light spot contour in the binary image, and transmit the light spot contour to the curvature flow contour extraction module.
[0034] Preferably, the displacement calculation module further includes:
[0035] A coordinate transformation unit is used to convert the sub-pixel precision target coordinates from the pixel coordinate system to the physical coordinate system;
[0036] A displacement vector calculation unit, communicatively connected to the coordinate transformation unit, is used to calculate the difference in target coordinates between adjacent image frames to obtain the displacement vector; and
[0037] The result visualization unit is communicatively connected to the displacement vector calculation unit and is used to draw the displacement trajectory and display the real-time displacement value and the cumulative displacement value.
[0038] A precise photoelectric measurement method for minute displacements includes the following steps:
[0039] Acquire raw images containing light spots;
[0040] The original image is preprocessed to obtain a grayscale image;
[0041] The grayscale image is segmented using a threshold to obtain a binary image;
[0042] Extract the light spot contour from the binary image;
[0043] The light spot contour is optimized using curvature flow evolution, including: representing the light spot contour as a parameterized curve, calculating the curvature value of each point on the parameterized curve, performing curvature flow evolution with an adaptive step size based on the curvature value, and generating optimized contour description data;
[0044] Constructing a geodesic distance field based on the optimized contour description data includes: constructing a computational domain with the optimized contour description data as the boundary, and applying the fast traversal method to construct the geodesic distance field within the computational domain;
[0045] Local maxima in the geodesic distance field are identified as candidate circle centers. The shape matching degree of each candidate circle center is evaluated, and the optimal candidate circle center is determined.
[0046] The subpixel localization problem is transformed into an optimization problem on a Riemannian manifold. Gradient descent based on Riemannian metric is performed in the parameter space to determine the target coordinates with subpixel accuracy.
[0047] Calculate the displacement change of the target coordinates between adjacent image frames and output the small displacement measurement results.
[0048] The beneficial effects of this invention include:
[0049] 1. Improve measurement accuracy: By using sub-pixel processing technology under the framework of differential geometry, the displacement measurement accuracy is improved to 0.01 pixels, which is 5-10 times higher than traditional methods.
[0050] 2. Enhanced environmental adaptability: Curvature flow-based contour extraction naturally has the ability to smooth noise while preserving key features, enabling the system to maintain stable performance under complex lighting conditions and noise interference.
[0051] 3. Improved ability to handle non-ideal light spots: Geodesic constraints and Riemann optimization techniques enable the system to effectively handle light spots of various shapes, not limited to Gaussian distribution or perfect circles, greatly improving the applicability of the system.
[0052] 4. Improved system robustness: The multi-module collaborative architecture design, combined with an adaptive parameter adjustment mechanism, makes the performance degradation of the system in complex environments significantly less than that of traditional methods. Under the condition of a 20% reduction in signal-to-noise ratio, the accuracy drops by only about 15%, while the accuracy of traditional methods drops by about 50%. Attached Figure Description
[0053] Figure 1 This is a structural block diagram of a precision micro-displacement photoelectric measurement system provided in an embodiment of the present invention.
[0054] Figure 2 This is a structural block diagram of the curvature flow contour extraction module provided in an embodiment of the present invention.
[0055] Figure 3 This is a structural block diagram of the geodesic constraint positioning module provided in an embodiment of the present invention.
[0056] Figure 4 This is a structural block diagram of the Riemann optimization module provided in an embodiment of the present invention.
[0057] Figure 5 This is a structural block diagram of the displacement calculation module provided in an embodiment of the present invention.
[0058] Figure 6 A flowchart of a precision micro-displacement photoelectric measurement method provided in an embodiment of the present invention. Detailed Implementation
[0059] Please refer to Figures 1-6 The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are for illustrative and explanatory purposes only and are not intended to limit the scope of the invention.
[0060] Reference Figure 1The precision micro-displacement photoelectric measurement system provided in this embodiment of the invention includes: a curvature flow profile extraction module 1, a geodesic constraint positioning module 2, a Riemann optimization module 3, and a displacement calculation module 4. Preferably, the system may further include an image acquisition module 5, an image preprocessing module 6, and a threshold segmentation module 7.
[0061] The image acquisition module 5 is used to acquire the original image containing the light spot. In one embodiment of the present invention, the image acquisition module 5 may be a high-resolution CCD camera or a CMOS camera, preferably with a resolution of 1280×1024 or higher and a frame rate of 30fps or higher.
[0062] Image preprocessing module 6 is communicatively connected to image acquisition module 5 and is used to perform grayscale conversion, contrast enhancement, and median filtering on the original image. Preferably, contrast enhancement uses histogram equalization, and median filtering uses a 3×3 or 5×5 filtering window, the size of which can be adaptively adjusted according to the noise level.
[0063] The threshold segmentation module 7 is communicatively connected to the image preprocessing module 6. It performs threshold segmentation on the preprocessed image to generate a binary image, extracts the light spot contour from the binary image, and transmits the light spot contour to the curvature flow contour extraction module 1. In a preferred embodiment of the invention, the threshold segmentation employs the OTSU adaptive thresholding algorithm to achieve robust segmentation under different lighting conditions.
[0064] The curvature flow contour extraction module 1 is used to process the spot image, represent the target contour in the spot image as a parameterized curve, calculate the curvature value of each point on the parameterized curve, perform curvature flow evolution based on the curvature value, and generate optimized contour description data.
[0065] The geodesic constraint positioning module 2 is communicatively connected to the curvature flow contour extraction module 1. It is used to receive optimized contour description data, construct a geodesic distance field based on the optimized contour description data, identify local maxima points in the geodesic distance field as candidate circle centers, evaluate the shape matching degree of each candidate circle center, and determine the best candidate circle center.
[0066] The Riemann optimization module 3 is communicatively connected to the geodesic constraint positioning module 2. It is used to receive the best candidate circle center, transform the sub-pixel positioning problem into an optimization problem on the Riemann manifold, perform gradient descent based on Riemann metric in the parameter space, and determine the target coordinates with sub-pixel accuracy.
[0067] The displacement calculation module 4 is communicatively connected to the Riemann optimization module 3. It is used to receive target coordinates with subpixel precision, calculate displacement changes between adjacent image frames, and output minute displacement measurement results.
[0068] The implementation of each module of the present invention will be described in detail below with reference to specific embodiments.
[0069] Reference Figure 2 In this embodiment of the invention, the curvature flow contour extraction module 1 includes: a contour parameterization unit 11, a curvature calculation unit 12, a curvature flow evolution unit 13, and a feature point extraction unit 14.
[0070] The contour parameterization unit 11 is used to extract an initial contour point set from the spot image, and represents the initial contour point set as a parametric curve using equidistant sampling. Specifically, the contour parameterization unit 11 first receives the spot contour from the binary image from the threshold segmentation module 7, and then extracts sampling points along the contour edge at equal arc length intervals, representing the contour as a parametric curve C(s), where s is the arc length parameter. Preferably, the initial sampling density is one sample point every 2-3 pixels. For a spot with a radius of approximately 50 pixels, 200-500 points are typically sampled to balance computational accuracy and efficiency.
[0071] The curvature calculation unit 12 is communicatively connected to the contour parameterization unit 11 and is used to calculate the curvature values of each point on the parametric curve using local polynomial fitting, generating a curvature distribution map. In one embodiment of the present invention, the curvature calculation employs a local third-order polynomial fitting method. For each point on the parametric curve, 5-7 adjacent points are selected for fitting, and then the curvature of that point is calculated according to the curvature formula in differential geometry. :
[0072] ,
[0073] in: Let be the curvature value of the parametric curve at the arc length parameter s; and These are the parameter curves. Coordinate components in the x and y directions; and These are their first derivatives with respect to the arc length parameter s; and These are the second derivatives.
[0074] The curvature flow evolution unit 13 is communicatively connected to the curvature calculation unit 12. It is used to set the evolution step size, move the contour points according to the curvature flow direction, perform adaptive step size control, and update the parameter curve. Curvature flow evolution is based on the curvature flow theory in differential geometry. Its core idea is to make the curve move along its normal direction at a speed proportional to the curvature, thereby smoothing noise while preserving key features.
[0075] Specifically, the mathematical expression for the evolution of curvature flow is:
[0076] ,
[0077] in: Represents curve Over time The rate of change; For curvature; Let be the unit normal vector of the curve at that point. In practical implementation, the curvature flow evolution unit 13 approximates the continuous evolution process using a discrete iterative approach. For each point on the parametric curve... Its update formula is:
[0078] ,
[0079] ,
[0080] in: and The coordinates of the point in the current iteration; and Update the coordinates of the midpoint in the next iteration; The evolution step size controls the update magnitude; This is the curvature value at that point; It is the unit normal vector component at that point, pointing either inside or outside the curve.
[0081] To adapt to the characteristics of different curvature regions, curvature flow evolution unit 13 implements an adaptive step size control strategy:
[0082] In the high curvature region (i.e.) The evolution step size is reduced to 0.6 times the original step size to prevent excessive evolution from causing curve distortion.
[0083] In the low curvature region (i.e.) The evolution step size is increased to 1.2 times the original step size to accelerate convergence;
[0084] At the same time, the evolution step size is limited to the range of 0.01 to 0.1 to ensure the stability of the evolution process.
[0085] The selection of 0.2 and 0.05 as the thresholds for high and low curvature is based on extensive experimental results, and these values achieve a good balance when processing typical spot images. Furthermore, after every 5 iterations, the curvature flow evolution unit 13 resamples the curve at equal intervals to maintain a uniform distribution of sampling points.
[0086] The iteration termination condition is set to a shape change rate of less than 0.001 pixels or reaching the maximum number of iterations (usually 100). The shape change rate is defined as the root mean square value of the displacement of all points between two adjacent iterations.
[0087] The feature point extraction unit 14 is communicatively connected to the curvature flow evolution unit 13. It is used to identify curvature extrema and zero-crossing points from the updated parametric curve as key feature points, generating an optimized contour containing these key feature points. The rules for identifying key feature points are as follows:
[0088] Curvature maxima: correspond to the convex angle features of the contour;
[0089] Minimum curvature point: corresponds to the concave angle feature of the contour;
[0090] Zero-curvature intersection: the inflection point feature corresponding to the contour;
[0091] To avoid excessive feature points affecting subsequent processing, the feature point extraction unit 14 also implements a feature point priority sorting and density control mechanism, prioritizing the retention of points with larger absolute curvature values and ensuring that the distance between adjacent feature points is not less than 5 sampling points.
[0092] Finally, the feature point extraction unit 14 outputs optimized contour description data, including contour point set, curvature distribution and key feature point information, providing a basis for subsequent geodesic constraint positioning.
[0093] Reference Figure 3 In this embodiment of the invention, the geodesic constraint positioning module 2 includes: a distance field construction unit 21, a candidate center identification unit 22, and a center evaluation unit 23.
[0094] The distance field construction unit 21 is used to construct a computational domain with the optimized contour description data as the boundary, and to construct a geodesic distance field within the computational domain using the fast traversal method. The geodesic distance field is a two-dimensional scalar field representing the shortest path length from each point in the computational domain to the contour boundary. It takes into account the geometric constraints of the contour and reflects the true structure of the light spot better than Euclidean distance.
[0095] In an embodiment of the present invention, the distance field construction unit 21 first defines the computational domain with the optimized contour as the boundary, then constructs a uniform mesh (typically with a mesh step size of 0.5 pixels), and initializes the distance field:
[0096] Set the distance value at the contour point to 0;
[0097] The distance values of interior points are initialized to positive infinity.
[0098] The distance value of external points is set to a negative value (not included in the calculation).
[0099] Subsequently, the distance field building unit 21 solves the Eikonal equations using the FastMarching Method:
[0100] ,
[0101] in: Point The geodetic distance at that location; The gradient of the range field is a two-dimensional vector. ; The Euclidean norm representing the gradient is... .
[0102] The fast-moving method is an efficient numerical approach for solving the Eikonal equations. Its core idea is to start from the contour points and gradually move inwards, calculating the distance to each point. The algorithm's time complexity is O(n log n). , where n is the number of grid points, which has higher accuracy and efficiency compared to traditional distance transformation algorithms.
[0103] The candidate circle center identification unit 22 is communicatively connected to the distance field construction unit 21. It is used to find local maxima points in the geodesic distance field as candidate circle centers, and merge candidate circle centers that are too close to each other to generate a set of candidate circle centers. Local maxima points are grid points whose distance values are greater than all other points in their 3×3 neighborhood. These points usually correspond to the "center" position of the contour.
[0104] To improve the quality of candidate circle centers, the candidate circle center identification unit 22 implements the following filtering and merging strategies:
[0105] Threshold filtering: Only candidate points with a distance value greater than 5% of the contour perimeter are retained. This threshold ensures that the candidate circle centers have sufficient "centrality".
[0106] Candidate point merging: For candidate point pairs with a distance of less than 3 pixels, retain the one with the largest distance value, which helps reduce redundant calculations;
[0107] Candidate set optimization: Finally, the top 80% of candidate points by distance value are retained, with a maximum of 5, to balance computational complexity and result quality.
[0108] The circle center evaluation unit 23 is communicatively connected to the candidate circle center identification unit 22. It is used to evaluate the degree of matching between each candidate circle center in the candidate circle center set and the contour. Based on the uniformity of intersection angle distribution, the number of intersection points and the stability of radius, a comprehensive score is calculated, and the candidate circle center with the highest score is selected as the best candidate circle center.
[0109] Specifically, for each candidate center Given the corresponding geodesic distance d, the circle center evaluation unit 23 constructs a circle with that point as the center and d as the radius, then calculates the set of intersection points between the circle and the contour, and evaluates the following three aspects:
[0110] Uniformity of intersection angle distribution: Calculate the variance of the polar angle distribution of the intersection points. The smaller the variance, the more uniform the distribution.
[0111] Number of intersections: The more intersections there are, the better the fit between the circle and the outline.
[0112] Radius stability: Calculate the variance of the distance from the intersection point to the center of the circle. The smaller the variance, the more stable the circle fit.
[0113] The formula for calculating the overall score is:
[0114] ,
[0115] Where: Score is the overall score, ranging from 0 to 1, with a higher value indicating a higher degree of matching; The standard deviation of the angle distribution at the intersection points, in radians; The number of intersections; This represents the expected minimum number of intersections (usually set to 8). This represents the standard deviation of the distance from the intersection point to the center of the circle, with the same unit as the radius. Where is the radius of the circle. The weighting (0.5, 0.3, 0.2) was determined based on a large number of experiments and reflects the degree of influence of each factor on the final positioning accuracy.
[0116] The center evaluation unit 23 also includes a sub-pixel optimization unit, which performs a fine search within a 3×3 pixel area around the best candidate center with a step size of 0.1 pixels, and further optimizes the center position through quadratic interpolation. This step can improve the accuracy of the initial positioning from the pixel level to the 0.1 pixel level, providing a good initial value for subsequent Riemann optimization.
[0117] In practice, the sub-pixel optimization unit generates 31×31=961 grid points within a 3×3 pixel region (i.e., the range around the center of the best candidate circle ±1.5 pixels) with a step size of 0.1 pixels. The scoring calculation is repeated for each point. Then, the 9 points with the highest scores are selected and fitted using a quadratic surface.
[0118] ,
[0119] in: Let (x, y) be the score value at point (x, y). , , , , and The fitting coefficients are determined using the least squares method. By solving for the extreme points of the quadratic surface, the optimized center position with sub-pixel accuracy is obtained, achieving an accuracy of 0.1 pixels.
[0120] Reference Figure 4 In this embodiment of the invention, the Riemann optimization module 3 includes: a parameter space construction unit 31, an optimization search unit 32, and a result evaluation unit 33.
[0121] The parameter space construction unit 31 is used to define a parameter vector containing the center coordinates, radius, and deformation parameters, construct an objective function representing the fitting error, and define an appropriate Riemannian metric tensor in the parameter space. This step transforms the sub-pixel localization problem into an optimization problem on a Riemannian manifold, which is one of the core innovations of this invention.
[0122] Specifically, parameter space construction unit 31 defines parameter vectors. ,in:
[0123] and Related to the coordinates of the center of the circle: , ;
[0124] Related to radius: ;
[0125] and Parameters describing non-circular deformation;
[0126] This parameterization method originates from algebraic geometry and can represent circles and their deformed shapes, making it suitable for handling non-ideal light spots in practical applications.
[0127] The objective function is defined as the energy functional of the fitting error:
[0128] ,
[0129] in: Let be the objective function, and represent the energy value of the fitting error; parameter vector ; The number of points on the outline; For the outline of the first The coordinates of the points; The coordinates of the center of the circle are given by the parameters. , and Calculated; For the radius, also determined by the parameter , and Calculated; This is the regularization coefficient (usually set to 0.001), used to prevent overfitting; This is a regularization term that controls the degree of non-circular deformation.
[0130] In the parameter space, parameter space building unit 31 defines an appropriate Riemannian metric tensor. The Riemann metric tensor is used to measure the impact of parameter changes on the objective function. It can be represented as an approximation of the Hessian matrix of the objective function.
[0131] ,
[0132] in: The Riemannian metric tensor is a A symmetric positive definite matrix; Let be the Jacobian matrix of the objective function with respect to the parameters, and its size is . , No. OK Column elements are ,in For the first Fitting error at each point; for The transpose of the matrix; It is a small positive number (usually 0.01) used to ensure the positive definiteness of the matrix; for The identity matrix. Add This term ensures the positive definiteness of the Riemann metric tensor, improving the stability of the optimization process.
[0133] The optimization search unit 32 is communicatively connected to the parameter space construction unit 31. It is used to set the initial step size and iteration termination condition, calculate the gradient of the objective function on the Riemannian manifold, determine the search direction, perform line search, and iteratively update the parameter vector. This process realizes gradient descent on the parameter manifold, a crucial step in achieving sub-pixel accuracy localization.
[0134] On Riemannian manifolds, gradient calculation requires considering the influence of the metric tensor. Objective function In parameters The Riemann gradient at point is defined as:
[0135] ,
[0136] in: For the objective function in parameters The Riemann gradient at point is a 5-dimensional vector. Let be the inverse matrix of the Riemannian metric tensor; Let J be the Euclidean gradient of the objective function, which is also a 5-dimensional vector, and let the j-th element be J. .
[0137] The optimization search unit 32 employs the preconditional conjugate gradient method to perform gradient descent on the Riemannian manifold. The specific steps are as follows:
[0138] 1. Initialization: Set initial parameters Initial step size Initial search direction ;
[0139] Iterative update: For the first iteration
[0140] Execute line search to determine step size ,
[0141] Update parameters: ,
[0142] Calculate the new Riemann gradient: ,
[0143] Calculate the conjugate factor: ,
[0144] Update search direction: .
[0145] 3. Iteration termination condition: The change in parameters is less than... or gradient norm less than Or reach the maximum number of iterations (usually 200 times).
[0146] in: For the first The parameter vector for the next iteration; For the first The step size of the next iteration; For the first The search direction for the next iteration; For the first The Riemann gradient of the next iteration; This is a conjugate factor used to combine the search direction from the previous iteration; The square norm of the new gradient is represented; This represents the square norm of the old gradient.
[0147] The line search employs a step size selection strategy that satisfies the Wolfe condition, ensuring sufficient descent of the objective function and reasonable changes in the gradient direction. In the actual implementation, the least cubic interpolation method is used to find the optimal step size that satisfies the condition.
[0148] The optimization search unit 32 also includes a multi-starting-point strategy unit, used to perform optimization from different initial points and select the global optimum. Specifically, the multi-starting-point strategy unit starts from the best candidate circle center obtained by geodesic constraint localization, sets three different initial points (e.g., adding a perturbation of ±0.5 pixels to the origin), performs optimization at each point, and then selects the result with the smallest objective function value as the final solution. This strategy helps avoid local optima and increases the probability of obtaining the global optimum.
[0149] The result evaluation unit 33 is communicatively connected to the optimization search unit 32. It is used to extract sub-pixel precision target coordinates from the optimized parameter vector, calculate the fitting residuals and parameter sensitivity, and perform a reliability rating on the results. This step ensures that the system output results have reliable quality assurance.
[0150] Specifically, the result evaluation unit 33 first extracts the target coordinates with sub-pixel precision from the optimized parameter vector p*. and radius Then calculate the following evaluation indicators:
[0151] Fitting residuals: Calculate the root mean square error (RMSE) of the distance from the contour points to the fitted circle.
[0152] Parameter sensitivity: The condition number of the Hessian matrix of the objective function is calculated, reflecting the degree to which parameter changes affect the results.
[0153] Cross-validation: Contour points are randomly divided into training and validation sets to test the model's generalization ability.
[0154] Based on these indicators, the results evaluation unit 33 performs a reliability rating on the results:
[0155] High reliability: RMSE < 0.05 pixels, condition number < 100;
[0156] Medium reliability: RMSE < 0.1 pixels, condition number < 500;
[0157] Low reliability: Other cases.
[0158] In addition, the result evaluation unit 33 also calculates the 95% confidence interval of the coordinate error, providing uncertainty assessment for subsequent displacement calculations.
[0159] Reference Figure 5 In this embodiment of the invention, the displacement calculation module 4 includes: a coordinate transformation unit 41, a displacement vector calculation unit 42, and a result visualization unit 43.
[0160] The coordinate transformation unit 41 is used to convert the target coordinates with sub-pixel precision from the pixel coordinate system to the physical coordinate system. In practical applications, there is a non-linear mapping relationship between pixel coordinates and physical coordinates, and accurate transformation parameters need to be obtained through calibration.
[0161] In one embodiment of the present invention, the coordinate transformation adopts the following second-order polynomial model:
[0162] ,
[0163] ,
[0164] Where: X and Y are physical coordinates (usually in micrometers); x and y are pixel coordinates; to and to The conversion coefficients obtained through calibration are determined through the calibration process.
[0165] The calibration process typically uses a high-precision calibration board to obtain the corresponding pixel coordinates at known physical locations, and then solves for the transformation coefficients using the least squares method. For applications requiring higher accuracy, higher-order polynomial models or piecewise linear interpolation methods can also be used.
[0166] The displacement vector calculation unit 42 is communicatively connected to the coordinate transformation unit 41 and is used to calculate the difference in target coordinates between adjacent image frames to obtain the displacement vector. Specifically, for the first... Frame and the The formula for calculating the displacement vector ΔP in a frame image is:
[0167] ,
[0168] in: Let i be the displacement vector of the i-th frame relative to the (i-1)-th frame; , () represents the physical coordinates of the target in the i-th frame; , ) represents the physical coordinates of the target in the (i-1)th frame.
[0169] To improve the reliability of displacement calculation, the displacement vector calculation unit 42 also implements outlier detection and filtering. Outlier detection is based on the continuity of displacement magnitude and direction, and the filtering process uses a weighted average or Kalman filter algorithm to effectively suppress the influence of random errors.
[0170] The result visualization unit 43 is communicatively connected to the displacement vector calculation unit 42 and is used to draw the displacement trajectory and display the real-time displacement value and the cumulative displacement value. In one embodiment of the present invention, the result visualization unit 43 provides the following functions:
[0171] Real-time displacement display: Displays the magnitude and direction of the displacement in the current frame in numerical and bar graph form;
[0172] Displacement trajectory drawing: Draws the target motion trajectory in a two-dimensional coordinate system, supporting trajectory comparison at different time points;
[0173] Cumulative displacement statistics: Calculates and displays the cumulative displacement, average velocity, and acceleration over a specified time period;
[0174] Error analysis: Displays the uncertainty range of displacement measurement and provides a reliability assessment of the measurement results;
[0175] Preferably, the result visualization unit 43 also supports data export function, which can export displacement measurement results in CSV, Excel or MATLAB format, making it convenient for users to perform subsequent analysis and processing.
[0176] Reference Figure 6 The precision micro-displacement photoelectric measurement method provided in this embodiment of the invention includes the following steps:
[0177] Step S1: Acquire the original image containing the light spot.
[0178] Step S2: Preprocess the original image to obtain a grayscale image. Preprocessing includes operations such as grayscale conversion, contrast enhancement, and median filtering, with the aim of improving image quality and providing a good foundation for subsequent processing.
[0179] Step S3: Perform thresholding on the grayscale image to obtain a binary image. The OTSU adaptive thresholding algorithm is preferred for thresholding, as it can achieve robust segmentation results under different lighting conditions.
[0180] Step S4: Extract the contour of the light spot from the binary image. Contour extraction typically employs edge tracking algorithms to ensure that the extracted contour is closed and continuous.
[0181] Step S5: Optimize the light spot contour using curvature flow evolution. This step includes: representing the light spot contour as a parameterized curve, calculating the curvature value at each point on the parameterized curve, performing curvature flow evolution with an adaptive step size based on the curvature values, and generating optimized contour description data. Curvature flow evolution can effectively smooth noise while preserving key features, providing a high-quality contour description for subsequent accurate localization.
[0182] Step S6: Construct a geodesic distance field based on the optimized contour description data. This specifically includes: constructing a computational domain with the optimized contour description data as the boundary, and then applying the fast traversal method within the computational domain to construct the geodesic distance field. The geodesic distance field reflects the geometric characteristics of the contour better than the traditional Euclidean distance field, which helps improve the accuracy of subsequent positioning.
[0183] Step S7: Identify local maxima in the geodesic distance field as candidate center points, evaluate the shape matching degree of each candidate center point, and determine the optimal candidate center point. This step achieves preliminary localization of the spot center with an accuracy of 0.1 pixels.
[0184] Step S8: Transform the subpixel localization problem into an optimization problem on a Riemannian manifold. Perform gradient descent based on Riemannian metric in the parameter space to determine the target coordinates with subpixel accuracy. This is the core step in achieving ultra-high precision localization, which can improve the localization accuracy to the 0.01 pixel level.
[0185] Step S9: Calculate the displacement change of the target coordinates between adjacent image frames and output the minute displacement measurement results. This step includes operations such as coordinate transformation, displacement vector calculation, and result visualization, ultimately presenting the displacement measurement results in a user-friendly manner.
[0186] In a preferred embodiment of the present invention, the adaptive step size control strategy in step S5 includes: reducing the evolution step size to 0.6 times the original step size in the high curvature region (|κi|>0.2); increasing the evolution step size to 1.2 times the original step size in the low curvature region (|κi|<0.05); and limiting the evolution step size to the range of 0.01 to 0.1 to ensure the stability of the evolution process.
[0187] In step S7, the shape matching degree of the candidate circle center is evaluated based on the following three aspects: uniformity of intersection angle distribution, number of intersection points, and radius stability. The calculation of the comprehensive score takes into account a weighted combination of these three factors, where the weight of uniformity of angle distribution is 0.5, the weight of the number of intersection points is 0.3, and the weight of radius stability is 0.2.
[0188] In step S8, the Riemann optimization employs the preconditional conjugate gradient method. The iteration termination condition is that the parameter change is less than 10⁻⁶, or the gradient norm is less than 10⁻⁸, or the maximum number of iterations (usually 200) is reached. Furthermore, a multi-starting-point strategy is implemented, performing optimization from different initial points to select the global optimum and avoid the problem of local optima.
[0189] To verify the effectiveness of this invention, a series of experimental tests were conducted. The experiments used a 1280×1024 resolution CCD camera to capture images of light spots under different lighting conditions and with different shapes, comparing them with traditional grayscale centroid methods and edge interpolation methods.
[0190] Experimental results show that the precision micro-displacement photoelectric measurement system and method proposed in this invention have the following performance advantages:
[0191] 1. Measurement accuracy: Under standard test conditions (signal-to-noise ratio ≥20dB), the positioning accuracy of the method of this invention can reach 0.01 pixels, which is 10 times higher than the traditional gray-scale centroid method (0.1 pixels) and 5 times higher than the edge interpolation method (0.05 pixels).
[0192] 2. Noise resistance: When the signal-to-noise ratio is reduced to 15dB, the accuracy of the traditional method decreases by about 50%, while the accuracy of the method of this invention decreases by only about 15%, demonstrating excellent noise resistance.
[0193] 3. Adaptability to non-ideal light spots: For non-ideal light spots such as elliptical or irregular shapes, the method of this invention can still maintain stable high-precision measurement, while the performance of traditional methods drops significantly in such cases.
[0194] 4. Computational efficiency: Although the method of this invention introduces complex differential geometry concepts, through algorithm optimization, the processing time of a 640×480 image on a regular PC (3GHz CPU) is controlled within 50-80ms, which meets the real-time requirements of most industrial applications.
[0195] This invention proposes a precision micro-displacement photoelectric measurement system and method. By introducing differential geometry theory, a complete technical chain is constructed, from curvature flow profile extraction and geodesic constraint positioning to Riemann optimization, achieving high-precision displacement measurement of non-ideal light spots in complex environments. This system breaks through the accuracy limitations of traditional methods, improving sub-pixel positioning accuracy to 0.01 pixels, while also exhibiting excellent anti-interference capabilities and adaptability. It provides a high-precision displacement measurement solution for fields such as micro / nano manufacturing, precision machining, optical component calibration, and materials science research.
[0196] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the scope of protection of the present invention.
Claims
1. A precision micro-displacement photoelectric measurement system, characterized in that, include: The curvature flow contour extraction module is used to process the spot image, represent the target contour in the spot image as a parameterized curve, calculate the curvature value of each point on the parameterized curve, perform curvature flow evolution based on the curvature value, and generate optimized contour description data. The geodesic constraint positioning module is communicatively connected to the curvature flow contour extraction module. It is used to receive the optimized contour description data, construct a geodesic distance field based on the optimized contour description data, identify local maxima points in the geodesic distance field as candidate circle centers, evaluate the shape matching degree of each candidate circle center, and determine the best candidate circle center. The Riemann optimization module, which is communicatively connected to the geodesic constraint positioning module, is used to receive the best candidate circle center, transform the sub-pixel positioning problem into an optimization problem on the Riemann manifold, perform gradient descent based on Riemann metric in the parameter space, and determine the target coordinates with sub-pixel accuracy. as well as The displacement calculation module is communicatively connected to the Riemann optimization module. It is used to receive the target coordinates with subpixel precision, calculate the displacement changes between adjacent image frames, and output the minute displacement measurement results.
2. The precision micro-displacement photoelectric measurement system according to claim 1, characterized in that, The curvature flow contour extraction module includes: A contour parameterization unit is used to extract an initial contour point set from the spot image and represent the initial contour point set as a parametric curve by equidistant sampling. The curvature calculation unit is communicatively connected to the contour parameterization unit and is used to calculate the curvature value of each point of the parametric curve using local polynomial fitting to generate a curvature distribution map. A curvature flow evolution unit, communicatively connected to the curvature calculation unit, is used to set the evolution step size, move contour points according to the curvature flow direction, perform adaptive step size control, and update the parameter curve; and The feature point extraction unit is communicatively connected to the curvature flow evolution unit and is used to identify curvature extrema and zero-crossing points from the updated parameter curve as key feature points to generate an optimized contour containing the key feature points.
3. The precision micro-displacement photoelectric measurement system according to claim 2, characterized in that, The adaptive step size control of the curvature flow evolution unit includes: In the high curvature region, the evolution step size is reduced to 0.6 times the original step size; In the low curvature region, the evolution step size is increased to 1.2 times the original step size; and The evolution step size is limited to the range of 0.01 to 0.
1.
4. The precision micro-displacement photoelectric measurement system according to claim 1, characterized in that, The geodesic constraint positioning module includes: The distance field construction unit is used to construct a computational domain with the optimized contour description data as the boundary, and to construct a geodesic distance field within the computational domain by applying the fast traversal method. A candidate center identification unit, communicatively connected to the distance field construction unit, is used to find local maxima in the geodesic distance field as candidate centers, merge candidate centers that are too close, and generate a set of candidate centers; and The circle center evaluation unit is communicatively connected to the candidate circle center identification unit. It is used to evaluate the degree of matching between each candidate circle center in the candidate circle center set and the contour. Based on the uniformity of intersection angle distribution, the number of intersection points and the stability of radius, a comprehensive score is calculated, and the candidate circle center with the highest score is selected as the best candidate circle center.
5. The precision micro-displacement photoelectric measurement system according to claim 4, characterized in that, The center evaluation unit also includes a subpixel optimization unit, which is used to perform a fine search in a 3×3 pixel area around the best candidate center with a step size of 0.1 pixels, and further optimize the center position through quadratic interpolation.
6. The precision micro-displacement photoelectric measurement system according to claim 1, characterized in that, The Riemann optimization module includes: The parameter space construction unit is used to define a parameter vector containing the center coordinates, radius, and deformation parameters, construct an objective function representing the fitting error, and define an appropriate Riemannian metric tensor in the parameter space. The optimization search unit, communicatively connected to the parameter space construction unit, is used to set the initial step size and iteration termination condition, calculate the gradient of the objective function on the Riemannian manifold, determine the search direction, perform line search, and iteratively update the parameter vector; and The result evaluation unit is communicatively connected to the optimization search unit. It is used to extract target coordinates with sub-pixel accuracy from the optimized parameter vector, calculate the fitting residual and parameter sensitivity, and perform a reliability rating on the results.
7. The precision micro-displacement photoelectric measurement system according to claim 6, characterized in that, The optimization search unit employs the preconditional conjugate gradient method to perform gradient descent on the Riemannian manifold. The optimization search unit also includes a multi-starting-point strategy unit, which is used to perform optimization from different initial points and select the global optimal solution.
8. The precision micro-displacement photoelectric measurement system according to claim 1, characterized in that, Also includes: Image acquisition module, used to acquire raw images containing light spots; An image preprocessing module, which is communicatively connected to the image acquisition module, is used to perform grayscale conversion, contrast enhancement, and median filtering on the original image. as well as The threshold segmentation module is communicatively connected to the image preprocessing module. It is used to perform threshold segmentation on the preprocessed image, generate a binary image, extract the light spot contour in the binary image, and transmit the light spot contour to the curvature flow contour extraction module.
9. The precision micro-displacement photoelectric measurement system according to claim 1, characterized in that, The displacement calculation module also includes: A coordinate transformation unit is used to convert the sub-pixel precision target coordinates from the pixel coordinate system to the physical coordinate system; A displacement vector calculation unit, communicatively connected to the coordinate transformation unit, is used to calculate the difference in target coordinates between adjacent image frames to obtain the displacement vector; and The result visualization unit is communicatively connected to the displacement vector calculation unit and is used to draw the displacement trajectory and display the real-time displacement value and the cumulative displacement value.
10. A precision micro-displacement photoelectric measurement method, employing the precision micro-displacement photoelectric measurement system according to any one of claims 1-9, characterized in that, Includes the following steps: Acquire raw images containing light spots; The original image is preprocessed to obtain a grayscale image; The grayscale image is segmented using a threshold to obtain a binary image; Extract the light spot contour from the binary image; The light spot contour is optimized using curvature flow evolution, including: representing the light spot contour as a parameterized curve, calculating the curvature value of each point on the parameterized curve, performing curvature flow evolution with an adaptive step size based on the curvature value, and generating optimized contour description data; Constructing a geodesic distance field based on the optimized contour description data includes: constructing a computational domain with the optimized contour description data as the boundary, and applying the fast traversal method to construct the geodesic distance field within the computational domain; Local maxima in the geodesic distance field are identified as candidate circle centers. The shape matching degree of each candidate circle center is evaluated, and the optimal candidate circle center is determined. The subpixel localization problem is transformed into an optimization problem on a Riemannian manifold. Gradient descent based on Riemannian metric is performed in the parameter space to determine the target coordinates with subpixel accuracy. Calculate the displacement change of the target coordinates between adjacent image frames and output the small displacement measurement results.