Automobile HUD target map high-precision positioning algorithm

By using adaptive kernel size expansion and second-order OTSU segmentation technology, combined with gradient threshold iterative fitting of ellipses, the problems of error and environmental interference in HUD detection are solved, achieving high-precision and high-repeatability positioning, which is applicable to multiple HUD detection devices.

CN121033162AActive Publication Date: 2025-11-28FUJIAN SHIWEI INTELLIGENT EQUIP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511122760.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-11-28
Estimated Expiration
2045-08-12

AI Technical Summary

Technical Problem

Existing calibration algorithms are prone to errors in HUD detection and have weak environmental interference resistance, failing to guarantee high positioning accuracy and high repeatability.

Method used

Adaptive kernel size dilation and second-order OTSU segmentation techniques are employed, combined with gradient threshold iterative fitting of the ellipse. By calculating the weighted positioning points of the centroid and the ellipse center, a multi-iteration method is designed to obtain the final positioning point coordinates.

Benefits of technology

It achieves high-precision and high-repeatability positioning in complex production environments, meets the detection accuracy requirement of 0.05mrad, has good robustness, and is suitable for various HUD detection devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033162A_ABST
    Figure CN121033162A_ABST
Patent Text Reader

Abstract

The invention relates to the field of industrial defect detection, in particular to a high-precision positioning algorithm for an automobile HUD target image, and the algorithm specifically comprises the steps: segmenting a point-line main body in the HUD target imaging image, and setting a non-main body image pixel value of the HUD target imaging image as 0; segmenting an HUD target imaging image; calculating the distances from the centroids of the four corner positioning points to the coordinates of the four corners of the edge of the image, and taking the four centroids with the smallest distances from each corner positioning point to the four corners of the edge of the image as corner points; obtaining a gradient point in the direction according to a gradient threshold value; fitting an ellipse according to the gradient points, constructing a centroid of the contour enclosed by the gradient points, and calculating the distance between the ellipsoid and the centroid; if the distance between the center of the ellipse and the center of mass is smaller than a threshold value and the number of the captured gradient points is larger than a preset value, taking a midpoint between the center of the ellipse and the center of mass as a final positioning point coordinate; according to the method, errors caused by actual work are overcome, the production environment interference resistance is high, and meanwhile high positioning precision and high repetition precision are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of industrial defect detection, and particularly relates to a high-precision positioning algorithm for a target pattern of an automobile HUD. BACKGROUND

[0002] In the automobile industry, the HUD (Head-Up Display) is a standard configuration of medium and high-grade cars. The process requirement for the wedge angle of the automobile glass interlayer is extremely high, otherwise it will cause ghosting deformation and stretching of the display pattern. Therefore, the car factory defines a series of detection items to evaluate the quality of the front windshield, such as linear deviation, local magnification, vertical trapezoidal, etc. In order to standardize the above-mentioned indexes, each car factory uses a point-line pattern to measure these indexes. As shown in the figure, the circle points are positioning points, and the line segments are used to measure ghosting. The arrangement of the lines of different car factories is different, which may be 7X21, 9X21, 7X13, the line segments are slightly staggered, and the line width is different, but the overall style is similar. Figure 1

[0003] In various detection items of the car factory, the most core technology is the high-precision positioning of the positioning points, because the results of most detection items are based on the secondary calculation of these points. If the error is large, it will be further enlarged in the subsequent calculation, resulting in poor stability of the whole detection.

[0004] The fitting circle of the existing calibration algorithm does not exist in the case of missing angle, and the calibration board is a high-precision device, so its fitting method is the global minimum error solution, without excluding outliers like ransac algorithm. In addition, the application scenarios of the calibration algorithm are all after focusing, and there is no ghosting and trailing in the HUD detection. The anti-interference ability of the calibration algorithm is not strong, and even some calibration algorithms have many restrictions on the detection scene, sacrificing robustness to improve precision. In summary, due to the particularity of the light path in the HUD detection, the existing technology is difficult to match and meet the robustness and high precision of the detection, and specific design and development of the algorithm are needed. SUMMARY

[0005] In order to solve the error caused by the existing calibration algorithm in the HUD detection, and the weak environmental anti-interference ability, which cannot guarantee the high positioning precision and high repeatability detection, the application provides a high-precision positioning algorithm for a target pattern of an automobile HUD, which overcomes the error caused by actual work, has strong anti-production environment interference ability, and guarantees high positioning precision and high repeatability.

[0006] The technical scheme of the application is as follows:

[0007] A high-precision positioning algorithm for a target pattern of an automobile HUD, comprising the following steps:

[0008] ​Step 1: segment the point line body in the HUD target imaging image, and set the image pixel value of the non-body region of the HUD target imaging image to 0;

[0009] Step 2: segment the positioning point region not containing ghosting from the HUD target imaging image processed in step 1 by using first-order OTSU and second-order OTSU;

[0010] Step 3: the four positioning points closest to the edges on the pattern, i.e. the corner points, need to be extracted, the coordinates and order of the four corner points are confirmed by calculating the distance from the centroid of each positioning point segmentation domain to the vertex of the rectangular image edge, and the four edges connected by the corner points are cut according to the row and column number of the pattern real point and then connected to obtain the preliminary positioning points;

[0011] Step 4: according to the preliminary positioning points and the corresponding real point region obtained in step 3, a gradient calculation range is constructed with the preliminary positioning points as the center, and the gradient points in the direction are obtained according to the gradient threshold value;

[0012] Step 5: fit an ellipse according to the gradient points, construct a contour surrounded by the gradient points, and perform weighted calculation on the ellipse center and the centroid of the contour, and record the pixel distance between the two centers;

[0013] Step 6: judge whether the distance between the fitted ellipse center and the centroid is less than the threshold value and the number of captured gradient points is greater than the preset value, if yes, take the midpoint between the ellipse center and the centroid as the final positioning point coordinates, otherwise reduce the gradient threshold value and repeat steps 4-6 until the conditions are met.

[0014] Further, step 1 is specifically: applying fixed threshold segmentation to the HUD target imaging image, extracting the highlight region, using adaptive kernel size inflation processing, and operating the connected point line pattern; locking the connected domain of the current pattern based on the center point of the field of view, calculating the minimum circumscribed rectangle of the pattern and reserving the boundary; setting the non-body region gray value to 0.

[0015] Further, step 2 is specifically: performing OTSU segmentation on the body region to obtain a first-order candidate region;

[0016] After Gaussian blur is performed on the first-order candidate region, the difference between the maximum and minimum gray values in the candidate region is calculated, and the candidate region is again subjected to OTSU segmentation to obtain a second-order candidate region, and the second-order candidate region is subjected to opening operation to remove burrs and then the contour roundness is calculated; if the gray difference is greater than 15 and the contour roundness is greater than 0.7, the second-order candidate region is used, otherwise the first-order candidate region is retained.

[0017] Further, step 3 is specifically: after obtaining four positioning points, connecting four edges, and constructing equal points on four edges according to the number of rows and columns of the pattern, connecting all the equal points into lines and calculating the coordinates of the intersection points of the lines, obtaining the preliminary coordinates of all the positioning points of the number of rows and columns, and screening effective points and marking missing points through area hit detection.

[0018] Further, step 4 is specifically: constructing a rotating rectangle with the preliminary positioning point as the center, calculating the gradient points in the long axis direction, taking the preliminary positioning point as the center, drawing rotating rectangles in turn, and adjusting the length and width according to the size of the real point, extracting the pixels in each rotating rectangle, performing first-order Gaussian filtering in the short edge direction, and then performing first-order derivative gradient change calculation from the inside to the outside in the long edge direction, setting an initial gradient threshold, and if the gradient change of a certain point is greater than the initial gradient threshold, taking the point as the gradient point and recording the coordinates of the point.

[0019] Further, step 5 is specifically: the gradient points meeting the conditions are used to fit an ellipse, and the center of the ellipse is obtained according to the fitting formula.

[0020] Further, the gradient threshold in step 6 is 40.

[0021] Further, step 6 is specifically: judging whether the number of gradient points is greater than 6 and the 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 distance between the center of the circle and the pixel is less than or equal to 6 pixels, outputting the midpoint between the center of the ellipse and the centroid as the final positioning point coordinates, otherwise reducing the gradient threshold by 3 until the conditions are met.

[0022] Compared with the prior art, the present application has the following beneficial effects:

[0023] (1) In the main body segmentation part of the present application, adaptive kernel size inflation processing is adopted, and the non-pattern part is excluded through morphological processing, avoiding the interference of subsequent extraction of high-light regions.

[0024] (2) The present application designs a second-order OTSU algorithm, i.e., twice OTSU segmentation, in step 2, the first OTSU segmentation obtains a first-order candidate region, the second OTSU segmentation is performed again on the basis of the first-order candidate region to obtain a second-order candidate region, and only the results of the second-order OTSU (i.e., the second-order candidate region) are used under the condition that the circularity 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 adopted, realizing automatic switching and avoiding the problem that the background, solid line and ghosting are difficult to segment due to different HUD device tooling and light source brightness.

[0025] (3) The present application designs pattern four-edge equal intersection lines to obtain preliminary positioning points, and performs hit determination with the original high-light region. On the one hand, the detection of missing points is performed, and on the other hand, the row and column information of the high-light real point is determined, avoiding the wrong row and column.

[0026] (4) The present application designs the calculation of the center of the positioning point, adopts the way of multiple iterations to select the most suitable gradient threshold for each positioning point from large to small to obtain the contour of the real point, and verifies the stability of the result by the centroid of the fitted point contour and the center of the fitted ellipse, ensures the repeatability of the positioning algorithm, and avoids the interference of dust and impurities on the corner of the circle.

[0027] (5) The present application is aimed at the target image positioning point positioning algorithm of the automobile front windshield HUD, which overcomes the errors caused by the actual tooling and the interference factors of the production environment, while ensuring high positioning accuracy and high repeatability. The repeatability of the HUD detection item meets 0.05mrad, which is more than 10% of the tolerance of the industry standard. In addition, the technology has been applied to multiple HUD detection devices, and has good robustness to common pattern light source brightness. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 is a target schematic diagram;

[0029] Figure 2 is an ambient light spot schematic diagram;

[0030] Figure 3 is a gradient direction construction schematic diagram;

[0031] Figure 4 is a gradient point fitting ellipse effect schematic diagram;

[0032] Figure 5 is an ellipse center and centroid effect schematic diagram;

[0033] Figure 6 is a multiple iteration effect schematic diagram;

[0034] Figure 7 is a stretched positioning point effect schematic diagram;

[0035] Figure 8 is a flowchart of the present application. DETAILED DESCRIPTION

[0036] The present application will be described in detail below in combination with the drawings and specific embodiments.

[0037] Referring to Figure 8 , a high-precision positioning algorithm for automobile HUD target image, comprising the following steps:

[0038] Step 1: Segment the point line body in the HUD target imaging image, and set the image pixel value of the non-body in the HUD target imaging image to 0;

[0039] Step 2: The HUD target imaging map processed in step 1 is segmented by first-order OTSU and second-order OTSU to obtain a positioning point area without ghosting;

[0040] Step 3: Four corner positioning points of the positioning point area are calculated, and the distances from the centroids of the four corner positioning points to the four corner coordinates of the image edge are obtained, so that the four centroids with the minimum distance from each corner positioning point to the four corner coordinates of the image edge are taken as the corner points;

[0041] Step 4: The four positioning points closest to the edge on the pattern, i.e., the corner points, are extracted, the coordinates and order of the four corner points are determined by calculating the distance from the centroid of each positioning point segmentation domain to the vertex of the rectangular image edge, and the four edges connected by the corner points are cut according to the row and column number of the pattern real point, and the preliminary positioning points are obtained by intersecting and connecting them;

[0042] Step 5: An ellipse is fitted according to the gradient points, a centroid is constructed around the contour formed by the gradient points, a weighted calculation is performed on the ellipse center and the centroid, and the pixel distance between the ellipse center and the centroid is calculated;

[0043] Step 6: It is judged whether the distance between the fitted ellipse center and the centroid is less than a threshold value and the number of captured gradient points is greater than a preset value, if yes, the midpoint between the ellipse center and the centroid is taken as the final positioning point coordinate, otherwise the gradient threshold value is reduced, and steps 4-6 are repeated until the condition is met.

[0044] The gradient threshold value refers to the threshold value of the change of the gray value of the pixels in a specified direction, and the lower the gradient threshold value, the more sensitive to the change of the gray value, but it is also easy to be disturbed by noise.

[0045] Step 5 is calculated by the existing calculation function of Opencv, mainly according to the calculation of the image matrix, which is a conventional technical means in the art.

[0046] The application will be further described below in combination with a specific embodiment:

[0047] Step 1: A fixed threshold value is applied to segment the HUD target imaging map, the high-light area is extracted, the adaptive kernel size inflation processing is adopted, and the connected point line pattern is operated; the connected domain of the current pattern is locked based on the center point of the field of view, the minimum circumscribed rectangle of the pattern is calculated and the boundary is reserved; the gray value of the non-main body area is set to 0.

[0048] Firstly, the point line main body in the imaging needs to be segmented, and the non-main body image pixel value is set to 0, because there may be a glass placed near the production environment, and at a certain angle, the external light may form a light spot on the glass by reflection, such as Figure 2As shown, this will cause interference with subsequent extraction positioning. First, a fixed threshold 80 is used to obtain the highlight area of the entire picture taken by the camera, and a larger size kernel is used for inflation processing to connect the lines and points of the pattern. Then, all connectable regions are filled, and the specific kernel size needs to be adjustable according to the pattern dot radius and line width. Then find the center of the image field and click the connected domain, which is the main body of the image pattern. This is because the standard pattern of the tool is centered, and the HUD detection will not appear the extreme case of the pattern gravity center offset beyond 1 / 4 of the field of view. After finding the pattern main body, boundary reservation is needed, because the fixed threshold processing may exclude ghosting. Calculate the minimum circumscribed rectangle of the pattern main body, and the upper and lower boundaries need to be 7% of the image length and width, because the theoretical values of vertical ghosting and horizontal ghosting may be different. Finally, set the remaining region gray value to 0.

[0049] The inflation processing refers to a simple morphological inflation processing, and different kernel sizes control the inflation degree, which is a conventional technical means.

[0050] Step 2: Perform OTSU segmentation on the main body area to obtain a first-order candidate area;

[0051] After Gaussian blur on the first-order candidate area, calculate the difference between the maximum and minimum gray values in the candidate area, and perform OTSU segmentation again to obtain a second-order candidate area. Get and calculate the contour roundness of the second-order candidate area. If the gray difference is > 15 and the contour roundness is > 0.7, use the second-order candidate area, otherwise keep the first-order candidate area.

[0052] The image after excluding interference is segmented into a positioning point area that does not contain ghosting using the OTSU (maximum inter-class variance method) algorithm. However, there is a problem. The area in the pattern with three gray values from small to large is: background, ghosting, and real point. It cannot be determined whether the gray value of the ghosting is closer to the real line or the background, which is determined by different HUD device tooling and brightness, or glass process. This leads to the possibility that the first-order OTSU segmentation (which means doing OTSU segmentation once) area is the intersection of the real line and the ghosting. At the same time, the gray value of the real line is also uncertain, so the fixed threshold segmentation method cannot be used. In order to solve this problem, a two-order OTSU method is designed. The specific method is to do OTSU segmentation again on the area obtained by the first-order OTSU segmentation. It should be noted that the gray scale histogram used by this method is different from that of the first-order OTSU. The inter-class gray level used by the first-order OTSU is the gray scale histogram of the entire image, and the histogram used by the second-order OTSU is the histogram within the region. Since the second-order is for the local, the segmentation effect is more accurate.

[0053] But if the solid line has been separated in the first-order OTSU segmentation, the second-order OTSU segmentation will forcibly separate the cluttered area. In order to realize automatic identification, a layer of judgment is made: the region extracted by the first-order OTSU segmentation is Gaussian blurred, the difference between the maximum and minimum gray values after blurring is calculated, and then the region extracted by the second-order OTSU segmentation is opened to deburr and the contour roundness is calculated, as shown in formula (1) which needs to use the area and perimeter of the contour. If the roundness is greater than 0.7 and the gray value difference is greater than 15, the second-order OTSU is adopted, otherwise the result of the first-order OTSU is adopted. The calculation of roundness takes advantage of the feature that the solid point layer is higher than the ghost, and the problem of inaccurate extraction of the solid line does not need to be considered, because this step is aimed at preliminary acquisition of the positioning point, and the solid line is calculated by the ghost.

[0054] Roundness=(4π*area) / perimeter 2 (1)

[0055] wherein Roundness represents roundness, area represents area, and perimeter represents perimeter.

[0056] Step 3: The four positioning points closest to the edges of the pattern, i.e. the corner points, need to be extracted, the coordinates and order of the four corner points are confirmed by calculating the distance from the centroid of each positioning point segmentation domain to the top vertex of the edge of the rectangular image, and the four edges connected by the corner points are divided according to the row and column number of the pattern and are connected to obtain preliminary positioning points.

[0057] After obtaining the preliminary four positioning points, the four edges are connected, and the equal division points are constructed on the four edges according to the row and column number of the pattern, all the equal division points are connected into a line and the coordinates of the intersection points are calculated to obtain the preliminary coordinates of all the positioning points in the row and column, and the effective points are screened and the missing points are marked through region hit detection.

[0058] The positioning points of the four corners of the positioning point region obtained in step 2 are calculated, and the coordinates of the corner points in each direction can be obtained by calculating the distance from the centroid of these regions to the coordinates of the four corners of the image edge. The point with the smallest distance is the corner point in that direction. For example, the top left corner coordinates are (0, 0), the distances from the centroids of all positioning points to the point are calculated, and the smallest distance is the top left corner positioning point of the pattern. After obtaining the four positioning points, the four edges are connected, and the equal division points are constructed on the four edges according to the row and column number of the pattern, all the equal division points are connected into a line and the coordinates of the intersection points are calculated. In this way, the preliminary coordinates of all the positioning points in the row and column are obtained.

[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, two large crosses represent the ellipse center and the centroid, respectively. The weighted design of the centroid and the center of the circle not only avoids the interference of the missing corners of the circle or dust impurities, but also reduces the error jitter generated by the fitting.

[0066] Step 6: Determine whether the number of gradient points is greater than 6 and the 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 distance between the center of the circle is less than or equal to 6 pixels, output the midpoint between the ellipse center and the centroid as the final positioning point coordinate; otherwise, reduce the gradient threshold by 3 until the conditions are met.

[0067] The main problem of using the step 4 method to calculate all positioning points is the setting of the gradient threshold. If the gradient threshold is too large, no gradient points or too few gradient points can be found, and the final positioning point coordinates are also inaccurate. If the gradient threshold is too small, the detection is too sensitive, and the gradient points can be misidentified to the ghost outline. In addition, the amount of light entering is different for different devices and tooling, which requires manual adjustment and adaptation. In addition, there are product control differences in glass, and the brightness of the positioning points at different positions is not the same, and the brightness of the ghost is not the same. In order to solve this problem, an adaptive gradient threshold detection algorithm logic is designed. First, set the initial gradient threshold to 40. Then, according to the threshold, calculate all the positioning points in the picture. Some positioning points may not have gradient points or have too few gradient points.

[0068] Only when the number of gradient points is greater than 6 and the distance between the centroid and the center of the circle is less than 6, the midpoint calculation is performed to determine the positioning point coordinate. Otherwise, according to the set gradient step, which is 3 here, these positioning points that do not meet the conditions re-enter step 4, and the set gradient threshold is 40-3=37. This cycle continues until all positioning points meet the conditions. Since the defect detection has been done in step 3, there is no possibility of no points, and there will be a positioning result. Finally, output all the positioning point coordinates and row and column information for subsequent secondary calculation of the HUD detection item. Figure 6 , which shows the process of the positioning point center becoming more and more accurate after multiple iterations.

[0069] The advantage of this design is that the gradient points will be captured on the real point outline from large to small iteration, and will not be misjudged to the ghost, and there is no need for manual parameter adjustment. When a more accurate center coordinate is needed, only the gradient step and the distance threshold need to be adjusted smaller, which will produce more iteration times. In addition, this design separates the gradient threshold required by each positioning point, avoiding the problem of different local light entering amounts on the pattern. Secondly, it still has good robustness in the face of stretched and ghosted outlines. Figure 7 Even in the presence of severe stretching and ghosting interference, the center of the positioning point can still be accurately positioned.

[0070] The above merely illustrates the embodiments of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which are made by using the content of the present application specification and drawings, are also included in the patent protection scope of the present application.

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.

Citation Information

Patent Citations

  • Object roundness measuring method

    CN110349199A

  • Polygon contour detection method and device based on line scanning camera imaging

    CN117830336A

  • Method and apparatus for positioning pupil, storage medium, electronic device

    US20190347824A1