A visual measurement method and system for a point to line perpendicular intersection point

By combining multi-scale phase-consistent edge perception and target point-guided line hypothesis screening with weighted fitting and geometric constraint optimization, the environmental robustness and accuracy issues in point-to-line perpendicular intersection measurement are solved, achieving efficient and interpretable high-precision measurement, which is suitable for flexible manufacturing scenarios with multiple varieties.

CN122636596APending Publication Date: 2026-08-25HANGZHOU HUICUI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610991897.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient environmental sensitivity, poor robustness, limited accuracy, high computational complexity, weak interpretability, and strong dependence on big data in measuring point-to-line distances and their perpendicular intersections. They are difficult to achieve high-precision measurements in complex backgrounds, low contrast, and partial occlusion conditions.

Method used

The algorithm employs multi-scale phase-consistent edge perception, target-point-guided line hypothesis screening, and weighted fitting combined with geometric constraint optimization. It extracts primary edge features through a multi-scale pyramid structure, filters candidate lines using target point location information, and performs sub-pixel-level edge extraction and weighted fitting within the focal region. Finally, it obtains accurate vertical intersection points through joint optimization.

Benefits of technology

It improves robustness and accuracy in complex environments, reduces reliance on big data annotation, ensures geometric consistency and interpretability of measurements, and achieves efficient real-time processing, making it suitable for flexible manufacturing scenarios with multiple product varieties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122636596A_ABST
    Figure CN122636596A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of visual measurement, and discloses a visual measurement method and system for a point to a vertical intersection point of a straight line. A two-dimensional image of a scene to be measured is collected and subjected to multi-scale analysis, edge detection is performed based on phase consistency, and primary edge features with direction information are extracted. Then, clustering is performed based on the edge features, and target point positions are combined to perform straight line hypothesis scoring and screening to determine candidate target straight lines. Next, sub-pixel level edge extraction is performed in a focusing area, and weighted straight line fitting is performed to obtain initial parameter estimation of the target straight line. Finally, the target point positions and the target straight line parameters are jointly optimized in combination with geometric constraint conditions to accurately calculate the vertical intersection point coordinates and the vertical distance of the target point to the target straight line. The application can effectively improve the measurement accuracy, can stably work in a complex scene, and is suitable for use in precision measurement and an automated visual system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual measurement technology, specifically to a visual measurement method and system for a point-to-the-perpendicular intersection of a line. Background Technology

[0002] In numerous fields such as industrial automation inspection, precision engineering measurement, robot navigation, and computer vision, measuring the distance from a point to a straight line and its perpendicular intersection is a fundamental and crucial task. The core objective of this task is: given a set of points defined by image or point cloud data, firstly, to identify and extract specific straight line features (target lines); then, for another given specific point (target point), to calculate the perpendicular distance from that point to the target line and determine the spatial coordinates of the foot of the perpendicular (i.e., the perpendicular intersection). This technology has wide applications in areas such as dimensional and geometric tolerance inspection of mechanical parts (e.g., the distance from the center of a hole to its edge), path tracking of AGVs based on visual markers, alignment inspection of building structures, and table line extraction and character positioning in document image processing.

[0003] Traditional implementation schemes can be mainly divided into two categories: methods based on traditional image processing and geometric calculation, and methods based on deep learning.

[0004] (1) Traditional image processing and geometric calculation methods This type of method is currently the most mature and widely used technical approach in industry. Its core process typically follows the paradigm of "image acquisition -> preprocessing -> edge detection -> line fitting -> geometric calculation".

[0005] First, a two-dimensional image of the scene under test is acquired using an industrial camera. Image preprocessing is then performed, including grayscale conversion, filtering (such as Gaussian filtering to reduce noise), and contrast enhancement, all aimed at improving image quality. Next comes the crucial feature extraction step, typically employing edge detection algorithms such as Canny, Sobel, or LoG operators to identify obvious intensity change boundaries in the scene and generate a binarized edge map. In the edge map, a target straight line may appear as a series of continuous edge pixels.

[0006] To obtain accurate line parameters from discrete edge pixels (typically using a slope-intercept method) Or a more robust normal type This requires a linear fitting algorithm. The most commonly used is the Hough Transform. The standard Hough Transform maps points in image space... Mapping to parameter space For each edge point, in its possible straight-line direction ( From 0 to ) calculate the corresponding The values ​​are calculated and voted on in the accumulator. The point with the largest accumulated value in the parameter space corresponds to the most likely straight line in the image space. By setting a threshold, multiple straight lines can be detected.

[0007] To improve accuracy and noise resistance, edge points that are suspected to belong to the same straight line are often clustered first (e.g., based on pixel connectivity or distance constraints), and then the least squares method is used to fit a straight line to these point sets. Let the straight line model be... For point sets By minimizing the sum of squared errors To solve for the parameters and Find the error function with respect to... and Taking the partial derivatives and setting them to zero, we obtain the normal equations: .

[0008] Solving this system of equations yields: .

[0009] For near-vertical lines, the slope-intercept method can produce huge values. In this case, the normal method or orthogonal regression (Total Least Squares) is more stable.

[0010] To obtain the precise parameters of the target line (e.g., normal parameters) and and target point pixel coordinates Then, geometric calculations can be performed. The perpendicular distance from the point to the line... The calculation formula is: .

[0011] Foot of the perpendicular (intersection point) coordinates The calculation formula is: .

[0012] Alternatively, a more direct projection formula can be used: .

[0013] Target point There are various ways to obtain them, such as locating them from images through template matching, feature point detection (such as SIFT, ORB, Harris corners), Blob analysis, or specific marker recognition techniques.

[0014] The main drawbacks of this method are: First, insufficient environmental sensitivity and robustness. This method heavily relies on the quality of prior image preprocessing and edge detection. In scenarios with uneven lighting, complex background textures, low contrast between the target and background, or a large amount of noise, the edge detection step is prone to producing broken, false, or redundant edges, leading to a decrease in the quality of the input data (point set) for subsequent line fitting, or even the inability to correctly extract the target line. For example, the high and low thresholds in the Canny operator need to be manually adjusted according to the image content, lacking adaptability. Second, line feature confusion and mismatch. When there are multiple approximately parallel or intersecting lines in the image (such as multiple scratches on a machined surface or a grid-like background), the Hough transform or least squares method may incorrectly fit points belonging to different physical edges as a single line, or fail to accurately distinguish which is the true "target line." This usually requires the introduction of complex heuristic rules or prior knowledge (such as the expected position and angle range of the line) for filtering, increasing the complexity of the algorithm and the cost of customization. Third, sensitivity to local occlusion or defects. If part of the target line is occluded or damaged (such as scratches or stains), the line fitted based on the global point set (especially using the least squares method) will be biased because the fitting process attempts to balance all points, causing the fitted line to deviate from the true position of the unoccluded line. While the Hough transform has some tolerance for local missing points, when occlusion is severe, the peak values ​​in the parameter space may become insignificant and easily overwhelmed by noise peaks. Fourth, accuracy is limited by pixel discretization. Whether it's edge localization or line fitting, the basic unit is the pixel. Achieving sub-pixel accuracy usually requires additional interpolation or fitting techniques (such as sub-pixel edge localization or curve fitting), but these techniques themselves increase computational complexity and uncertainty. Especially when the target point or line edge is in a low-texture area, localization accuracy is difficult to guarantee.

[0015] (2) Deep learning-based methods With the rise of deep learning, especially the development of convolutional neural networks and instance segmentation techniques, several end-to-end or hybrid solutions have emerged. A common approach is to use semantic segmentation networks (such as U-Net and DeepLab) to perform pixel-level classification of images, outputting probability maps for categories such as "background," "straight edge," and "target point." Then, the "straight edge" probability map undergoes post-processing (such as skeletonization and connected component analysis), and the aforementioned least squares method or Hough transform is used to fit a straight line. Target points are obtained by finding the centroid or maxima of the "target point" probability map.

[0016] Another approach is to use a keypoint detection network to directly regress the line parameters (e.g., predict the coordinates of the two endpoints of the line, or predict the normal parameters). (and target point coordinates). Another method transforms the problem into a regression task, directly inputting the image and having a neural network output the distance. and perpendicular coordinates The greatest advantage of this type of method lies in its stronger robustness to complex backgrounds, low contrast, and partial occlusion, as neural networks can learn higher-level semantic features. However, its accuracy heavily relies on training with a large amount of labeled data, and the interpretability of the model is relatively weak. In industrial inspection applications requiring high precision and traceability, its absolute measurement accuracy sometimes cannot match that of rigorously calibrated traditional methods.

[0017] The main drawbacks of this method are: First, high data dependence and cost. Training requires a large amount of precisely labeled image data, and the labeling for tasks like "point-to-line intersection" inherently requires high precision, resulting in high production costs. For flexible production lines with frequent product model changes and diverse objects being measured, the cost of re-collecting and labeling data may be unacceptable. Second, challenges in absolute accuracy and physical consistency. Deep learning models are essentially data-driven statistical models, and their outputs may contain unexplainable biases and it is difficult to guarantee strict geometric constraints (such as ensuring the foot of the perpendicular in the output lies on the fitted line). In metrology scenarios requiring micrometer-level precision, this black-box characteristic casts doubt on its reliability. Third, computational resources and real-time performance. Complex deep models (such as segmentation networks) require GPU acceleration for real-time processing, increasing hardware costs and system power consumption, making deployment on embedded or edge computing devices difficult. Fourth, interpretability and debugging difficulties. When measurement results are abnormal, it is difficult to quickly locate the root cause of the problem by checking intermediate steps (such as edge maps and fitted point sets), as is the case with traditional methods.

[0018] Based on the above analysis, existing technologies struggle to achieve an ideal balance between high precision, robustness, efficiency, and interpretability. Therefore, the purpose of this invention is to provide a novel machine vision method for measuring point-to-line intersections that integrates the advantages of traditional geometric stability and intelligent feature selection. Specific objectives include: 1) improving the robustness and accuracy of line detection in complex backgrounds, low contrast, and partial occlusion conditions; 2) achieving automatic and reliable differentiation between target and interfering lines, reducing false matching; 3) improving the accuracy of feature localization and the algorithm's adaptability without excessive reliance on large-scale data training; 4) maintaining the clarity and interpretability of the method steps, facilitating engineering debugging and optimization; and 5) ensuring strict geometric constraints and traceability throughout the measurement process, meeting the requirements of high-precision industrial inspection. Summary of the Invention

[0019] In view of the above-mentioned shortcomings mentioned in the background art, the purpose of this invention is to provide a visual measurement method and system for the perpendicular intersection of a point and a straight line.

[0020] Specifically, a first aspect of the present invention provides a visual measurement method for a point to a perpendicular intersection of a line, the method comprising the following steps: Step S1: Acquire a two-dimensional image of the scene to be tested as the original image, and perform multi-scale analysis on the original image. Perform primary edge perception based on phase consistency in at least one intermediate scale layer to obtain primary edge features that are insensitive to changes in illumination and have directional information. Step S2: Clustering is performed based on the primary edge features to generate multiple line hypotheses. The location information of the target point is introduced. The line hypotheses are scored and filtered according to the spatial relationship between the target point and each line hypothese, so as to determine at least one candidate target line. Step S3: Construct a focal region around the candidate target line in the original image, extract edge features at the sub-pixel level using the target point position within the focal region, and perform weighted line fitting based on the spatial relationship between the edge features and the target point to obtain parameter estimates of the target line. Step S4: Under the geometric constraint that the foot of the perpendicular from the target point to the target line lies on the target line, perform joint optimization with the target point position and the target line parameters as the variables to be optimized to obtain the final target point position, target line parameters and the corresponding perpendicular intersection point, and output the perpendicular distance from the target point to the target line.

[0021] A second aspect of the present invention provides a visual measurement system for a point-to-line perpendicular intersection point, the system comprising: The image acquisition and multi-scale analysis module is used to acquire two-dimensional images of the scene under test as raw images, and to perform multi-scale analysis on the raw images. Primary edge perception is performed based on phase consistency in at least one intermediate scale layer to obtain primary edge features that are insensitive to changes in illumination and have directional information. The straight line hypothesis generation and target point guided screening module is used to perform clustering based on the primary edge features and generate multiple straight line hypotheses, introduce the location information of the target point, and score and screen the straight line hypotheses according to the spatial relationship between the target point and each of the straight line hypotheses to determine at least one candidate target straight line. The subpixel fitting module for the focused region is used to construct a focused region around the candidate target line in the original image, extract edge features at the subpixel level using the target point position within the focused region, and perform weighted line fitting based on the spatial relationship between the edge features and the target point to obtain the parameter estimate of the target line. The geometric constraint joint optimization and result output module is used to perform joint optimization with the target point position and target line parameters as the variables to be optimized under the geometric constraint that the foot of the perpendicular from the target point to the target line is located on the target line, to obtain the final target point position, target line parameters and corresponding perpendicular intersection point, and output the perpendicular distance from the target point to the target line.

[0022] A third aspect of the present invention also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the preceding claims.

[0023] A fourth aspect of the present invention also provides a computer program product, comprising a computer program that, when executed by a processor, implements the method as described in any of the preceding claims.

[0024] Compared with the prior art, the present invention has the following significant advantages: 1. Superior Robustness and Environmental Adaptability: By introducing phase consistency for primary perception, this invention significantly enhances resistance to changes in illumination, non-uniform lighting, and low-contrast scenes. Phase consistency feature detection does not rely on absolute grayscale gradient values, thus effectively indicating edge positions even in shadow or reflective areas, providing a more reliable foundation for subsequent steps. The multi-scale pyramid structure further ensures the capture of straight-line features at different scales.

[0025] 2. Precise line identification and anti-interference capability: Traditional methods are prone to confusion in scenarios with multiple lines. This invention creatively incorporates the prior location information of the target point as a strong constraint into the line hypothesis screening process through a "focused scoring" mechanism. This allows the algorithm to automatically tend to select lines that are spatially close to the target point as candidates, greatly reducing the risk of mismatch. Even if multiple parallel lines exist, the algorithm can effectively lock onto the one related to the measurement point.

[0026] 3. High Precision and Local Adaptability: In the precise fitting stage, a target-point-guided weighted least squares method is employed. By assigning higher weights to edge points closer to the target point, the fitting process primarily focuses on straight line segments near the target point. This effectively overcomes the negative impact of occlusion, defects, or curvature in distant regions on local segment parameters during global straight line fitting, making the measured straight line segment parameters more accurate and reliable. Sub-pixel edge detection further enhances accuracy from the data source.

[0027] 4. Strict Geometric Consistency and Optimal Solution: The iterative verification and optimization framework is one of the core advantages of this invention. It unifies target point localization, line fitting, and perpendicular foot calculation into a single optimization problem, simultaneously optimizing all parameters by minimizing the joint loss function. This ensures that the foot of the final output perpendicular lies strictly on the fitted line, and that both the target point and the line best match the image feature evidence. The use of the LM algorithm guarantees the stability and rapid convergence of the optimization. This overcomes the problems of error accumulation and geometric inconsistencies between steps in traditional "serialized" processes.

[0028] 5. Excellent interpretability and debuggability: The entire process is clearly defined, and intermediate results (such as phase consistency maps, candidate lines, focal regions, sub-pixel edge points, and residuals from iterative optimization) are all visualized. When measurement deviations occur, engineers can step-by-step check the output of each stage to quickly pinpoint whether the problem lies in the initial perception, candidate generation, edge extraction, or optimization phases, facilitating algorithm debugging and parameter optimization. This contrasts sharply with the black-box nature of deep learning.

[0029] 6. Balance between efficiency and practicality: Although the process is more complex than traditional methods, a coarse-to-fine strategy and region focus confine a large amount of computation to key areas, avoiding the huge overhead of high-precision processing across the entire map. Phase consistency calculations are performed in a lower-resolution intermediate layer, saving time as well. Iterative optimization typically converges in just a few iterations. Overall computational costs are manageable, enabling real-time or near-real-time processing on standard industrial PCs.

[0030] 7. Reduced reliance on large-scale labeled data: This invention does not rely on end-to-end deep neural networks and requires no large amount of labeled data for training. It combines the deterministic advantages of traditional geometric vision with the adaptive advantages of data-driven methods (through weighted optimization), reducing reliance on labeled data while ensuring high accuracy, making it more suitable for flexible manufacturing scenarios with small to medium batches and multiple product varieties.

[0031] In summary, this invention outperforms traditional methods in terms of accuracy, robustness, anti-interference capability, and geometric consistency, and surpasses pure deep learning methods in terms of interpretability and practicality, providing a more reliable and universal solution for measuring point-to-line intersections. Attached Figure Description

[0032] Figure 1 This is a schematic diagram of the overall process of a visual measurement method for a point-to-line perpendicular intersection point disclosed in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the process from initial perception to regional focusing. in, Figure 2 (a) is the original image / scene input; Figure 2 (b) is the initial perception result (phase consistency edge); Figure 2 (c) is a line assumption generation + target point guided filtering; Figure 2 (d) is the region focusing for candidate lines (final output); Figure 3 A schematic diagram illustrating the principle of weighted exact fitting guided by the target point; Figure 4 This is a schematic diagram illustrating the convergence of the iterative joint optimization process; Figure 5 This is a schematic diagram comparing the effects of the present invention's solution with those of traditional methods; Figure 6 This is a schematic diagram of the structure of a visual measurement system for a point-to-line perpendicular intersection point disclosed in an embodiment of the present invention. Detailed Implementation

[0033] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0034] Please see Figure 1 This invention provides a visual measurement method for a point perpendicular to the intersection of a line and a point, the method comprising the following steps: Step S1: Acquire a two-dimensional image of the scene to be tested as the original image, and perform multi-scale analysis on the original image. Perform primary edge perception based on phase consistency in at least one intermediate scale layer to obtain primary edge features that are insensitive to changes in illumination and have directional information. This step aims to stably extract primary edge features reflecting straight line structures under complex imaging conditions such as illumination and contrast variations by using a multi-scale pyramid structure and phase consistency analysis mechanism, and to provide structured input for subsequent edge clustering based on direction consistency and generation of straight line assumptions.

[0035] As an example, multi-scale analysis is performed on the original image, and primary edge sensing is performed based on phase consistency at at least one intermediate scale layer to obtain primary edge features that are insensitive to illumination changes and have directional information, including: Step S11: Perform multi-scale decomposition on the original image to construct an image representation containing different spatial resolutions; In this step, a two-dimensional digital image of the scene under test is acquired using a calibrated industrial camera, and this image is used as the original image. Its resolution is To represent the structural information in the image at different scales, the original image is decomposed into multiple scales, and a Gaussian pyramid representation of the image is constructed. .in, For the original resolution image, the first Layer Image By the The layer image is obtained by Gaussian filtering and downsampling, and the calculation relationship is as follows: ;in, The weights of the 5×5 Gaussian convolution kernel can be expressed using the standard deviation. Discrete approximation; number of pyramid levels The size is determined based on the image size and the minimum detectable structure scale, for example, ensuring that the straight line features of the top layer image can still be effectively perceived (typically the top layer image size is not less than 64×64 pixels).

[0036] By using multi-scale decomposition, subsequent edge sensing can both suppress noise interference and retain representative structural information.

[0037] Step S12: In at least one intermediate scale layer of the multi-scale image representation, the phase consistency response of the image at each pixel location is calculated based on multi-directional, multi-scale phase consistency analysis. In this step, the image at the intermediate scale layer... The above uses a multi-scale, multi-directional Log-Gabor filter bank for filtering.

[0038] In scale ,direction The filtered response consists of even-symmetric components. With odd symmetric components Its composition, and its amplitude is defined as: ; The corresponding local phase is: ; The weighted average phase at each scale and direction is defined as follows: ; The phase deviation term is defined as: ; Therefore, the phase coherence response at the pixel location is calculated as follows: ;in, To prevent constants with a denominator of zero. Phase-consistent response. The range of values ​​is Its numerical value reflects the consistency of structural features at that pixel.

[0039] Step S13: Determine the edge position in the image based on the phase consistency response, and suppress non-maximum responses to obtain sparse edge features; at the same time, based on the local orientation information obtained during the phase consistency analysis, associate the corresponding orientation attributes with the edge features to form primary edge features with orientation information.

[0040] In this step, the phase consistency response is first tested. Threshold filtering is performed to retain only those with phase consistency responses greater than a preset threshold. The pixel location is used to suppress spurious responses caused by noise or weak textures.

[0041] Based on this, non-maximum suppression is performed on the retained phase coherence response. This non-maximum suppression is carried out along the gradient direction of the phase coherence response, where the gradient direction is the average phase obtained from the phase coherence analysis. add This ensures that only edge points corresponding to local maxima are retained.

[0042] Simultaneously, during phase consistency analysis, each pixel location can obtain corresponding principal direction information, which reflects the normal direction of the local structure. This principal direction information is then associated one-to-one with the edge points obtained after non-maximum suppression, forming a primary edge feature set containing both position and direction attributes. ;in, This represents the pixel coordinates of the edge points in the image. This indicates the direction attribute corresponding to the edge point, and the direction attribute is used to characterize the normal direction of the edge (the normal direction of the edge, i.e.) ).

[0043] Through the above processing, the resulting primary edge feature set not only has sparsity and stability in spatial location, but also consistency in directional attributes, providing directly usable input data for edge clustering and line assumption generation based on directional consistency and spatial proximity in subsequent steps.

[0044] Step S2: Clustering is performed based on the primary edge features to generate multiple line hypotheses. The location information of the target point is introduced. The line hypotheses are scored and filtered according to the spatial relationship between the target point and each line hypothese, so as to determine at least one candidate target line. In complex scenarios containing multiple straight line structures, several straight line hypotheses are generated by clustering primary edge features based on directional consistency and spatial proximity. Furthermore, the location information of the target point is introduced to perform targeted scoring and screening of the straight line hypotheses, thereby prioritizing the locking of candidate target lines related to the measurement task and avoiding misselection problems caused by relying solely on the global edge structure.

[0045] As an example, the process of clustering based on the primary edge features and generating multiple line hypotheses, incorporating the location information of the target point, and scoring and filtering the line hypotheses according to the spatial relationship between the target point and each line hypothese to determine at least one candidate target line includes: Step S21: Cluster the primary edge features based on their directional information and spatial proximity to form several edge feature sets; In this step, the primary edge feature set obtained in step S1 is used. As input, where Indicates the spatial location of edge points. This indicates the direction attribute (normal direction) of the edge point.

[0046] First, based on the direction attributes of the edge points The orientation consistency of the primary edge features is determined only if the orientation difference between two edge points satisfies the following condition: At that time, it was assumed that the two were consistent in direction; among them, This is a preset direction threshold.

[0047] Based on satisfying directional consistency, a proximity judgment is further made according to the spatial distance between edge points. When the Euclidean distance between two edge points satisfies... At that time, it was considered that the two were spatially adjacent; among them, This is a preset spatial distance threshold.

[0048] By combining the constraints of directional consistency and spatial proximity, the primary edge features are clustered to form several edge feature sets: .in, Indicates the first A set of edge features This is the set of indices for edge points within the set. This clustering process effectively aggregates edge features belonging to the same physical linear structure.

[0049] Step S22: Perform line fitting on each of the edge feature sets to generate corresponding multiple line hypotheses; In this step, for each edge feature set obtained in step S21 When the number of edge points it contains meets the preset minimum number of points threshold At that time, a straight line fitting process is performed on the edge feature set.

[0050] In this embodiment, the straight line is represented by normal parameters as follows: ;in, and They represent the first The distance and direction parameters of the assumed straight line.

[0051] To enhance robustness to abnormal edge points, a robust fitting strategy (such as RANSAC or Least Median Squares (LMedS)) can be used to fit a straight line to the edge feature set, and the ratio of the inlier set to the inlier points is statistically analyzed during the fitting process. Thus, for each edge feature set... Generate a corresponding straight line hypothesis This forms the set of linear hypothesis. .

[0052] Step S23: Obtain the location information of the target point and calculate the spatial relationship between the target point and each of the assumed straight lines; In this step, the initial position information of the target point in the original image is obtained and represented as... The target point can be obtained by manual calibration, prior input, or other visual detection methods.

[0053] For each straight line generated in step S22, assume Calculate the target point The formula for calculating the perpendicular distance to the assumed line is: The vertical distance Used to characterize the target point and the first The spatial relationship between the hypothetical straight lines.

[0054] Step S24: Score each of the line assumptions based on the spatial relationship, and select at least one as a candidate target line based on the scoring results.

[0055] In this step, an assumption is made for each straight line. Construct a comprehensive scoring function This is used to evaluate the degree to which the assumed line matches the target line. The scoring function in this embodiment takes the following form: ;in: Indicates the first Linear assumption The corresponding proportion of fitted inliers is used to measure the confidence level of the linear hypothesis. Indicates the target point To the linear assumption The vertical distance; This indicates the angular deviation between the assumed direction of the straight line and the expected direction; It is about the angle of a straight line. Angle with the expected target line The function of the difference, for example ; Let be the weight coefficient, and satisfy... .

[0056] By calculating the score corresponding to each linear assumption The line hypotheses are then ranked according to the scoring results, and at least one line hypotheses with the highest scores are selected as candidate target lines. .

[0057] This completes the determination of candidate target lines, providing a foundation for the construction of the focus area and high-precision line modeling in subsequent steps.

[0058] Step S3: Construct a focal region around the candidate target line in the original image, extract edge features at the sub-pixel level using the target point position within the focal region, and perform weighted line fitting based on the spatial relationship between the edge features and the target point to obtain parameter estimates of the target line. Please see Figure 3 This step further improves the accuracy and stability of line parameter estimation in the local area near the candidate target line by extracting sub-pixel-level edges with consistent orientation and weighted line fitting guided by the target point, and avoids interference from global edge noise on the measurement results.

[0059] As an example, within the focused area, sub-pixel level extraction of edge features is performed using the target point location as a guide, and weighted line fitting is performed based on the spatial relationship between the edge features and the target point to obtain parameter estimates of the target line, including: Step S31: Within the focused area, the edge features are extracted at the sub-pixel level along the direction consistent with the normal direction of the candidate target line to obtain edge feature points with sub-pixel accuracy. In this step, the candidate target line determined in step S2 is... In the original image Construct a focusing region around the candidate target line. The focusing area is a strip-shaped region centered on the candidate target line, and its width is a preset bandwidth parameter. (For example, 20-50 pixels). This focused area is used for the next step of high-precision edge extraction, thereby eliminating interference from a large number of irrelevant edges outside the area. (See attached image) Figure 2 It demonstrates the process from the phase-consistent edges of the entire image to the generation of candidate lines, and then to the delineation of the focus area.

[0060] Next, a Steerable Filter is used to enhance the image, with the enhancement direction being the normal direction of the candidate target line. This direction is determined by the direction parameter of the candidate target line. Determine the normal direction. for: .

[0061] Within the focused area, edge scanning is performed along the normal direction, and the grayscale information on each scan line is interpolated to accurately determine the edge position. Sub-pixel level extraction can obtain the edge position using quadratic interpolation. The normal scanning method yields a set containing the edge point positions and orientations.

[0062] The enhanced image obtained after strengthening the image using a Steerable Filter for: .in, This represents the convolution operation. This represents the derivative along the normal direction. For enhanced filters.

[0063] Finally, the sub-pixel precision edge point set extracted from this enhanced image Includes position coordinates and direction That is, the local gradient direction.

[0064] Through gradient calculation, each edge feature point is associated with a local gradient direction. Information, this direction is the principal direction for each edge point. Edge point set. Defined as: ,in, The local gradient direction represents the normal direction of the edge point. This set of edge points contains precise edge information within the image region near the candidate line.

[0065] Step S33: Calculate the spatial distance between the sub-pixel level edge feature points and the target point, and assign corresponding weights to each sub-pixel level edge feature point based on the spatial distance; In this step, the initial position of the target point obtained in step S2 is used. For reference, for each sub-pixel level edge feature point Calculate the spatial distance between it and the target point. This distance is measured using Euclidean distance: .

[0066] The spatial distance calculated above Assign weights to each edge feature point The weight allocation uses an exponential decay function, ensuring that edge feature points closer to the target point contribute more to the fitting result. The formula is as follows: .

[0067] in, It is a parameter that controls the rate of weight decay. It is a small constant basis, ensuring that points far away still have a small amount of weight, avoiding loss of constraint in extreme cases.

[0068] Through the above weight allocation, edge feature points near the target point will receive higher weights, which helps to improve the accuracy and reliability of the fitting results.

[0069] Step S34: Perform weighted straight line fitting on the sub-pixel level edge feature points based on the weights to obtain the parameter estimate of the target straight line.

[0070] In this step, the sub-pixel level edge feature point set obtained in step S33 is used as a basis. and their corresponding weights A weighted linear fitting is performed. To ensure fitting accuracy, this embodiment uses the least squares method for weighted fitting, and the error function is defined as: ;in, The number of edge feature points, The coordinates of each sub-pixel level edge feature point. and These represent the slope and intercept of the line, respectively.

[0071] Solve the weighted normal equation: ; ; Solving for: ; .

[0072] By minimizing the aforementioned weighted error function, the slope of the straight line can be obtained. and intercept This allows us to derive parameter estimates for the target line. Finally, through the obtained... and Representing a straight line in slope-intercept form: .

[0073] To ensure geometric consistency of the fitting results, the parameters of the target line are expressed in normal form: (Quadrant needs to be considered); ; in, This represents the weighted center position of the weighted edge feature points.

[0074] Through this weighted fitting process, accurate parameter estimates of the target line were obtained. This provides initial parameters for subsequent joint optimization of geometric constraints.

[0075] Step S4: Under the geometric constraint that the foot of the perpendicular from the target point to the target line lies on the target line, perform joint optimization with the target point position and the target line parameters as the variables to be optimized to obtain the final target point position, target line parameters and the corresponding perpendicular intersection point, and output the perpendicular distance from the target point to the target line.

[0076] This step aims to jointly optimize the target point position and target line parameters by combining geometric constraints, ensuring that the final target point position, target line parameters, and perpendicular intersection coordinates meet geometric consistency requirements, and ultimately accurately calculate the perpendicular distance from the target point to the target line.

[0077] As an example, under the geometric constraint that the foot of the perpendicular from the target point to the target line lies on the target line, joint optimization is performed using the target point position and the target line parameters as variables to be optimized, to obtain the final target point position, target line parameters, and corresponding perpendicular intersection point, including: Step S41: Using the parameter estimates of the target point position and the target line as initial values, construct a joint optimization model containing geometric constraints, wherein the geometric constraints are used to limit the foot of the perpendicular from the target point to the target line to be on the target line. In this step, the target point position obtained in step S3 is first used. Initial parameters of the target line A joint optimization model is constructed using the initial values ​​for optimization. The parameters of the target point location and the target line are the variables to be optimized.

[0078] The key to joint optimization is the geometric constraint, which states that the foot of the perpendicular from the target point to the target line must lie on the target line. The geometric constraint can be expressed as... .in, Indicates the target point to the target line The vertical distance is: .

[0079] This geometric constraint ensures that the foot of the perpendicular from the target point to the target line is indeed located on the target line. In other words, the optimization process needs to minimize the perpendicular distance between the target point and the target line, and the foot of the perpendicular should be in the same direction as the line.

[0080] Under this geometric constraint, the position of the target point and the parameters of the line... It is included as an optimization variable in the joint optimization process.

[0081] Step S42: In the joint optimization model, the target point position and target line parameters are used as variables to be optimized, and an error term reflecting the consistency between edge features and the target line is established. In this step, in the joint optimization model, in addition to considering geometric constraints, it is also necessary to optimize the consistency between edge features and the target line to ensure that the target line can accurately fit the edge features in the image.

[0082] Define the geometric error term This error term reflects the consistency between the target line and edge features. The joint loss function based on geometric projection error and image feature response is: .in, Mandatory target point The foot of the perpendicular to the target line must lie on the line. and These represent the consistency of edge features and the consistency of target point location, respectively.

[0083] In the geometric error term In the middle, geometric constraints require that from the target point to the target line foot drop The perpendicularity condition is met. This is achieved by establishing an auxiliary coordinate system within the line parameters. The geometric error term can be calculated: ; .

[0084] The geometric error term defines the target point. The distance to the target line is determined to minimize this error and satisfy the geometric constraints.

[0085] Edge feature alignment item : Measure the current line The degree of alignment with actual edges in the image. Used in the focused area. Sub-pixel edge point set extracted from the inner edge For each edge point Calculate its distance to the current line. vertical distance At the same time, considering that these edge points themselves have direction... ,straight line The direction should be (Edge direction). Therefore, directional consistency is also important. Definition: ;in, Spatial weight (Based on the present) (The distance is recalculated) This is a balancing factor between distance error and direction error. This encourages lines to pass through edge points simultaneously and in the same direction as the local edge.

[0086] Target point feature terms : Measure the current target point position The degree of agreement between the image and the actual features of the target point can be calculated. Image feature response within a small neighborhood To obtain it. For example, if the target point is a dot marker, then It can be a template matching score based on normalized cross-correlation, or an interpolation value from a pre-trained lightweight keypoint heatmap. Definition This is because it is necessary to maximize the characteristic response.

[0087] Step S43: Iteratively optimize and update the variable to be optimized based on the error term until the preset convergence condition is met; In this step, based on the error term Given geometric constraints, the Levenberg-Marquardt (LM) algorithm is used for optimization because it handles nonlinear least squares problems well. The optimization variables are... .

[0088] The iterative process is as follows: 1. Initialization: .

[0089] 2. In the In the next iteration, the residual vector is calculated. And Jacobi matrix The residual vector is derived from... and The relevant residual terms constitute the geometric constraints. The condition has been implicitly satisfied through the variable relationship (the foot of the perpendicular is a function of the variable).

[0090] 3. LM algorithm for solving update quantity : ,in It is the damping factor. It is an identity matrix.

[0091] 4. Update variables: .

[0092] 5. Repeat steps 2-4 until convergence. (If the threshold is less than or the number of iterations reaches the upper limit).

[0093] Through this iterative optimization, the target point location... Target line parameters The implicit perpendicular coordinates are also optimized simultaneously, and the final result satisfies strict geometric projection relationship and is highly consistent with the low-level features of the image. Figure 4 The diagram illustrates how the position of the line and the position of the target point are adjusted during the iterative optimization process, eventually converging to the optimal solution.

[0094] Step S44: Based on the optimized target point position and target line parameters, determine the corresponding perpendicular intersection point and calculate the perpendicular distance from the target point to the target line.

[0095] The target point location obtained after optimization and target line parameters The final perpendicular intersection point can be calculated. The formula for calculating the perpendicular intersection point is: ; .

[0096] Simultaneously, calculate the perpendicular distance from the target point to the target line: .

[0097] This calculation yields the precise vertical distance from the target point to the target line and the corresponding vertical intersection point.

[0098] Finally, the image coordinates of the target point and its perpendicular intersection point are mapped into 3D space. The following formula is used to convert the image coordinates into 3D coordinates: ;in, It is the camera's intrinsic parameter matrix. These are the coordinates of a point in the image coordinate system. It is the depth value.

[0099] This formula is used to map the image coordinates of the target point and the perpendicular intersection point into three-dimensional space, and calculate their three-dimensional coordinates.

[0100] Figure 5 The diagram compares the effectiveness of the method of this invention with that of conventional methods. Left image: Conventional method (e.g., Canny+Hough): In scenarios with uneven lighting, interference lines (L-interference), and partial occlusion (a black stain obscuring a segment of the target line), the conventional method incorrectly fits the interference line L-interference to the target line, or the occlusion causes a global shift in the fitted line (a deviated dashed line), resulting in an incorrect perpendicular foot (far from the true position). Right image: Method of this invention: In the same scenario, this invention, through phase consistency, can still perceive the edges at both ends of the occluded segment (displayed as broken bright spots in the PC image). It selects the correct line candidate through focus scoring and, during weighted fitting, primarily relies on the intact edge points at both ends of the occluded area that are close to the target point, thus fitting the correct line (solid line) and calculating the accurate perpendicular foot. The focused area is highlighted.

[0101] Please see Figure 6 This invention also provides a visual measurement system 200 for a point-to-the-perpendicular intersection of a line, the system comprising: The image acquisition and multi-scale analysis module 201 is used to acquire a two-dimensional image of the scene to be tested as the original image, and to perform multi-scale analysis on the original image. Primary edge perception is performed based on phase consistency in at least one intermediate scale layer to obtain primary edge features that are insensitive to changes in illumination and have directional information. The line hypothesis generation and target point guidance screening module 202 is used to perform clustering based on the primary edge features and generate multiple line hypotheses, introduce the location information of the target point, and score and screen the line hypotheses according to the spatial relationship between the target point and each line hypothesis to determine at least one candidate target line. The subpixel fitting module 203 for focusing region is used to construct a focusing region around the candidate target line in the original image, extract edge features at the subpixel level by using the target point position as a guide within the focusing region, and perform weighted line fitting based on the spatial relationship between the edge features and the target point to obtain the parameter estimate of the target line. The geometric constraint joint optimization and result output module 204 is used to perform joint optimization with the target point position and target line parameters as the variables to be optimized under the geometric constraint that the foot of the perpendicular from the target point to the target line is located on the target line, to obtain the final target point position, target line parameters and corresponding perpendicular intersection point, and output the perpendicular distance from the target point to the target line.

[0102] As an example, the image acquisition and multi-scale analysis module 201 is specifically used for: The original image is decomposed into multiple scales to construct image representations with different spatial resolutions; In at least one intermediate scale layer of the multi-scale image representation, the phase consistency response of the image at each pixel location is calculated based on multi-directional, multi-scale phase consistency analysis. The edge positions in the image are determined based on the phase consistency response, and non-maximum responses are suppressed to obtain sparse edge features. At the same time, based on the local orientation information obtained during the phase consistency analysis, the corresponding orientation attributes are associated with the edge features, thereby forming primary edge features with orientation information.

[0103] As an example, the line hypothesis generation and target point guided filtering module 202 is specifically used for: The primary edge features are clustered based on their directional information and spatial proximity to form several edge feature sets; Line fitting is performed on each of the edge feature sets to generate multiple corresponding line hypotheses; Obtain the location information of the target point and calculate the spatial relationship between the target point and each of the assumed straight lines; Each of the proposed straight line assumptions is scored based on the spatial relationship, and at least one is selected as a candidate target straight line based on the scoring results.

[0104] As an example, the sub-pixel fitting module 203 for the focused region is specifically used for: Within the focal region, edge features are extracted at the sub-pixel level along a direction consistent with the normal direction of the candidate target line to obtain edge feature points with sub-pixel accuracy. Calculate the spatial distance between the sub-pixel level edge feature points and the target point, and assign corresponding weights to each sub-pixel level edge feature point based on the spatial distance; Based on the weights, a weighted straight line fit is performed on the sub-pixel level edge feature points to obtain the parameter estimate of the target straight line.

[0105] As an example, the geometric constraint joint optimization and result output module 204 is specifically used for: Using the parameter estimates of the target point position and the target line as initial values, a joint optimization model with geometric constraints is constructed, wherein the geometric constraints are used to limit the foot of the perpendicular from the target point to the target line to be on the target line. In the joint optimization model, the target point position and target line parameters are used as variables to be optimized, and an error term reflecting the consistency between edge features and the target line is established. Based on the error term, the variable to be optimized is iteratively optimized and updated until the preset convergence condition is met; Based on the optimized target point position and target line parameters, determine the corresponding perpendicular intersection point and calculate the perpendicular distance from the target point to the target line.

[0106] This invention also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the method as described in any of the preceding claims.

[0107] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the preceding claims.

[0108] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A visual measurement method for the perpendicular intersection of a point and a line, characterized in that, The method includes the following steps: Step S1: Acquire a two-dimensional image of the scene to be tested as the original image, and perform multi-scale analysis on the original image. Perform primary edge perception based on phase consistency in at least one intermediate scale layer to obtain primary edge features that are insensitive to changes in illumination and have directional information. Step S2: Clustering is performed based on the primary edge features to generate multiple line hypotheses. The location information of the target point is introduced. The line hypotheses are scored and filtered according to the spatial relationship between the target point and each line hypothese, so as to determine at least one candidate target line. Step S3: Construct a focal region around the candidate target line in the original image, extract edge features at the sub-pixel level using the target point position within the focal region, and perform weighted line fitting based on the spatial relationship between the edge features and the target point to obtain parameter estimates of the target line. Step S4: Under the geometric constraint that the foot of the perpendicular from the target point to the target line lies on the target line, perform joint optimization with the target point position and the target line parameters as the variables to be optimized to obtain the final target point position, target line parameters and the corresponding perpendicular intersection point, and output the perpendicular distance from the target point to the target line.

2. The visual measurement method for a point-to-line perpendicular intersection point according to claim 1, characterized in that: Multi-scale analysis is performed on the original image, and primary edge sensing is performed based on phase consistency at at least one intermediate scale layer to obtain primary edge features that are insensitive to illumination changes and have directional information, including: Step S11: Perform multi-scale decomposition on the original image to construct an image representation containing different spatial resolutions; Step S12: In at least one intermediate scale layer of the multi-scale image representation, the phase consistency response of the image at each pixel location is calculated based on multi-directional, multi-scale phase consistency analysis. Step S13: Determine the edge position in the image based on the phase consistency response, and suppress non-maximum responses to obtain sparse edge features; at the same time, based on the local orientation information obtained during the phase consistency analysis, associate the corresponding orientation attributes with the edge features to form primary edge features with orientation information.

3. The visual measurement method for the perpendicular intersection of a point and a line according to claim 2, characterized in that: Clustering is performed based on the primary edge features to generate multiple line hypotheses. The location information of the target point is introduced, and the line hypotheses are scored and filtered according to the spatial relationship between the target point and each line hypothese to determine at least one candidate target line, including: Step S21: Cluster the primary edge features based on their directional information and spatial proximity to form several edge feature sets; Step S22: Perform line fitting on each of the edge feature sets to generate corresponding multiple line hypotheses; Step S23: Obtain the location information of the target point and calculate the spatial relationship between the target point and each of the assumed straight lines; Step S24: Score each of the line assumptions based on the spatial relationship, and select at least one as a candidate target line based on the scoring results.

4. The visual measurement method for a point-to-line perpendicular intersection point according to claim 3, characterized in that: Within the focused area, the target point location guides the sub-pixel level extraction of edge features, and a weighted straight line fit is performed based on the spatial relationship between the edge features and the target point to obtain parameter estimates of the target straight line, including: Step S31: Within the focused area, the edge features are extracted at the sub-pixel level along the direction consistent with the normal direction of the candidate target line to obtain edge feature points with sub-pixel accuracy. Step S33: Calculate the spatial distance between the sub-pixel level edge feature points and the target point, and assign corresponding weights to each sub-pixel level edge feature point based on the spatial distance; Step S34: Perform weighted straight line fitting on the sub-pixel level edge feature points based on the weights to obtain the parameter estimate of the target straight line.

5. The visual measurement method for a point-to-line perpendicular intersection point according to claim 4, characterized in that: Under the geometric constraint that the foot of the perpendicular from the target point to the target line lies on the target line, joint optimization is performed using the target point position and the target line parameters as variables to be optimized, to obtain the final target point position, target line parameters, and corresponding perpendicular intersection point, including: Step S41: Using the parameter estimates of the target point position and the target line as initial values, construct a joint optimization model containing geometric constraints, wherein the geometric constraints are used to limit the foot of the perpendicular from the target point to the target line to be on the target line. Step S42: In the joint optimization model, the target point position and target line parameters are used as variables to be optimized, and an error term reflecting the consistency between edge features and the target line is established. Step S43: Iteratively optimize and update the variable to be optimized based on the error term until the preset convergence condition is met; Step S44: Based on the optimized target point position and target line parameters, determine the corresponding perpendicular intersection point and calculate the perpendicular distance from the target point to the target line.

6. A visual measurement system for a point perpendicular to the intersection of a line, characterized in that: The system includes: The image acquisition and multi-scale analysis module is used to acquire two-dimensional images of the scene under test as raw images, and to perform multi-scale analysis on the raw images. Primary edge perception is performed based on phase consistency in at least one intermediate scale layer to obtain primary edge features that are insensitive to changes in illumination and have directional information. The straight line hypothesis generation and target point guided screening module is used to perform clustering based on the primary edge features and generate multiple straight line hypotheses, introduce the location information of the target point, and score and screen the straight line hypotheses according to the spatial relationship between the target point and each of the straight line hypotheses to determine at least one candidate target straight line. The subpixel fitting module for the focused region is used to construct a focused region around the candidate target line in the original image, extract edge features at the subpixel level using the target point position within the focused region, and perform weighted line fitting based on the spatial relationship between the edge features and the target point to obtain the parameter estimate of the target line. The geometric constraint joint optimization and result output module is used to perform joint optimization with the target point position and target line parameters as the variables to be optimized under the geometric constraint that the foot of the perpendicular from the target point to the target line is located on the target line, to obtain the final target point position, target line parameters and corresponding perpendicular intersection point, and output the perpendicular distance from the target point to the target line.

7. A visual measurement system for a point-to-line perpendicular intersection point according to claim 6, characterized in that: The image acquisition and multi-scale analysis module is specifically used for: The original image is decomposed into multiple scales to construct image representations with different spatial resolutions; In at least one intermediate scale layer of the multi-scale image representation, the phase consistency response of the image at each pixel location is calculated based on multi-directional, multi-scale phase consistency analysis. The edge locations in the image are determined based on the phase-consistent response, and non-maximum responses are suppressed to obtain sparse edge features; Simultaneously, based on the local direction information obtained during the phase consistency analysis, the corresponding direction attributes are associated with the edge features, thereby forming primary edge features with direction information.

8. A visual measurement system for a point-to-line perpendicular intersection point according to claim 7, characterized in that: The linear hypothesis generation and target point guidance filtering module is specifically used for: The primary edge features are clustered based on their directional information and spatial proximity to form several edge feature sets; Line fitting is performed on each of the edge feature sets to generate multiple corresponding line hypotheses; Obtain the location information of the target point and calculate the spatial relationship between the target point and each of the assumed straight lines; Each of the proposed straight line assumptions is scored based on the spatial relationship, and at least one is selected as a candidate target straight line based on the scoring results.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.

10. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.