A method and system for visual positioning of a fill

CN122906154APending Publication Date: 2026-10-13HUBEI COULUN AUTOMATION EQUIPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611305574.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0004]为了解决现有技术在复杂光照下边缘伪检、轮廓断裂、离群点干扰以及固定参数拟合稳定性不足的问题,本发明提供了一种灌装视觉定位方法及系统

Benefits of technology

通过构建多尺度多方向的高斯复合算子滤波器,并结合最大响应强度与邻域方向一致性生成梯度结构响应图,配合非极大值抑制和自适应阈值筛选,减少噪声、高光及伪边缘干扰,获得较可靠的结构锚点集。通过基于局部曲率的双向路径搜索与分类,将锚点路径划分为罐体侧边直线段以及罐口、罐底椭圆弧段,提高几何结构识别的准确性。进一步利用正交多项式拟合灰度剖面获取亚像素坐标,并结合综合置信度进行加权拟合和低置信点迭代抑制,可降低离群点对模型参数的影响。通过断点区域的局部路径传播与拓扑修复,改善轮廓残缺情况下的模型拟合稳定性,从而提高灌装视觉定位的精度和鲁棒性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906154A_ABST
    Figure CN122906154A_ABST
Patent Text Reader

Abstract

The application provides a kind of filling visual positioning method and system, the method includes obtaining the original image of the to-be-positioned tank body, constructs multiscale multi-directional Gauss complex operator filter, generates gradient structure response map in combination with pixel maximum response intensity and neighborhood direction consistency;Non-maximum suppression and adaptive threshold screening are carried out on the gradient structure response map, and the structure anchor point set is obtained;Path search and link are carried out on the structure anchor point set, and the tank body side straight line segment and the tank mouth, tank bottom elliptical arc segment are divided according to local curvature;Based on the feature score of each anchor point, select orthogonal polynomial, fit gradient direction gray profile, determine sub-pixel coordinates;Based on sub-pixel coordinates, respectively fit straight line model and elliptical model, calculate comprehensive confidence according to geometric distance, fitting residual and feature score, remove low confidence points and re-fit iteratively;Local path propagation and topological repair are carried out in the model breakpoint area, and the tank body position information is output after the residual converges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of positioning, and in particular relates to a visual positioning method and system for filling. Background Technology

[0002] In modern industrial production and packaging lines, visual positioning of filled products is fundamental to downstream operations such as intelligent grasping, quality inspection, and packing. Existing methods typically extract edge features using machine vision and combine this with geometric fitting to determine the can's position in the image. Cans generally have relatively stable geometric shapes in two-dimensional images; their sides are mostly straight lines, and the can opening and bottom often appear as elliptical arcs under perspective projection. However, the surface of filled products is often made of metal or covered with a reflective film, which easily produces highlights, shadows, and uneven reflections under production line lighting, resulting in significant changes in local contrast. This leads to false edges, missing boundaries, or broken contours during edge extraction.

[0003] In situations with significant edge interference or incomplete contour topology, existing edge tracking and geometric fitting methods often rely on fixed thresholds or static parameters, making it difficult to adaptively handle local curvature, edge trends, and point quality differences. Furthermore, fixed-weight fitting is susceptible to outliers, leading to positioning errors. When the target contour has breaks, the lack of local point filling and topology repair mechanisms also affects the stability of subsequent sub-pixel positioning and geometric model fitting. Therefore, improving the quality of tank edge point extraction under complex lighting and noise interference conditions, and maintaining the stability of geometric model fitting when the contour is broken, are key technical challenges that need to be addressed in visual positioning for filling applications. Summary of the Invention

[0004] To address the problems of edge false detection, contour breakage, outlier interference, and insufficient stability of fixed parameter fitting in existing technologies under complex lighting conditions, this invention provides a filling visual positioning method and system.

[0005] In a first aspect, the present invention provides a filling visual positioning method, comprising the following steps:

[0006] The original image of the tank to be located is obtained. A Gaussian composite operator filter is constructed based on the original image. According to the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, a gradient structure response map is jointly generated. Non-maximum suppression is performed based on the gradient structure response map to obtain pixel-level edges. An adaptive threshold is set to filter out low-determinism points to obtain a set of structural anchor points. The set of structural anchor points is searched and linked, and the set of points is divided into straight line segments on the side of the tank and elliptical arc segments at the mouth and bottom of the tank according to the local curvature. For each anchor point in the straight line segment and elliptical arc segment, an orthogonal polynomial is selected to fit the gray-level profile in the gradient direction of the corresponding anchor point, and the sub-pixel coordinates are solved. Based on all sub-pixel coordinate points, a straight line model and an elliptical model are fitted with weights. The comprehensive confidence is obtained according to the geometric distance from each point to the model and the fitting residual. Low confidence points are iteratively suppressed and the model is refitted with weights. When the suppression process causes the model to break, path propagation is locally re-executed in the break region to repair the topology until the global model residual converges, and the tank position information is obtained.

[0007] Further, the step of constructing a Gaussian composite operator filter based on the original image, and jointly generating a gradient structure response map according to the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, includes: Multiple spatial scales are set for the Gaussian composite operator filter, and first-order Gaussian convolution feature operators in multiple directions are constructed at each spatial scale according to a preset angle step size, and combined to form a filter test array; Two-dimensional convolution operations are performed on each pixel in the original image using the filter test array. The convolution result with the largest absolute value is selected as the maximum response intensity of the corresponding pixel, and the direction angle that generates the maximum response intensity is used as the gradient direction of the corresponding pixel. Based on the angular difference between the gradient direction of adjacent pixels in the neighborhood of each pixel and the gradient direction of the corresponding pixel, a neighborhood direction consistency constraint is constructed, and an initial feature score is calculated based on the maximum response intensity and the neighborhood direction consistency constraint, wherein the angular difference is calculated according to the 180-degree equivalent direction. The initial feature scores are normalized to obtain the feature scores of each pixel, and the gradient structure response map is generated from the feature scores of each pixel.

[0008] Further, the step of performing non-maximum suppression based on the gradient structure response map to obtain pixel-level edges, and setting an adaptive threshold to filter out low-determinism points to obtain a set of structural anchor points, includes: For each pixel in the gradient structure response map, non-maximum suppression is performed along the gradient direction of the corresponding pixel, retaining the pixels that satisfy the local maximum condition in the gradient direction and suppressing the pixels that do not satisfy the local maximum condition. An adaptive threshold is constructed based on the feature score distribution of the retained pixels after nonmaximum suppression. Pixels with feature scores lower than the adaptive threshold are removed, and pixels with feature scores not lower than the adaptive threshold are combined to form the structural anchor set.

[0009] Further, the step of performing path search and linking on the set of structural anchor points, and dividing the set of points into straight line segments on the sides of the tank and elliptical arc segments at the tank opening and bottom based on local curvature, includes: The anchor points in the set of structural anchor points are sorted according to their feature scores, and the anchor points that meet the preset score conditions are selected as seed points. A neighborhood search is performed along the gradient orthogonal direction of the seed point, and the candidate anchor point is determined to satisfy the path expansion condition based on the spatial distance between the candidate anchor point and the current path endpoint and the angle between the gradient orthogonal direction of the candidate anchor point and the current search direction. Link candidate anchor points that meet the path extension conditions to the current path to extend the edge path; The local curvature is calculated based on the coordinates of adjacent anchor points in the linked path. Based on the magnitude and variance of the local curvature, the corresponding set of anchor points is divided into straight line segments on the side of the tank or elliptical arc segments at the tank opening and bottom.

[0010] Further, for each anchor point in the straight line segment and elliptical arc segment, selecting an orthogonal polynomial to fit the grayscale profile along the gradient direction of the corresponding anchor point, and solving for the sub-pixel coordinates, includes: Obtain the feature score of the current pixel on the line segment and the elliptical arc segment. If the feature score is not less than the preset score threshold, then select an orthogonal polynomial with the highest order of 4 as the fitting function model. If the feature score is less than the preset score threshold, then an orthogonal polynomial with the highest order of 3 is selected as the fitting function model. A line segment with a length of 9 pixels is cut along the gradient direction of the current pixel, the gray value of each point on the line segment is obtained, and the gray value is substituted into the selected orthogonal polynomial to perform gray-scale profile fitting to obtain a one-dimensional fitting function. The first derivative of the one-dimensional fitting function is calculated, and the candidate position with the largest absolute value of the first derivative is determined within the range of the line segment. Based on the candidate position and the gradient direction of the current pixel, the candidate position is converted into the sub-pixel coordinates of the pixel.

[0011] Furthermore, the step of weighted fitting of a linear model and an elliptical model based on all sub-pixel coordinate points, obtaining a comprehensive confidence level based on the geometric distance of each point to the model and the fitting residual, iteratively suppressing low-confidence points and re-weighting and fitting the model includes: The weighted least squares method is used to fit the linear equations to the sub-pixel coordinates of each set of line segments to obtain the corresponding line model. The weighted algebraic least squares method is used to fit the quadratic curve equation to the sub-pixel coordinate points in each elliptical arc segment set to obtain the corresponding elliptical model. The elliptical model includes the ellipse center, major and minor axis parameters, and rotation angle parameters. Calculate the orthogonal geometric distance from each subpixel coordinate point to the model corresponding to the coordinate point. After normalizing the orthogonal geometric distance and the fitting residual, convert the normalization error into a geometric consistency score and combine it with the feature score of the point to calculate the comprehensive confidence score. Based on the overall confidence level, low-confidence sub-pixel coordinate points are filtered out, and the remaining sub-pixel coordinate points after filtering are used to refit the linear model and elliptical model until the overall residuals meet the preset convergence conditions, thus completing the iterative suppression of low-confidence points.

[0012] Furthermore, when the suppression process causes a breakpoint in the model, the path propagation is locally re-executed within the breakpoint region to repair the topology until the global model residual converges, obtaining the tank location information, including: The Euclidean distance between adjacent sub-pixel coordinates belonging to the same straight line segment or the same elliptical arc segment in the updated fitted set is detected. If the Euclidean distance is greater than 4 pixels, it is determined that there is a topological breakpoint in the region, and the sub-pixel coordinates at both ends of the breakpoint are used as local seed points. Relax the search constraints by increasing the angle threshold between the gradient orthogonal direction and the current search direction to 30 degrees, and re-execute the neighborhood search within the breakpoint region to supplement the missed anchor points; The supplemented anchor points are linked to repair the topological breakpoints, and the grayscale profile is truncated along the gradient direction of the supplemented anchor points for orthogonal polynomial fitting. After determining the corresponding sub-pixel coordinates, they are added to the fitting set. Calculate the residual mean square error of the geometric distance from all sub-pixel coordinate points to the corresponding model after repair and refitting. When the residual mean square error is less than a preset threshold, it is determined that the global model residual has converged, the iterative calculation is stopped, and the converged linear model and elliptical model parameters are output. Based on the linear model and elliptical model parameters, the tank position information is obtained and output.

[0013] Secondly, the present invention also provides a filling visual positioning system, comprising the following modules: The execution module is used to acquire the original image of the tank to be located, construct a Gaussian composite operator filter based on the original image, jointly generate a gradient structure response map based on the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, perform non-maximum suppression based on the gradient structure response map to obtain pixel-level edges, and set an adaptive threshold to filter out low-determinism points to obtain a set of structural anchor points. The partitioning module is used to perform path search and linking on the set of structural anchor points, and to divide the set of points into straight line segments on the side of the tank body and elliptical arc segments at the tank opening and bottom according to the local curvature. The iterative module is used to select an orthogonal polynomial to fit the grayscale profile of the gradient direction of each anchor point in the straight line segment and elliptical arc segment, solve the sub-pixel coordinates, and weight-fit the straight line model and elliptical model based on all sub-pixel coordinate points. The comprehensive confidence is obtained according to the geometric distance from each point to the model and the fitting residual. The module iteratively suppresses low confidence points and re-weights and fits the model. When the suppression process causes the model to breakpoint, the path propagation is locally re-executed in the breakpoint region to repair the topology until the global model residual converges, and the tank position information is obtained.

[0014] Preferably, the step of constructing a Gaussian composite operator filter based on the original image, and jointly generating a gradient structure response map according to the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, includes: Multiple spatial scales are set for the Gaussian composite operator filter, and first-order Gaussian convolution feature operators in multiple directions are constructed at each spatial scale according to a preset angle step size, and combined to form a filter test array; Two-dimensional convolution operations are performed on each pixel in the original image using the filter test array. The convolution result with the largest absolute value is selected as the maximum response intensity of the corresponding pixel, and the direction angle that generates the maximum response intensity is used as the gradient direction of the corresponding pixel. Based on the angular difference between the gradient direction of adjacent pixels in the neighborhood of each pixel and the gradient direction of the corresponding pixel, a neighborhood direction consistency constraint is constructed, and an initial feature score is calculated based on the maximum response intensity and the neighborhood direction consistency constraint, wherein the angular difference is calculated according to the 180-degree equivalent direction. The initial feature scores are normalized to obtain the feature scores of each pixel, and the gradient structure response map is generated from the feature scores of each pixel.

[0015] Preferably, the step of performing non-maximum suppression based on the gradient structure response map to obtain pixel-level edges, and setting an adaptive threshold to filter out low-determinism points to obtain a set of structural anchor points, includes: For each pixel in the gradient structure response map, non-maximum suppression is performed along the gradient direction of the corresponding pixel, retaining the pixels that satisfy the local maximum condition in the gradient direction and suppressing the pixels that do not satisfy the local maximum condition. An adaptive threshold is constructed based on the feature score distribution of the retained pixels after nonmaximum suppression. Pixels with feature scores lower than the adaptive threshold are removed, and pixels with feature scores not lower than the adaptive threshold are combined to form the structural anchor set.

[0016] Preferably, the step of performing path search and linking on the set of structural anchor points, and dividing the set of points into straight line segments on the side of the tank and elliptical arc segments at the tank opening and bottom based on local curvature, includes: The anchor points in the set of structural anchor points are sorted according to their feature scores, and the anchor points that meet the preset score conditions are selected as seed points. A neighborhood search is performed along the gradient orthogonal direction of the seed point, and the candidate anchor point is determined to satisfy the path expansion condition based on the spatial distance between the candidate anchor point and the current path endpoint and the angle between the gradient orthogonal direction of the candidate anchor point and the current search direction. Link candidate anchor points that meet the path extension conditions to the current path to extend the edge path; The local curvature is calculated based on the coordinates of adjacent anchor points in the linked path. Based on the magnitude and variance of the local curvature, the corresponding set of anchor points is divided into straight line segments on the side of the tank or elliptical arc segments at the tank opening and bottom.

[0017] Preferably, the step of selecting an orthogonal polynomial to fit the grayscale profile along the gradient direction of each anchor point in the straight line segment and elliptical arc segment, and solving for the sub-pixel coordinates, includes: Obtain the feature score of the current pixel on the line segment and the elliptical arc segment. If the feature score is not less than the preset score threshold, then select an orthogonal polynomial with the highest order of 4 as the fitting function model. If the feature score is less than the preset score threshold, then an orthogonal polynomial with the highest order of 3 is selected as the fitting function model. A line segment with a length of 9 pixels is cut along the gradient direction of the current pixel, the gray value of each point on the line segment is obtained, and the gray value is substituted into the selected orthogonal polynomial to perform gray-scale profile fitting to obtain a one-dimensional fitting function. The first derivative of the one-dimensional fitting function is calculated, and the candidate position with the largest absolute value of the first derivative is determined within the range of the line segment. Based on the candidate position and the gradient direction of the current pixel, the candidate position is converted into the sub-pixel coordinates of the pixel.

[0018] Preferably, the step of weighted fitting of a linear model and an elliptical model based on all sub-pixel coordinate points, obtaining a comprehensive confidence level based on the geometric distance of each point to the model and the fitting residual, iteratively suppressing low-confidence points and reweighting the model fitting includes: The weighted least squares method is used to fit the linear equations to the sub-pixel coordinates of each set of line segments to obtain the corresponding line model. The weighted algebraic least squares method is used to fit the quadratic curve equation to the sub-pixel coordinate points in each elliptical arc segment set to obtain the corresponding elliptical model. The elliptical model includes the ellipse center, major and minor axis parameters, and rotation angle parameters. Calculate the orthogonal geometric distance from each subpixel coordinate point to the model corresponding to the coordinate point. After normalizing the orthogonal geometric distance and the fitting residual, convert the normalization error into a geometric consistency score and combine it with the feature score of the point to calculate the comprehensive confidence score. Based on the overall confidence level, low-confidence sub-pixel coordinate points are filtered out, and the remaining sub-pixel coordinate points after filtering are used to refit the linear model and elliptical model until the overall residuals meet the preset convergence conditions, thus completing the iterative suppression of low-confidence points.

[0019] Preferably, when the suppression process causes a breakpoint in the model, the path propagation is locally re-executed within the breakpoint region to repair the topology until the global model residual converges, thus obtaining the tank location information, including: The Euclidean distance between adjacent sub-pixel coordinates belonging to the same straight line segment or the same elliptical arc segment in the updated fitted set is detected. If the Euclidean distance is greater than 4 pixels, it is determined that there is a topological breakpoint in the region, and the sub-pixel coordinates at both ends of the breakpoint are used as local seed points. Relax the search constraints by increasing the angle threshold between the gradient orthogonal direction and the current search direction to 30 degrees, and re-execute the neighborhood search within the breakpoint region to supplement the missed anchor points; The supplemented anchor points are linked to repair the topological breakpoints, and the grayscale profile is truncated along the gradient direction of the supplemented anchor points for orthogonal polynomial fitting. After determining the corresponding sub-pixel coordinates, they are added to the fitting set. Calculate the residual mean square error of the geometric distance from all sub-pixel coordinate points to the corresponding model after repair and refitting. When the residual mean square error is less than a preset threshold, it is determined that the global model residual has converged, the iterative calculation is stopped, and the converged linear model and elliptical model parameters are output. Based on the linear model and elliptical model parameters, the tank position information is obtained and output.

[0020] The present invention has the following advantages: By constructing a multi-scale, multi-directional Gaussian composite operator filter and combining the maximum response intensity with neighborhood direction consistency to generate a gradient structure response map, coupled with non-maximum suppression and adaptive threshold screening, noise, specular highlights, and false edge interference are reduced, resulting in a more reliable set of structural anchor points. Through bidirectional path search and classification based on local curvature, the anchor point path is divided into straight segments on the tank side and elliptical arc segments at the tank opening and bottom, improving the accuracy of geometric structure recognition. Furthermore, orthogonal polynomial fitting of grayscale profiles is used to obtain sub-pixel coordinates, and weighted fitting and low-confidence point iterative suppression are performed using comprehensive confidence scores, reducing the impact of outliers on model parameters. Local path propagation and topology repair in breakpoint regions improve the model fitting stability under incomplete contour conditions, thereby enhancing the accuracy and robustness of visual positioning for filling. Attached Figure Description

[0021] Figure 1 A flowchart of a filling visual positioning method; Figure 2 A schematic diagram of a multi-scale, multi-directional Gaussian composite operator filter; Figure 3 This is a schematic diagram of curvature path classification. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0023] This invention proposes a visual positioning method for filling, such as... Figure 1 As shown, it includes the following steps: S1. Obtain the original image of the tank to be located. Construct a Gaussian composite operator filter based on the original image. Generate a gradient structure response map by combining the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel. Perform non-maximum suppression based on the gradient structure response map to obtain pixel-level edges. Set an adaptive threshold to filter out low-determinism points to obtain a set of structural anchor points.

[0024] The original digital image of the tank to be positioned is acquired by an industrial camera, the image is converted into a single-channel grayscale image, and median filtering is performed to reduce sensor noise.

[0025] A multi-scale, multi-directional Gaussian composite operator filter is constructed based on grayscale images. The construction process is as follows: A two-dimensional Gaussian function is subjected to first-order derivative operations along multiple preset directions at different scale factors, generating multiple sets of directional derivative templates. The grayscale image is convolved with all directional derivative templates, and the maximum absolute value of the convolution among all directional templates is taken as the maximum response intensity at that point. Simultaneously, the template direction corresponding to the maximum response intensity is recorded as the gradient direction at that point. A schematic diagram of the multi-scale, multi-directional Gaussian composite operator filter is shown below. Figure 2 As shown.

[0026] A local square neighborhood window is established centered on the pixel. The gradient directions of adjacent pixels within the window are extracted. The angular difference between the gradient directions of each adjacent pixel and the gradient direction of the current pixel is calculated. The angular difference is calculated according to the 180-degree equivalent direction, i.e., the smaller value between the two angular differences and the complementary difference of 180 degrees is taken. The angular differences corresponding to each adjacent pixel are converted into dimensionless angular deviation values ​​according to a preset angle unit and then summed to obtain the sum of the absolute angular deviation values ​​of the neighborhood. The sum of the absolute angular deviation values ​​of the neighborhood is added to a preset penalty constant to obtain the direction consistency penalty factor. The maximum response intensity of each pixel is divided by the corresponding direction consistency penalty factor to obtain the initial feature score. The initial feature score is then normalized to obtain the feature score of the pixel. The gradient structure response map of the whole image is generated from the feature scores of each pixel, where the value of each pixel in the gradient structure response map is the feature score of the corresponding pixel.

[0027] On the gradient structure response map, non-maximum suppression is performed on each pixel along its gradient direction. This involves comparing the feature scores of the pixel with its two adjacent pixels on opposite sides of the gradient direction. If the pixel's feature score is not the maximum, it is set to zero; otherwise, it is retained, extracting pixel-level edges with a single pixel width. The feature score distribution of all non-zero pixels on the pixel-level edge is statistically analyzed, and the mean and standard deviation are calculated. An adaptive threshold is obtained by combining the mean and standard deviation according to a preset ratio. Low-determinism points with feature scores below this threshold are filtered out, and the remaining set of non-zero pixels forms the structural anchor point set.

[0028] As an optional implementation, the step of constructing a Gaussian composite operator filter based on the original image, and jointly generating a gradient structure response map according to the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, includes: Multiple spatial scales are set for the Gaussian composite operator filter, and first-order Gaussian convolution feature operators in multiple directions are constructed at each spatial scale according to a preset angle step size, and combined to form a filter test array; Two-dimensional convolution operations are performed on each pixel in the original image using the filter test array. The convolution result with the largest absolute value is selected as the maximum response intensity of the corresponding pixel, and the direction angle that generates the maximum response intensity is used as the gradient direction of the corresponding pixel. Based on the angular difference between the gradient direction of adjacent pixels in the neighborhood of each pixel and the gradient direction of the corresponding pixel, a neighborhood direction consistency constraint is constructed, and an initial feature score is calculated based on the maximum response intensity and the neighborhood direction consistency constraint, wherein the angular difference is calculated according to the 180-degree equivalent direction. The initial feature scores are normalized to obtain the feature scores of each pixel, and the gradient structure response map is generated from the feature scores of each pixel.

[0029] Taking a 5×5 pixel scale as an example, a basic filter template is generated according to the first-order Gaussian derivative formula. Then, with a directional step size of 22.5 degrees, the basic filter template is rotated to 0°, 22.5°, 45°…337.5° in 16 directions, resulting in 16 directional filter templates for this scale. Directional filter templates for 3×3 pixel and 7×7 pixel scales are generated in the same way, and finally combined to form a filter test array containing 48 filter templates.

[0030] For each pixel in the original image, its convolution response under the first-order Gaussian derivative filter template in multiple directions is calculated. The direction angle corresponding to the convolution response with the largest absolute value is recorded as the gradient direction of that pixel. Taking pixel I (100, 100) in the original image as an example, the maximum convolution response value of 215 is obtained by two-dimensional convolution calculation at a scale of 5×5 and a direction angle of 67.5°.

[0031] Extract the gradient directions of the 8 neighboring pixels within a 3×3 neighborhood of the current pixel. Let the gradient direction of the center pixel be 67.5°, and the gradient direction of the i-th neighboring pixel be... Calculate the angular difference between the i-th adjacent pixel and the center pixel. First, take the remainder of the absolute difference between the two direction angles along a 180° cycle to obtain the intermediate difference. , and then This is to treat directions that are 180° apart as equivalent directions.

[0032] The angular difference between 8 adjacent pixels Summing yields the sum of absolute angular differences in the neighborhood. For example, if the angular differences for 8 adjacent pixels are 2°, 3°, 4°, 2°, 5°, 3°, 4°, and 2° respectively, converting each angular difference to a dimensionless angular deviation value in degrees and summing them gives a sum of absolute angular deviation values ​​in the neighborhood of 25. Setting the preset penalty constant to 10, adding 25 to 10 gives a dimensionless penalty factor of 35. Therefore, dividing the maximum response intensity of this pixel, 215, by the penalty factor 35 yields an initial feature score of approximately 6.14.

[0033] The maximum-minimum normalization method is adopted. For example, the value of the global feature score in the extreme value range [0, 15.2] is normalized to the range [0, 1], and the feature score of the point is 0.40. The same processing logic is repeated for all pixels in the image to construct a two-dimensional floating-point gradient structure response map matrix with the same size as the original image.

[0034] As an optional implementation, the step of performing non-maximum suppression based on the gradient structure response map to obtain pixel-level edges, and setting an adaptive threshold to filter out low-determinism points to obtain a set of structure anchor points includes: For each pixel in the gradient structure response map, non-maximum suppression is performed along the gradient direction of the corresponding pixel, retaining the pixels that satisfy the local maximum condition in the gradient direction and suppressing the pixels that do not satisfy the local maximum condition. An adaptive threshold is constructed based on the feature score distribution of the retained pixels after nonmaximum suppression. Pixels with feature scores lower than the adaptive threshold are removed, and pixels with feature scores not lower than the adaptive threshold are combined to form the structural anchor set.

[0035] For a pixel at coordinates (50, 50) in the gradient structure response map, when the maximum response gradient direction of the pixel is 45 degrees and the feature score is 0.82, an adjacent position is selected along the gradient direction of the pixel and its opposite direction, and the feature scores of the pixel and the two adjacent positions are compared. If the extracted positive adjacent point (51, 51) has a score of 0.65 and the negative adjacent point (49, 49) has a score of 0.71, since 0.82 is greater than both, the center point is retained; otherwise, if the score of the center point is not greater than that of the two adjacent points, the feature score is set to zero.

[0036] After the non-maximum suppression calculation for the entire image is completed, all valid non-zero pixels retained globally are counted, and the mean feature score of these pixels is calculated to be 0.45, with a standard deviation of 0.20. Based on this, the mean and half of the standard deviation are added together, and an adaptive threshold of 0.55 is set. The aforementioned retained points are then iterated through, and all pixels with feature scores below 0.55 are removed. The coordinate values ​​of the remaining pixels that meet the requirements are combined to form a set of structural anchor points.

[0037] S2, perform path search and linking on the set of structural anchor points, and divide the set of points into straight line segments on the side of the tank and elliptical arc segments at the tank opening and bottom according to the local curvature.

[0038] All points in the structural anchor point set are sorted in descending order of feature score. The unprocessed anchor point with the highest feature score is selected as the initial seed point. The gradient direction of this seed point is obtained, and it is rotated 90 degrees clockwise to obtain the orthogonal direction, which serves as the initial propagation direction for bidirectional path search. In both positive and negative directions, a search is performed on neighboring anchor points within a 3×3 neighborhood. The angle between the orthogonal gradient direction of the candidate neighboring anchor point and the current propagation direction is calculated. If the angle is less than a preset angle deviation threshold, such as 15°, the neighboring point is linked to the current seed point, and this neighboring point is used as the new current point to continue the search until no neighboring point meets the condition, thus completing the extraction of a single edge contour. During propagation, the first derivative is calculated using the five nearest points on the linked path. The current local curvature is calculated based on the local fitting curve of the linked path, and the propagation direction for the next search is updated using the tangent direction of the local fitting curve.

[0039] For a complete edge contour extracted, the global average curvature and curvature variance of the contour are calculated. When the global average curvature is less than a minimum set value and the curvature variance is lower than the lower limit of fluctuation, it indicates that the contour is close to a straight line, and the point set of the contour is divided into straight line segments of the tank side. When the global average curvature is greater than a minimum set value and the curvature variance is within the preset upper and lower limits of fluctuation, it indicates that the contour has arc characteristics, and the point set of the contour is divided into elliptical arc segments of the tank opening and tank bottom.

[0040] Repeat the seed point selection and path propagation process for all structural anchor points until all anchor points have been processed or classified. Figure 3 As shown, this figure is a schematic diagram of the tank outline point set after path linking and curvature classification. The figure includes the elliptical arc of the tank opening, the elliptical arc of the tank bottom, and the straight line segment of the tank side.

[0041] As an optional implementation, the step of performing path search and linking on the set of structural anchor points, and dividing the set of points into straight line segments along the sides of the tank and elliptical arc segments at the tank opening and bottom based on local curvature, includes: The anchor points in the set of structural anchor points are sorted according to their feature scores, and the anchor points that meet the preset score conditions are selected as seed points. A neighborhood search is performed along the gradient orthogonal direction of the seed point, and the candidate anchor point is determined to satisfy the path expansion condition based on the spatial distance between the candidate anchor point and the current path endpoint and the angle between the gradient orthogonal direction of the candidate anchor point and the current search direction. Link candidate anchor points that meet the path extension conditions to the current path to extend the edge path; The local curvature is calculated based on the coordinates of adjacent anchor points in the linked path. Based on the magnitude and variance of the local curvature, the corresponding set of anchor points is divided into straight line segments on the side of the tank or elliptical arc segments at the tank opening and bottom.

[0042] Sort all points in the structural anchor set in descending order of feature score. Select P0 (100, 200), a coordinate point with a score of 0.95, as the initial seed point. The gradient direction of this point is 0 degrees, so the orthogonal direction of 90 degrees is set as the search direction. Perform a bidirectional search with the condition that the Euclidean distance is no greater than 2 pixels and the angular deviation from the current propagation path is no greater than 15 degrees. For example, in the orthogonal search, find a point P1 (100, 201) that is 1 pixel away. The angle between the orthogonal gradient direction of this point and the current search direction is 2 degrees. If the condition is met, include it in the linked path and continue to propagate forward.

[0043] During the propagation process, the coordinates of three consecutive anchor points are read simultaneously, and the radius of the circumcircle of these coordinates is calculated using the curvature formula. If the consecutive anchor points are approximately collinear, the radius of the corresponding circumcircle tends to infinity, and the reciprocal of the radius, i.e., the local curvature, approaches zero, satisfying the criterion of less than 0.05. In this case, the curvature of the path is determined to be close to zero, and the corresponding set of anchor points is divided into straight segments on the side of the tank. Conversely, if the extracted data is a sequence of tank opening boundary points such as (150, 80), and the calculated curvature is 0.12, and the variance of curvature on this path segment is less than a preset variance threshold, then the path segment is determined to be a part where the curvature varies within a preset fluctuation range and is divided into elliptical arc segments of the tank bottom or tank opening. The preset variance threshold is determined based on the statistical results of the local curvature variance of similar elliptical arc segments in historical qualified tank images, preferably the sum of the mean of the local curvature variance and twice the standard deviation.

[0044] S3. For each anchor point in the straight line segment and elliptical arc segment, select an orthogonal polynomial to fit the gray-level profile in the gradient direction of the corresponding anchor point, solve the sub-pixel coordinates, and weight-fit the straight line model and elliptical model based on all sub-pixel coordinate points. Obtain the comprehensive confidence level according to the geometric distance from each point to the model and the fitting residual. Iteratively suppress low confidence points and re-weight-fit the model. When the suppression process causes the model to break off, locally re-execute path propagation in the breakoff region to repair the topology until the global model residual converges, and obtain the tank position information.

[0045] For each integer pixel anchor point on the line segment and elliptical arc segment obtained from the classification, four pixels before and after the anchor point are extracted along the gradient direction of the anchor point, forming a one-dimensional grayscale profile with a length of nine pixels. Bilinear interpolation is used to obtain the grayscale values ​​at non-integer coordinates. The feature score of the integer pixel anchor point is used as a weighting coefficient, and an orthogonal Legendre polynomial of the corresponding order is selected based on the feature score to construct a continuous one-dimensional grayscale distribution function model.

[0046] The extracted grayscale profile data is fitted using the weighted least squares method to obtain the polynomial coefficients. The first derivative of the obtained grayscale distribution function model is then calculated. Within the sampling range of the one-dimensional grayscale profile, a candidate position with the largest absolute value of the first derivative is searched. The candidate position is then mapped back to the two-dimensional image coordinate system to obtain the sub-pixel coordinates of the point that reaches the maximum grayscale change rate along the gradient direction.

[0047] Using the sub-pixel coordinates on each extracted line segment, weighted least squares line fitting is performed with the feature score as the initial weight to obtain the line equations corresponding to each side. Similarly, weighted algebraic least squares elliptic fitting is performed on the sub-pixel coordinates on each elliptical arc segment to obtain the ellipse center, major and minor axis parameters, and rotation angle parameters of the corresponding can opening or can bottom.

[0048] Calculate the shortest Euclidean geometric distance from each subpixel coordinate point to the corresponding fitted line or fitted ellipse, and determine the geometric consistency score based on the geometric distance and the overall model fitting residual. Then, combine the geometric consistency score with the feature score of the corresponding point to obtain the overall confidence score of that point. Remove outliers with an overall confidence score lower than the confidence threshold, update the weights using the overall confidence scores of the remaining points, and re-fit the weighted data. Repeat this iterative suppression process.

[0049] After removing outliers in each iteration, the distance between adjacent points in the remaining point set is checked. If a region exists where the distance is greater than a set connectivity threshold, it is considered a breakpoint. In this case, within the local region between the two endpoints of the breakpoint, the angular deviation threshold between the gradient orthogonal direction and the current search direction is relaxed, and the search neighborhood is expanded to 5×5. The bidirectional path search is then re-executed to connect new structural anchor points and calculate sub-pixel coordinates to be added to the model to repair the topology.

[0050] Repeat the iterative suppression and breakpoint repair process described above, and use the global residual satisfying the preset convergence condition as the basis for stopping the overall iteration. Output the converged line equation parameters, as well as the ellipse center coordinates, axis length, and rotation angle parameters, and combine them to form high-precision tank image position information.

[0051] As an optional implementation, the step of selecting an orthogonal polynomial to fit the grayscale profile along the gradient direction of each anchor point in the straight line segment and elliptical arc segment, and solving for the sub-pixel coordinates, includes: Obtain the feature score of the current pixel on the line segment and the elliptical arc segment. If the feature score is not less than the preset score threshold, then select an orthogonal polynomial with the highest order of 4 as the fitting function model. If the feature score is less than the preset score threshold, then an orthogonal polynomial with the highest order of 3 is selected as the fitting function model. A line segment with a length of 9 pixels is cut along the gradient direction of the current pixel, the gray value of each point on the line segment is obtained, and the gray value is substituted into the selected orthogonal polynomial to perform gray-scale profile fitting to obtain a one-dimensional fitting function. The first derivative of the one-dimensional fitting function is calculated, and the candidate position with the largest absolute value of the first derivative is determined within the range of the line segment. Based on the candidate position and the gradient direction of the current pixel, the candidate position is converted into the sub-pixel coordinates of the pixel.

[0052] For the anchor point (120, 100) that is divided into a straight line segment or an elliptical arc segment and has a score of 0.85, since the score is not less than 0.8, an orthogonal polynomial with the highest order of 4 is selected as the fitting function model. If the score is less than 0.6, a model with the highest order of 3 is selected.

[0053] Centered on the anchor point, four pixels are symmetrically extracted outwards along the corresponding gradient direction line to form a profile line segment composed of nine evenly spaced sampling points. The grayscale sequence of nine pixels [45, 48, 55, 90, 140, 180, 200, 205, 208] distributed in the local relative coordinate range [-4, 4] on the profile is obtained. The coordinate sequence and grayscale values ​​are substituted into a fourth-order orthogonal polynomial, and curve fitting is performed to obtain a one-dimensional fitting function.

[0054] The first derivative of the one-dimensional fitted function is calculated, and the candidate position with the largest absolute value of the first derivative is searched within the local relative coordinate range [-4, 4]. For example, the offset relative to the origin center is calculated to be t = -0.32. The offset is then converted to the original two-dimensional grid system using the original pixel coordinate system of this point to obtain the high-precision sub-pixel coordinates of this point (119.68, 100.00).

[0055] As an optional implementation, the method of weighted fitting of a linear model and an elliptical model based on all sub-pixel coordinate points, obtaining a comprehensive confidence level based on the geometric distance of each point to the model and the fitting residual, iteratively suppressing low-confidence points and re-weighting the model fitting, includes: The weighted least squares method is used to fit the linear equations to the sub-pixel coordinates of each set of line segments to obtain the corresponding line model. The weighted algebraic least squares method is used to fit the quadratic curve equation to the sub-pixel coordinate points in each elliptical arc segment set to obtain the corresponding elliptical model. The elliptical model includes the ellipse center, major and minor axis parameters, and rotation angle parameters. Calculate the orthogonal geometric distance from each subpixel coordinate point to the model corresponding to the coordinate point. After normalizing the orthogonal geometric distance and the fitting residual, convert the normalization error into a geometric consistency score and combine it with the feature score of the point to calculate the comprehensive confidence score. Based on the overall confidence level, low-confidence sub-pixel coordinate points are filtered out, and the remaining sub-pixel coordinate points after filtering are used to refit the linear model and elliptical model until the overall residuals meet the preset convergence conditions, thus completing the iterative suppression of low-confidence points.

[0056] After extracting the coordinates of 150 sub-pixel points on the side of the tank, a weight matrix is ​​constructed with the feature scores of all sub-pixel points in the set as the main diagonal elements. A weighted least squares method is used to obtain a side straight line model with equation coefficients x + 0.05y - 120.5 = 0. For the other side straight line segment, a separate side straight line model is obtained using the same method. Similarly, for the elliptical arc segments at the tank opening and bottom, the weighted algebraic least squares algorithm is applied to obtain the corresponding elliptical models, yielding the corresponding ellipse center, major and minor axis parameters, and rotation angle parameters.

[0057] For each of the 150 points, the orthogonal geometric distance from point (119.8, 100.2) to the established straight-line model is calculated as 0.23 pixels. The corresponding fitting residual is then calculated. The orthogonal geometric distance and fitting residual of all points are subjected to max-min normalization to obtain the normalized geometric distance error and normalized fitting residual error for the corresponding points. The normalized geometric distance error and normalized fitting residual error are then weighted and summed according to preset weights to obtain the normalized comprehensive error. This normalized comprehensive error is then subtracted from 1 to obtain the geometric consistency score. For example, when the normalized geometric distance error of a point is 0.10, the normalized fitting residual error is 0.20, and both weights are 0.5, the normalized comprehensive error is 0.15, and the geometric consistency score is 0.85.

[0058] The geometric consistency score is weighted at 50% each, and the feature score of 0.82 at that point is averaged to obtain a comprehensive confidence level of 0.835.

[0059] Based on the judgment threshold, since 0.835 is not lower than 0.6, the point is retained; while points with a comprehensive confidence level of only 0.42 are removed. The remaining 149 sub-pixel coordinate points are used to re-apply weighted least squares and weighted algebraic least squares to update the parameters of the linear and elliptical models, and the model parameter update and optimization are completed when the overall residuals meet the preset convergence conditions.

[0060] As an optional implementation, when the suppression process causes a breakpoint in the model, the path propagation is locally re-executed within the breakpoint region to repair the topology until the global model residual converges, obtaining the tank location information, including: The Euclidean distance between adjacent sub-pixel coordinates belonging to the same straight line segment or the same elliptical arc segment in the updated fitted set is detected. If the Euclidean distance is greater than 4 pixels, it is determined that there is a topological breakpoint in the region, and the sub-pixel coordinates at both ends of the breakpoint are used as local seed points. Relax the search constraints by increasing the angle threshold between the gradient orthogonal direction and the current search direction to 30 degrees, and re-execute the neighborhood search within the breakpoint region to supplement the missed anchor points; The supplemented anchor points are linked to repair the topological breakpoints, and the grayscale profile is truncated along the gradient direction of the supplemented anchor points for orthogonal polynomial fitting. After determining the corresponding sub-pixel coordinates, they are added to the fitting set. Calculate the residual mean square error of the geometric distance from all sub-pixel coordinate points to the corresponding model after repair and refitting. When the residual mean square error is less than a preset threshold, it is determined that the global model residual has converged, the iterative calculation is stopped, and the converged linear model and elliptical model parameters are output. Based on the linear model and elliptical model parameters, the tank position information is obtained and output.

[0061] The updated fitted set detects adjacent sub-pixel coordinates belonging to the same straight line segment or elliptical arc segment. If a topological breakpoint is detected in the region, such as the Euclidean distance between points A (180.2, 75.6) and B (185.5, 78.9) reaching 6.22 pixels, which is greater than the set condition of 4 pixels, then the region is determined to have a topological breakpoint. Using points A and B at both ends of the breakpoint as local seed points, the search constraints are relaxed, and the angle threshold between the orthogonal gradient direction and the current search direction is increased to 30 degrees. Neighborhood search is re-performed within the breakpoint region to supplement missing relay anchor points such as (182.8, 77.1). The supplemented anchor points are linked to repair the topological breakpoint, and a grayscale profile is extracted along the gradient direction of the supplemented anchor points for orthogonal polynomial fitting. After determining the corresponding sub-pixel coordinates, they are added to the fitted set.

[0062] After repairing and refitting the model, the residual mean square error of the geometric distance error from all edge sampling points to the corresponding model is calculated. When the residual mean square error decreases from 0.015 to 0.0008, satisfying the judgment baseline of less than 0.001, the global model residual is considered to have converged, and the iterative calculation is stopped. The converged linear model and elliptical model parameters are output, where the elliptical model parameters include the ellipse center, major and minor axis parameters, and rotation angle parameters. Based on the linear model and elliptical model parameters, the image position information of the tank to be located is obtained and output.

[0063] This invention also proposes a filling visual positioning system, comprising the following modules: The execution module is used to acquire the original image of the tank to be located, construct a Gaussian composite operator filter based on the original image, jointly generate a gradient structure response map based on the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, perform non-maximum suppression based on the gradient structure response map to obtain pixel-level edges, and set an adaptive threshold to filter out low-determinism points to obtain a set of structural anchor points. The partitioning module is used to perform path search and linking on the set of structural anchor points, and to divide the set of points into straight line segments on the side of the tank body and elliptical arc segments at the tank opening and bottom according to the local curvature. The iterative module is used to select an orthogonal polynomial to fit the grayscale profile of the gradient direction of each anchor point in the straight line segment and elliptical arc segment, solve the sub-pixel coordinates, and weight-fit the straight line model and elliptical model based on all sub-pixel coordinate points. The comprehensive confidence is obtained according to the geometric distance from each point to the model and the fitting residual. The module iteratively suppresses low confidence points and re-weights and fits the model. When the suppression process causes the model to breakpoint, the path propagation is locally re-executed in the breakpoint region to repair the topology until the global model residual converges, and the tank position information is obtained.

[0064] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A visual positioning method for filling, characterized in that, Includes the following steps: The original image of the tank to be located is obtained. A Gaussian composite operator filter is constructed based on the original image. According to the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, a gradient structure response map is jointly generated. Non-maximum suppression is performed based on the gradient structure response map to obtain pixel-level edges. An adaptive threshold is set to filter out low-determinism points to obtain a set of structural anchor points. The set of structural anchor points is searched and linked, and the set of points is divided into straight line segments on the side of the tank and elliptical arc segments at the mouth and bottom of the tank according to the local curvature. For each anchor point in the straight line segment and elliptical arc segment, an orthogonal polynomial is selected to fit the gray-level profile in the gradient direction of the corresponding anchor point, and the sub-pixel coordinates are solved. Based on all sub-pixel coordinate points, a straight line model and an elliptical model are fitted with weights. The comprehensive confidence is obtained according to the geometric distance from each point to the model and the fitting residual. Low confidence points are iteratively suppressed and the model is refitted with weights. When the suppression process causes the model to break, path propagation is locally re-executed in the break region to repair the topology until the global model residual converges, and the tank position information is obtained.

2. The method according to claim 1, characterized in that, The step of constructing a Gaussian composite operator filter based on the original image, and jointly generating a gradient structure response map based on the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, includes: Multiple spatial scales are set for the Gaussian composite operator filter, and first-order Gaussian convolution feature operators in multiple directions are constructed at each spatial scale according to a preset angle step size, and combined to form a filter test array; Two-dimensional convolution operations are performed on each pixel in the original image using the filter test array. The convolution result with the largest absolute value is selected as the maximum response intensity of the corresponding pixel, and the direction angle that generates the maximum response intensity is used as the gradient direction of the corresponding pixel. Based on the angular difference between the gradient direction of adjacent pixels in the neighborhood of each pixel and the gradient direction of the corresponding pixel, a neighborhood direction consistency constraint is constructed, and an initial feature score is calculated based on the maximum response intensity and the neighborhood direction consistency constraint, wherein the angular difference is calculated according to the 180-degree equivalent direction. The initial feature scores are normalized to obtain the feature scores of each pixel, and the gradient structure response map is generated from the feature scores of each pixel.

3. The method according to claim 2, characterized in that, The process involves performing non-maximum suppression based on the gradient structure response map to obtain pixel-level edges, and setting an adaptive threshold to filter out low-deterministic points, resulting in a set of structural anchor points, including: For each pixel in the gradient structure response map, non-maximum suppression is performed along the gradient direction of the corresponding pixel, retaining the pixels that satisfy the local maximum condition in the gradient direction and suppressing the pixels that do not satisfy the local maximum condition. An adaptive threshold is constructed based on the feature score distribution of the retained pixels after nonmaximum suppression. Pixels with feature scores lower than the adaptive threshold are removed, and pixels with feature scores not lower than the adaptive threshold are combined to form the structural anchor set.

4. The method according to claim 1, characterized in that, The step of performing path search and linking on the set of structural anchor points, and dividing the set into straight line segments along the sides of the tank and elliptical arc segments at the tank opening and bottom based on local curvature, includes: The anchor points in the set of structural anchor points are sorted according to their feature scores, and the anchor points that meet the preset score conditions are selected as seed points. A neighborhood search is performed along the gradient orthogonal direction of the seed point, and the candidate anchor point is determined to satisfy the path expansion condition based on the spatial distance between the candidate anchor point and the current path endpoint and the angle between the gradient orthogonal direction of the candidate anchor point and the current search direction. Link candidate anchor points that meet the path extension conditions to the current path to extend the edge path; The local curvature is calculated based on the coordinates of adjacent anchor points in the linked path. Based on the magnitude and variance of the local curvature, the corresponding set of anchor points is divided into straight line segments on the side of the tank or elliptical arc segments at the tank opening and bottom.

5. The method according to claim 1, characterized in that, For each anchor point in the straight line segment and elliptical arc segment, an orthogonal polynomial is selected to fit the grayscale profile along the gradient direction of the corresponding anchor point, and the sub-pixel coordinates are solved, including: Obtain the feature score of the current pixel on the line segment and the elliptical arc segment. If the feature score is not less than the preset score threshold, then select an orthogonal polynomial with the highest order of 4 as the fitting function model. If the feature score is less than the preset score threshold, then an orthogonal polynomial with the highest order of 3 is selected as the fitting function model. A line segment with a length of 9 pixels is cut along the gradient direction of the current pixel, the gray value of each point on the line segment is obtained, and the gray value is substituted into the selected orthogonal polynomial to perform gray-scale profile fitting to obtain a one-dimensional fitting function. The first derivative of the one-dimensional fitting function is calculated, and the candidate position with the largest absolute value of the first derivative is determined within the range of the line segment. Based on the candidate position and the gradient direction of the current pixel, the candidate position is converted into the sub-pixel coordinates of the pixel.

6. The method according to claim 1, characterized in that, The method involves weighted fitting of a linear model and an elliptical model based on all sub-pixel coordinates, obtaining a comprehensive confidence level based on the geometric distance of each point to the model and the fitting residuals, iteratively suppressing low-confidence points, and re-weighting and fitting the model, including: The weighted least squares method is used to fit the linear equations to the sub-pixel coordinates of each set of line segments to obtain the corresponding line model. The weighted algebraic least squares method is used to fit the quadratic curve equation to the sub-pixel coordinate points in each elliptical arc segment set to obtain the corresponding elliptical model. The elliptical model includes the ellipse center, major and minor axis parameters, and rotation angle parameters. Calculate the orthogonal geometric distance from each subpixel coordinate point to the model corresponding to the coordinate point. After normalizing the orthogonal geometric distance and the fitting residual, convert the normalization error into a geometric consistency score and combine it with the feature score of the point to calculate the comprehensive confidence score. Based on the overall confidence level, low-confidence sub-pixel coordinate points are filtered out, and the remaining sub-pixel coordinate points after filtering are used to refit the linear model and elliptical model until the overall residuals meet the preset convergence conditions, thus completing the iterative suppression of low-confidence points.

7. The method according to claim 1, characterized in that, When the suppression process causes a breakpoint in the model, path propagation is locally re-executed within the breakpoint region to repair the topology until the global model residual converges, obtaining the tank location information, including: The Euclidean distance between adjacent sub-pixel coordinates belonging to the same straight line segment or the same elliptical arc segment in the updated fitted set is detected. If the Euclidean distance is greater than 4 pixels, it is determined that there is a topological breakpoint in the region, and the sub-pixel coordinates at both ends of the breakpoint are used as local seed points. Relax the search constraints by increasing the angle threshold between the gradient orthogonal direction and the current search direction to 30 degrees, and re-execute the neighborhood search within the breakpoint region to supplement the missed anchor points; The supplemented anchor points are linked to repair the topological breakpoints, and the grayscale profile is truncated along the gradient direction of the supplemented anchor points for orthogonal polynomial fitting. After determining the corresponding sub-pixel coordinates, they are added to the fitting set. Calculate the residual mean square error of the geometric distance from all sub-pixel coordinate points to the corresponding model after repair and refitting. When the residual mean square error is less than a preset threshold, it is determined that the global model residual has converged, the iterative calculation is stopped, and the converged linear model and elliptical model parameters are output. Based on the linear model and elliptical model parameters, the tank position information is obtained and output.

8. A filling vision positioning system, characterized in that, Includes the following modules: The execution module is used to acquire the original image of the tank to be located, construct a Gaussian composite operator filter based on the original image, jointly generate a gradient structure response map based on the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, perform non-maximum suppression based on the gradient structure response map to obtain pixel-level edges, and set an adaptive threshold to filter out low-determinism points to obtain a set of structural anchor points. The partitioning module is used to perform path search and linking on the set of structural anchor points, and to divide the set of points into straight line segments on the side of the tank body and elliptical arc segments at the tank opening and bottom according to the local curvature. The iterative module is used to select an orthogonal polynomial to fit the grayscale profile of the gradient direction of each anchor point in the straight line segment and elliptical arc segment, solve the sub-pixel coordinates, and weight-fit the straight line model and elliptical model based on all sub-pixel coordinate points. The comprehensive confidence is obtained according to the geometric distance from each point to the model and the fitting residual. The module iteratively suppresses low confidence points and re-weights and fits the model. When the suppression process causes the model to breakpoint, the path propagation is locally re-executed in the breakpoint region to repair the topology until the global model residual converges, and the tank position information is obtained.

9. The system according to claim 8, characterized in that, The step of constructing a Gaussian composite operator filter based on the original image, and jointly generating a gradient structure response map based on the maximum response intensity of each pixel to the filter and the consistency of the gradient direction in the neighborhood of the corresponding pixel, includes: Multiple spatial scales are set for the Gaussian composite operator filter, and first-order Gaussian convolution feature operators in multiple directions are constructed at each spatial scale according to a preset angle step size, and combined to form a filter test array; Two-dimensional convolution operations are performed on each pixel in the original image using the filter test array. The convolution result with the largest absolute value is selected as the maximum response intensity of the corresponding pixel, and the direction angle that generates the maximum response intensity is used as the gradient direction of the corresponding pixel. Based on the angular difference between the gradient direction of adjacent pixels in the neighborhood of each pixel and the gradient direction of the corresponding pixel, a neighborhood direction consistency constraint is constructed, and an initial feature score is calculated based on the maximum response intensity and the neighborhood direction consistency constraint, wherein the angular difference is calculated according to the 180-degree equivalent direction. The initial feature scores are normalized to obtain the feature scores of each pixel, and the gradient structure response map is generated from the feature scores of each pixel.

10. The system according to claim 8, characterized in that, The process involves performing non-maximum suppression based on the gradient structure response map to obtain pixel-level edges, and setting an adaptive threshold to filter out low-deterministic points, resulting in a set of structural anchor points, including: For each pixel in the gradient structure response map, non-maximum suppression is performed along the gradient direction of the corresponding pixel, retaining the pixels that satisfy the local maximum condition in the gradient direction and suppressing the pixels that do not satisfy the local maximum condition. An adaptive threshold is constructed based on the feature score distribution of the retained pixels after nonmaximum suppression. Pixels with feature scores lower than the adaptive threshold are removed, and pixels with feature scores not lower than the adaptive threshold are combined to form the structural anchor set.