Automobile hud target map high-precision positioning algorithm
By using adaptive kernel size expansion processing and second-order OTSU segmentation technology, combined with gradient threshold iterative fitting of ellipses, the problems of large errors and environmental interference in HUD detection are solved, and a high-precision and high-repeatability positioning algorithm is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUJIAN SHIWEI INTELLIGENT EQUIP CO LTD
- Filing Date
- 2025-08-12
- Publication Date
- 2026-07-31
AI Technical Summary
Existing calibration algorithms have large errors in HUD detection, weak environmental interference resistance, and cannot guarantee high positioning accuracy and high repeatability.
Adaptive kernel size expansion and second-order OTSU segmentation techniques are employed, combined with gradient threshold iterative fitting of the ellipse, and weighted calculation using the centroid and ellipse center to ensure the accuracy and robustness of the positioning points.
It achieves high-precision and high-repeatability positioning, has strong anti-interference capabilities, is suitable for multiple HUD detection devices, and has a repeatability of 0.05mrad, exceeding industry standards by 10%.
Smart Images

Figure CN121033162B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial defect detection, specifically relating to a high-precision positioning algorithm for automotive HUD target images. Background Technology
[0002] In the automotive industry, HUD (Head-Up Display) is a standard feature in mid-to-high-end cars. HUDs require extremely high precision in the manufacturing process of the wedge angle of the automotive glass interlayer; otherwise, it will cause ghosting, distortion, and stretching of the displayed image. Therefore, automakers have defined a series of testing items to evaluate the quality of the windshield, such as linear offset, local magnification, and vertical trapezoidal distortion. To standardize these indicators, automakers use dot-line graphs to measure them. Figure 1 As shown, the dots are positioning points, and the line segments are specifically used to measure ghosting. The row and column arrangement varies between different car manufacturers, and may be 7X21, 9X21, 7X13. The line segments may also be slightly staggered, and the line widths may vary, but the overall style is similar.
[0003] Among the various testing items of car manufacturers, the most critical technology is the high-precision positioning of positioning points, because the results of most testing items are based on secondary calculations of these points. If the error is large, it will be further amplified in subsequent calculations, resulting in a decrease in the overall testing stability.
[0004] Existing calibration algorithms fit circles without missing corners, and the calibration boards are all high-precision devices. Therefore, their fitting method is to find the solution with the global minimum error, without performing outlier elimination like the RANSAC algorithm. Furthermore, these calibration algorithms are applicable to fixed-focus scenarios, avoiding the ghosting and blurring issues present in HUD detection. The algorithms also have weak anti-interference capabilities, with some imposing significant limitations on the detection scenarios, sacrificing robustness for accuracy. In short, due to the unique optical path of HUD detection, existing technologies struggle to match and meet the robustness and high accuracy requirements, necessitating specific algorithm design and development. Summary of the Invention
[0005] To address the errors easily caused by existing calibration algorithms in HUD detection, as well as their weak resistance to environmental interference, which prevents them from guaranteeing high positioning accuracy and high repeatability, this invention provides a high-precision positioning algorithm for automotive HUD target images. This algorithm overcomes errors caused by actual work, has strong resistance to interference from the production environment, and simultaneously guarantees high positioning accuracy and high repeatability.
[0006] The technical solution of the present invention is as follows:
[0007] A high-precision positioning algorithm for automotive HUD target images includes the following steps:
[0008] Step 1: Segment the main body of the HUD target image by points and lines, and set the pixel values of non-main body images in the HUD target image to 0;
[0009] Step 2: Divide the HUD target image processed in Step 1 into localization point regions that do not contain ghosting using first-order OTSU and second-order OTSU.
[0010] Step 3: It is necessary to extract the four positioning points, i.e., corner points, closest to the edge of the pattern. The coordinates and order of the four corner points are determined by calculating the distance from the centroid of the segmentation domain of each positioning point to the vertex of the rectangular image edge. The four sides formed by the corner points are proportionally divided according to the number of rows and columns of the pattern's solid points and then intersected to obtain the preliminary positioning points.
[0011] Step 4: Based on the preliminary positioning points and corresponding real point regions obtained in Step 3, construct the gradient calculation range with the preliminary positioning points as the center, and obtain the gradient points in this direction according to the gradient threshold.
[0012] Step 5: Fit an ellipse based on the gradient points, construct a contour bounded by the gradient points, perform a weighted calculation on the center of the ellipse and the centroid of the contour, and record the pixel distance between the two centers.
[0013] Step 6: Determine whether the distance between the fitted ellipse center and the centroid is less than the threshold and the number of captured gradient points is greater than the preset value. If the conditions are met, the midpoint between the ellipse center and the centroid is used as the final positioning point coordinates. Otherwise, the gradient threshold is reduced, and steps 4-6 are repeated until the conditions are met.
[0014] Further, step 1 specifically involves: applying a fixed threshold segmentation to the HUD target image, extracting the bright areas, using adaptive kernel size dilation processing, and manipulating the connected point and line pattern; locking the connected components of the current pattern based on the center point of the field of view, calculating the minimum bounding rectangle of the pattern and reserving the boundary; and setting the grayscale of non-subject areas to 0.
[0015] Furthermore, step 2 specifically involves performing OTSU segmentation on the main region to obtain first-order candidate regions;
[0016] After applying Gaussian blur to the first-order candidate region, the difference between the maximum and minimum gray values in the candidate region is calculated. The candidate region is then segmented again using OTSU to obtain the second-order candidate region. The second-order candidate region is then opened to remove burrs, and the contour roundness is calculated. If the gray difference is >15 and the contour roundness is >0.7, the second-order candidate region is adopted; otherwise, the first-order candidate region is retained.
[0017] Further, step 3 specifically involves: after obtaining the four positioning points, connecting the four sides, constructing equal division points on the four sides according to the number of rows and columns of the pattern, connecting all the equal division points to form lines and calculating the coordinates of the line intersections, obtaining the preliminary coordinates of all positioning points in the number of rows multiplied by columns, filtering valid points through region hit detection and marking missing points.
[0018] Further, step 4 specifically involves: constructing a rotating rectangle centered on the initial positioning point, calculating the gradient point along the long axis, drawing rotating rectangles sequentially with the initial positioning point as the center, adjusting the length and width according to the size of the real points, extracting the pixels within each rotating rectangle, performing a first-order Gaussian filter on its short side, and then calculating the gradient change of the first derivative from the inside out along the long side, setting an initial gradient threshold, and if the gradient change at a certain point is greater than the initial gradient threshold, then that point is taken as the gradient point and its coordinates are recorded.
[0019] Furthermore, step 5 specifically involves using all gradient points that meet the conditions to fit the ellipse, and obtaining the ellipse center according to the fitting formula.
[0020] Furthermore, the gradient threshold in step 6 is 40.
[0021] Further, step 6 specifically involves: determining whether the number of gradient points is greater than 6 and whether the pixel distance between the centroid and the center of the circle is less than 6 pixels. If the number of gradient points is ≥ 6 and the pixel distance between the center of the circle is ≤ 6 pixels, then the midpoint between the center of the ellipse and the centroid is output as the final positioning point coordinates; otherwise, the gradient threshold is reduced by 3 until the conditions are met.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] (1) In the main body segmentation part, the present invention adopts adaptive kernel size dilation processing, and excludes non-pattern parts through morphological processing, thereby avoiding interference from subsequent extraction of highlight areas.
[0024] (2) The present invention designs a second-order OTSU algorithm through step 2, namely two OTSU segments. The first OTSU segmentation obtains the first-order candidate region. The second OTSU segmentation is performed on the basis of the first-order candidate region to obtain the second-order candidate region. The second OTSU result (i.e., the second-order candidate region) is only used when the roundness is greater than 0.7 and the gray value range is greater than 15. Otherwise, the first-order candidate region obtained by the first OTSU segmentation is used to achieve automatic switching and avoid the problem of difficult segmentation of background, solid lines and ghosting caused by different HUD device fixtures and light source brightness.
[0025] (3) This invention designs a pattern with four equally divided intersection lines to obtain preliminary positioning points, and performs a hit determination with the original highlighted areas. On the one hand, it detects defects, and on the other hand, it determines the row and column information of the highlighted solid points, thus avoiding misalignment.
[0026] (4) The present invention designs the center calculation of the positioning point, and adopts a multi-iteration method to select the most suitable gradient threshold for each positioning point from large to small to obtain the contour of the real point. The centroid of the fitted point contour and the center of the fitted ellipse are used to verify the stability of the result, ensuring the repeatability accuracy of the positioning algorithm and avoiding the interference of dust and impurities on the round missing corner.
[0027] (5) The target image positioning algorithm of this invention for automotive windshield HUD overcomes the errors that may be caused by actual tooling and the interference factors of the production environment, while ensuring high positioning accuracy and high repeatability. The repeatability of HUD detection items meets 0.05mrad, which is far more than 10% of the tolerance of industry standards. In addition, this technology has been applied to many HUD detection equipment and has good robustness to the brightness of common pattern light sources. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of the target.
[0029] Figure 2 This is a schematic diagram of the ambient light spot.
[0030] Figure 3 Construct a schematic diagram for the gradient direction;
[0031] Figure 4 A schematic diagram illustrating the effect of fitting an ellipse to gradient points;
[0032] Figure 5 This is a schematic diagram showing the effect of the center and centroid of the ellipse;
[0033] Figure 6 This is a diagram illustrating the effect of multiple iterations;
[0034] Figure 7 This is a schematic diagram illustrating the effect of stretching the positioning points;
[0035] Figure 8 This is a schematic diagram of the process of the present invention. Detailed Implementation
[0036] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0037] See Figure 8 A high-precision positioning algorithm for automotive HUD target images includes the following steps:
[0038] Step 1: Segment the main body of the HUD target image by points and lines, and set the pixel values of non-main body images in the HUD target image to 0;
[0039] Step 2: Divide the HUD target image processed in Step 1 into localization point regions that do not contain ghosting using first-order OTSU and second-order OTSU.
[0040] Step 3: Calculate the four corner points of the positioning point region, obtain the distance from the centroid of the four corner points to the four corners of the image edge, and take the four centroids with the smallest distance from each corner point to the four corners of the image edge as the corner points;
[0041] Step 4: It is necessary to extract the four positioning points, i.e., corner points, closest to the edge of the pattern. The coordinates and order of the four corner points are determined by calculating the distance from the centroid of the segmentation domain of each positioning point to the vertex of the rectangular image edge. The four sides formed by the corner points are proportionally divided according to the number of rows and columns of the pattern's solid points and then intersected to obtain the preliminary positioning points.
[0042] Step 5: Fit an ellipse based on the gradient points, construct the centroid of the contour formed by the gradient points, perform a weighted calculation on the ellipse center and the centroid, and calculate the pixel distance between the ellipse center and the centroid.
[0043] Step 6: Determine whether the distance between the fitted ellipse center and the centroid is less than the threshold and the number of captured gradient points is greater than the preset value. If the conditions are met, the midpoint between the ellipse center and the centroid is used as the final positioning point coordinates. Otherwise, the gradient threshold is reduced, and steps 4-6 are repeated until the conditions are met.
[0044] The gradient threshold refers to the threshold for the change of gray value of a pixel along a specified direction. The lower the gradient threshold, the more sensitive it is to changes in gray value, but it is also more susceptible to noise interference.
[0045] Step 5 uses existing OpenCV calculation functions to perform calculations, mainly based on image moments, which is a conventional technique in this field.
[0046] The present invention will be further described below with reference to a specific embodiment:
[0047] Step 1: Apply a fixed threshold segmentation to the HUD target image, extract the bright areas, use adaptive kernel size dilation to process the connected point and line pattern; lock the connected components of the current pattern based on the center point of the field of view, calculate the minimum bounding rectangle of the pattern and reserve the boundary; set the gray level of non-subject areas to 0.
[0048] First, it's necessary to segment the main elements (points, lines, etc.) in the image and set the pixel values of non-main elements to 0. This is because there might be glass surfaces near the production environment, and at a certain angle, external light might be reflected, forming light spots that illuminate the glass surface. Figure 2As shown, this can interfere with subsequent extraction of localization points. First, a fixed threshold of 80 is used to obtain the highlighted areas of the entire image captured by the camera. A larger kernel is used for dilation to connect the lines and points of the pattern. Then, all connectable areas are filled. The specific kernel size needs to be adjusted based on the radius of the dots and the line width of the pattern. Next, the connected region in the center of the image's field of view is found; this region is the main body of the pattern. This is because the standard for tooling patterns is centered, and HUD detection will not encounter the extreme case where the pattern's center of gravity shifts beyond 1 / 4 of the field of view. After finding the main body of the pattern, boundary reservation is needed because using a fixed threshold might result in the exclusion of ghosting. The minimum bounding rectangle of the main body of the pattern is calculated, and the top, bottom, left, and right boundaries need to correspond to 7% of the image's length and width, because the theoretical values for vertical and horizontal ghosting are different. Finally, the grayscale value of the remaining area is set to 0.
[0049] The aforementioned expansion process refers to a simple morphological expansion process, where the degree of expansion is controlled by different nucleus sizes, and it is a conventional technique.
[0050] Step 2: Perform OTSU segmentation on the main region to obtain first-order candidate regions;
[0051] After applying Gaussian blur to the first-order candidate region, the difference between the maximum and minimum gray values in the candidate region is calculated. The candidate region is then segmented again using OTSU to obtain the second-order candidate region. The second-order candidate region is then opened to remove burrs, and the contour roundness is calculated. If the gray difference is >15 and the contour roundness is >0.7, the second-order candidate region is adopted; otherwise, the first-order candidate region is retained.
[0052] The image, after interference removal, is segmented using the OTSU (Otto-Otto-Squares) algorithm to identify the localized point regions that do not contain ghosting. However, this presents a problem: the pattern contains three regions with grayscale values, in ascending order: background, ghosting, and solid points. It's impossible to determine whether the grayscale value of the ghosting is closer to the solid line or the background, as this is determined by different HUD device fixtures and brightness, or glass processing. This means that the region obtained from a first-order OTSU segmentation (meaning performing only one OTSU segmentation) might be the intersection of the solid line and the ghosting. Furthermore, the grayscale value of the solid line is also uncertain, so a fixed threshold segmentation method cannot be used. To address this issue, a second-order OTSU method is designed. Specifically, a second OTSU segmentation is performed on the region obtained from the first-order OTSU segmentation. It's important to note that this method uses a different grayscale histogram than the first-order method. The first-order OTSU uses a grayscale histogram covering the entire image range, while the second-order OTSU segmentation uses a histogram within a specific region. Because the second-order method targets a local area, it achieves more accurate segmentation results.
[0053] However, if the solid lines have already been segmented separately during the first-order OTSU segmentation, the second-order OTSU segmentation will forcibly segment out messy areas. To achieve automatic recognition, a judgment layer is implemented: the area extracted by the first-order OTSU segmentation is Gaussian blurred, and the difference between the maximum and minimum gray values is calculated after obtaining the blurred area. Then, the area extracted by the second-order OTSU segmentation is opened to remove burrs, and the contour roundness is calculated. As shown in formula (1), the face and perimeter of the contour are required. If the roundness is greater than 0.7 and the gray value difference is greater than 15, the second-order OTSU is used; otherwise, the result of the first-order OTSU is used. The calculation of the roundness is based on the characteristic that the solid point layer is higher than the ghost image. Here, there is no need to consider the problem of inaccurate solid line extraction, because this step is for the initial acquisition of the positioning points, and the solid lines are calculated using the ghost image.
[0054] Roundness=(4π*area) / perimeter 2 (1)
[0055] Among them, Roundness represents roundness, area represents area, and perimeter represents perimeter.
[0056] Step 3: It is necessary to extract the four positioning points, i.e., corner points, closest to the edge of the pattern. The coordinates and order of the four corner points are determined by calculating the distance from the centroid of the segmentation domain of each positioning point to the vertex of the rectangular image edge. The four sides formed by the corner points are proportionally divided according to the number of rows and columns of the pattern's solid points and then intersected to obtain the preliminary positioning points.
[0057] After obtaining the initial four positioning points, connect the four sides and construct equal division points on the four sides according to the number of rows and columns of the pattern. Connect all the equal division points to form lines and calculate the coordinates of the line intersection points to obtain the initial coordinates of all positioning points in the rows and columns. Valid points are filtered and missing points are marked through region hit detection.
[0058] The four corner points of the positioning area obtained in step 2 are calculated by measuring the distance from the centroid of these areas to the four corners of the image edge. The point with the smallest distance is the corner point in that direction. For example, if the top-left corner is (0, 0), calculate the distance from the centroid of all positioning points to this point; the point with the smallest distance is the top-left corner of the pattern. After obtaining the four positioning points, connect the four sides and construct equal division points on the four sides according to the number of rows and columns of the pattern. Connect all the equal division points to form lines and calculate the coordinates of the line intersections. This gives the preliminary coordinates of all positioning points in the rows and columns.
[0059] Since the area extracted in step 2 still contains solid lines or useless diagonal solid lines, the extracted area in step 2 is slightly expanded. Then, it is determined whether the initial positioning point is in the area. The area that is hit is the solid point of the positioning point. The advantage is that the pattern may be significantly tilted, and positioning points near the same axis coordinate may not belong to the same row or column. This method further filters out the solid points in the extracted area and matches the row and column information of the solid points. At the same time, this method also completes the defect detection. When no hit is made, a defect is determined.
[0060] Step 4: Construct a rotating rectangle centered on the initial positioning point. Calculate the gradient points along the long axis. Using the initial positioning point as the center, draw rotating rectangles in sequence, adjusting the length and width according to the size of the real points. Extract the pixels within each rotating rectangle, perform a first-order Gaussian filter on its short side, and then calculate the gradient change of the first derivative from the inside out along the long side. Set an initial gradient threshold. If the gradient change at a certain point is greater than the initial gradient threshold, then take that point as the gradient point and record its coordinates.
[0061] Based on the initial positioning point and corresponding solid point area obtained in step 3, we need to determine the more precise center coordinates of the positioning point. Currently, the effect is that the initial positioning point is roughly within the area of the corresponding solid point. We draw rotating rectangles with the initial positioning point as the center, adjusting the length and width according to the size of the solid points, such as... Figure 3 As shown.
[0062] like Figure 4 As shown, the small forks represent gradient points.
[0063] Step 5: All gradient points that meet the conditions are used to fit the ellipse, and the center of the ellipse is obtained according to the fitting formula; construct the centroid of the contour formed by the gradient points, perform a weighted calculation on the center of the ellipse and the centroid, and calculate the distance between the center of the ellipse and the centroid.
[0064] extract Figure 3 For each pixel within the rotating rectangle, a first-order Gaussian filter is applied along its shorter side, and then the gradient change is calculated from the inside out along the longer side. We set a relatively large initial gradient threshold of 40. If the gradient change is greater than this threshold, we consider that point a gradient point and record its coordinates. Then, we fit these gradient points to an ellipse and obtain the center of the ellipse using the fitting formula. Figure 4 As shown, the large cross is the center of the ellipse.
[0065] However, using only the center of the ellipse to fix the coordinates of the positioning points is unstable. When the number of gradient points is small or the points are clustered on one side, the fitted ellipse is prone to jitter. Therefore, it is necessary to add the centroid of the contour formed by these gradient points for weighting. The midpoint between the center of the ellipse and the centroid is used as the final positioning point coordinates, such as... Figure 5As shown, the two large crosses represent the center of the ellipse and the centroid, respectively. The weighted design of the centroid and the center of the circle avoids interference from missing corners or dust impurities and reduces the jitter of fitting errors.
[0066] Step 6: Determine if the number of gradient points is greater than 6 and the pixel distance between the centroid and the center of the circle is less than 6 pixels. If the number of gradient points is ≥ 6 and the pixel distance between the center of the circle is ≤ 6 pixels, output the midpoint between the center of the ellipse and the centroid as the final positioning point coordinates; otherwise, reduce the gradient threshold by 3 until the conditions are met.
[0067] The main problem with calculating all localization points using the method in step 4 is setting the gradient threshold. If the gradient threshold is too large, gradient points may not be found or there may be too few gradient points, resulting in inaccurate localization point coordinates. If the gradient threshold is too small, the detection is oversensitive and may misidentify gradient points as ghosting contours. Additionally, different devices and tooling have different light intake levels, requiring manual adjustment and adaptation. Furthermore, glass quality varies, leading to inconsistent brightness of localization points and ghosting brightness at different locations. To address this issue, an adaptive gradient threshold detection algorithm is designed. First, the initial gradient threshold is set to 40. This threshold is then used to calculate the gradient for all localization points in the image. However, some localization points may have insufficient or no gradient points.
[0068] The coordinates of a location point are determined only if the number of gradient points is greater than 6 and the pixel distance between the centroid and the center of the circle is less than 6. Otherwise, based on the set gradient step size (3 in this case), these unsatisfactory locations re-enter step 4. The set gradient threshold is 40-3=37. This process is repeated until all locations meet the conditions. Since defect detection has already been performed in step 3, there is no possibility of no points being found, and a location result will always be obtained. Finally, the coordinates and row and column information of all locations are output for subsequent secondary calculations of HUD detection items. Figure 6 This demonstrates the process by which the center of the positioning point becomes increasingly accurate after multiple iterations.
[0069] The advantages of this design are that it iterates from large to small, ensuring that gradient points are captured precisely on the solid outline, avoiding misjudgments of ghosting, and eliminating the need for manual parameter tuning. When more precise center coordinates are required, simply reduce the gradient step size and distance threshold, resulting in more iterations. Furthermore, this design isolates the gradient threshold required for each positioning point, avoiding the problem of inconsistent local light intake on the pattern. Secondly, it maintains good robustness even when dealing with incomplete stretched ghosting circles. Figure 7 Even when encountering severe stretching and ghosting interference, it can accurately locate the center of the positioning point.
[0070] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A high-precision positioning algorithm for a car HUD target image, characterized in that, Includes the following steps: Step 1: Segment the main body of the HUD target image by points and lines, and set the pixel values of non-main bodies in the HUD target image to 0. Step 2: Use first-order OTSU and second-order OTSU to segment the localization point region that does not contain ghosting in the HUD target image processed in Step 1. Step 3: It is necessary to extract the four positioning points, i.e., corner points, closest to the edge of the pattern. The coordinates and order of the four corner points are determined by calculating the distance from the centroid of the segmentation domain of each positioning point to the vertex of the rectangular image edge. The four sides formed by the corner points are proportionally divided according to the number of rows and columns of the pattern's solid points and then intersected to obtain the preliminary positioning points. Step 4: Based on the preliminary positioning points and corresponding real point regions obtained in Step 3, construct the gradient calculation range with the preliminary positioning points as the center, and obtain the gradient points in this direction according to the gradient threshold. Step 5: Fit an ellipse based on the gradient points, construct a contour formed by the gradient points, perform a weighted calculation on the center of the ellipse and the centroid of the contour, and record the pixel distance between the two centers. Step 6: Determine whether the distance between the fitted ellipse center and the centroid is less than the threshold and the number of captured gradient points is greater than the preset value. If the conditions are met, the midpoint between the ellipse center and the centroid is used as the final positioning point coordinates. Otherwise, the gradient threshold is reduced, and steps 4-6 are repeated until the conditions are met.
2. The high-precision positioning algorithm for a car HUD target image according to claim 1, characterized in that, Step 1 specifically involves: applying a fixed threshold segmentation to the HUD target image, extracting the bright areas, using adaptive kernel size dilation to process the connected point and line patterns; locking the connected components of the current pattern based on the center point of the field of view, calculating the minimum bounding rectangle of the pattern and reserving the boundary; and setting the grayscale of non-subject areas to 0.
3. The high-precision positioning algorithm for a car HUD target image according to claim 1, characterized in that, Step 2 specifically involves performing OTSU segmentation on the main region to obtain first-order candidate regions; After applying Gaussian blur to the first-order candidate region, the difference between the maximum and minimum gray values in the candidate region is calculated. The candidate region is then segmented again using OTSU to obtain the second-order candidate region. The second-order candidate region is then opened to remove burrs, and the contour roundness is calculated. If the gray difference is >15 and the contour roundness is >0.7, the second-order candidate region is adopted; otherwise, the first-order candidate region is retained.
4. The high-precision positioning algorithm for a car HUD target image according to claim 1, characterized in that, Step 3 is as follows: After obtaining the four positioning points, connect the four sides, and construct equal division points on the four sides according to the number of rows and columns of the pattern. Connect all the equal division points to form lines and calculate the coordinates of the line intersection points to obtain the preliminary coordinates of all positioning points with the number of rows multiplied by the number of columns. Valid points are filtered and missing points are marked through area hit detection.
5. The high-precision positioning algorithm for a car HUD target image according to claim 1, characterized in that, Step 4 is as follows: Construct a rotating rectangle with the initial positioning point as the center, calculate the gradient point along the long axis, and draw rotating rectangles in sequence with the initial positioning point as the center. The length and width are adjusted according to the size of the real point. Extract the pixels in each rotating rectangle, perform a first-order Gaussian filter on its short side, and then perform a first-order gradient change calculation from the inside to the outside on the long side. Set an initial gradient threshold. If the gradient change of a certain point is greater than the initial gradient threshold, then take that point as the gradient point and record the coordinates of that point.
6. The high-precision positioning algorithm for a car HUD target image according to claim 1, characterized in that, Step 5 specifically involves using all gradient points that meet the conditions to fit the ellipse, and obtaining the ellipse center according to the fitting formula.
7. The high-precision positioning algorithm for a car HUD target image according to claim 1, characterized in that, The gradient threshold in step 6 is 40.
8. The high-precision positioning algorithm for a car HUD target image according to claim 7, characterized in that, Step 6 specifically involves determining whether the number of gradient points is greater than 6 and whether the pixel distance between the centroid and the center of the circle is less than 6 pixels. If the number of gradient points is greater than or equal to 6 and the pixel distance between the center of the circle is less than or equal to 6 pixels, then the midpoint between the center of the ellipse and the centroid is output as the final positioning point coordinates. Otherwise, the gradient threshold is reduced by 3 until the conditions are met.