Elliptical region-based test positioning method and system for automotive head-up display

By using an elliptical region localization method based on the driver's head image, the elliptical region of the human eye is dynamically adjusted. Combined with binocular camera calibration and error compensation, the problem of inaccurate localization of the human eye elliptical region in the testing of head-up display systems is solved, improving measurement accuracy and testing efficiency.

CN122192704APending Publication Date: 2026-06-12CHINA AUTOMOTIVE ENG RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA AUTOMOTIVE ENG RES INST
Filing Date
2026-01-30
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing head-up display system testing methods are inaccurate when locating within the elliptical region of the human eye due to changes in the driver's head posture, affecting the measurement accuracy of parameters such as brightness and chromaticity. Furthermore, laboratory environments cannot simulate the complex lighting conditions of real driving scenarios, increasing testing time and costs.

Method used

Based on driver head image recognition and extraction of the human eye elliptical region, its shape and position are dynamically adjusted. Intrinsic and extrinsic parameters are obtained through binocular camera calibration, a three-dimensional coordinate system is established, and real-time correction is performed through error compensation. Combined with dynamic modeling and marker-assisted positioning, the capture accuracy is improved.

Benefits of technology

It significantly improves the accuracy of binocular cameras in capturing the elliptical region of the human eye, reduces positioning errors caused by changes in head posture, improves the reliability of test results, and reduces the number of repeated tests and costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122192704A_ABST
    Figure CN122192704A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of automobile electronic testing, and provides a kind of automobile head-up display system test positioning method and system based on elliptical region, based on driver head image, identify and extract human eye elliptical region;Based on the posture of the driver's head, dynamically adjust the shape and position of the human eye elliptical region;According to the human eye elliptical region, calibrate binocular camera, obtain the internal and external parameters of the camera group;Establish a three-dimensional coordinate system with the midpoint of the camera as the world coordinate origin;According to the dynamic change of the human eye elliptical region and the positioning data of the marker point, the positioning error of the binocular camera is corrected in real time through error compensation;Through dynamic modeling and marker point auxiliary positioning, the capture accuracy of binocular camera on human eye elliptical region is significantly improved, and the positioning error caused by head posture change is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of automotive electronics testing technology, and in particular relates to a test positioning method and system for automotive head-up display systems based on elliptical regions. Background Technology

[0002] With the development of automotive intelligence, head-up display (HUD) systems, as a key human-machine interface, directly impact driving safety and user experience through their optical performance. Current HUD testing methods generally rely on offline laboratory environments. When testing in a laboratory environment, optical testing is centered around a binocular imaging luminance and colorimeter (binocular camera) to simulate human vision and measure parameters such as brightness, chromaticity, and distortion of the virtual image in the HUD system.

[0003] Currently, when using binocular cameras for positioning via the elliptical region of the human eye, the shape and position of this region dynamically change due to variations in the driver's head posture. This makes it difficult for the binocular camera to accurately capture and locate the elliptical region, thus affecting the accuracy of subsequent measurements of parameters such as brightness and chromaticity. Furthermore, laboratory environments cannot fully simulate real-world driving scenarios; complex lighting conditions, such as backlighting, further exacerbate the instability of binocular camera positioning. Insufficient positioning accuracy necessitates repeated testing to obtain reliable data, increasing testing time and costs. Summary of the Invention

[0004] To address the aforementioned problems, this invention proposes a test positioning method and system for a car head-up display system based on an elliptical region. This invention identifies and extracts the elliptical region of the driver's eye based on the driver's head image; dynamically adjusts the shape and position of the elliptical region based on the driver's head posture; calibrates the binocular camera based on the elliptical region of the eye, obtaining the intrinsic and extrinsic parameters of the camera group; establishes a three-dimensional coordinate system with the midpoint of the camera as the world coordinate origin; and corrects the positioning error of the binocular camera in real time through error compensation based on the dynamic changes of the elliptical region of the eye and the positioning data of the marker points. Through dynamic modeling and marker-assisted positioning, the invention significantly improves the capture accuracy of the binocular camera for the elliptical region of the eye and reduces positioning errors caused by changes in head posture.

[0005] To achieve the above objectives, the present invention is implemented through the following technical solution: In a first aspect, the present invention provides a test positioning method for a car head-up display system based on an elliptical region, comprising: Obtain the driver's head image; Based on the driver's head image, the elliptical region of the human eye is identified and extracted. Specifically, the Viola-Jones framework is used to construct a cascaded classifier by combining Haar-like features and local binary pattern features. The input image is scanned by a multi-scale sliding window to locate the potential eye region. The contour information of the potential eye region is obtained, and noise points are removed using random sampling consistency. Ellipse parameters are estimated based on the least squares method to determine the ellipse center, major and minor axis lengths, and rotation angle. Based on the driver's head posture, the shape and position of the elliptical region of the human eye are dynamically adjusted; Based on the elliptical region of the human eye, the binocular camera is calibrated to obtain the intrinsic and extrinsic parameters of the camera group; a three-dimensional coordinate system is established with the midpoint of the camera as the origin of the world coordinate system. Based on the dynamic changes of the human eye's elliptical region and the positioning data of the marker points, the positioning error of the binocular camera is corrected in real time through error compensation.

[0006] Furthermore, the Viola-Jones framework includes a pre-screening layer, a coarse classification layer, and a fine classification layer. The pre-screening layer uses rectangular features to filter out obvious non-eye regions. The coarse classification layer combines Haar-like features and LBP features for screening. The fine classification layer uses combined features for detection. Haar-like features include edge features, line features, and center-surrounding features, used to capture the brightness variation patterns of the eye region. LBP features capture subtle texture information of the eye through local texture descriptors, enhancing the ability to recognize the pupil and iris boundaries. Feature weight allocation adopts an adaptive weighting strategy, dynamically adjusting the contribution of the two types of features according to the distribution of training samples.

[0007] Furthermore, during the multi-scale sliding window scanning, the image is scanned line by line starting from the upper left corner, with the window size scaled proportionally to cover various sizes from small to large eyes. At each scale, the window size is fixed, and multi-resolution detection is achieved through an image pyramid. The scanning order prioritizes the processing of the central facial region.

[0008] Furthermore, when acquiring the eye contour boundary points, a Gaussian filter is used to smooth the image, reduce noise, determine the image gradient magnitude and direction, apply non-maximum suppression, refine the edge lines to a single pixel width, and determine the true contour boundary points through double threshold detection and edge linking. During denoising, the minimum number of points is randomly selected to form an initial sample set. Based on the selected samples, the coordinates of the ellipse center, major and minor axes, and rotation angle are determined. The distance from all edge points to the ellipse is determined, and those less than the threshold are considered interior points. The number of interior points is counted. If it exceeds the current optimal result, the best model is updated. The process is repeated for a specified number of iterations or until the convergence condition is met, at which point the optimal ellipse model is output.

[0009] Furthermore, in the direct least squares ellipse fitting, the ellipse equation is transformed into matrix form, an overdetermined system of equations is constructed, the parameters are solved by singular value decomposition, and the coordinates of the edge points are normalized.

[0010] Furthermore, when dynamically adjusting the shape and position of the elliptical region of the human eye based on the driver's head posture, in nighttime scenes, the contrast of eye texture is improved, the threshold of edge points for ellipse fitting is relaxed to allow more low-contrast contours to participate in the fitting, and the lower limit of area is reduced; in curve driving scenes, the ellipse search area is expanded along the inside of the curve by a preset percentage, and the upper limit of aspect ratio is relaxed; in strong light scenes, polarization filters and dynamic exposure control are enabled to suppress windshield reflection interference, and edge continuity weight is added to the ellipse confidence score; a multi-frame Kalman filter fusion method is adopted, using the ellipse parameters of consecutive frames as state vectors to construct a four-dimensional state space, predicting the position of the next frame through a motion model, and performing weighted updates based on the current detection results; when the yaw angle exceeds the preset yaw angle or the pitch angle exceeds the preset pitch angle, linear extrapolation is performed based on the nearest ellipse parameters, while the confidence score is reduced.

[0011] Furthermore, Zhang Zhengyou's camera calibration method was used to calibrate the binocular camera and obtain the intrinsic and extrinsic parameters of the camera group.

[0012] Furthermore, marker components are fixed at the driver's forehead, chin, and ear features to acquire marker images; the coordinates of the markers in the binocular camera images are extracted, and the spatial coordinates of the markers in the world coordinate system are determined by combining the camera's intrinsic and extrinsic parameters, thus achieving real-time head positioning.

[0013] Furthermore, based on the dynamic changes of the human eye's elliptical region and the location data of the marker points, an error compensation model is established to correct the positioning error of the binocular camera in real time.

[0014] Secondly, the present invention also provides a test positioning system for a car head-up display system based on an elliptical region, comprising: The data acquisition module is configured to acquire images of the driver's head. The human eye elliptical region determination module is configured to: identify and extract the human eye elliptical region based on the driver's head image; specifically, it uses the Viola-Jones framework to construct a cascaded classifier by combining Haar-like features and local binary pattern features; it scans the input image through a multi-scale sliding window to locate potential eye regions; it obtains the contour information of potential eye regions and removes noise points using random sampling consistency; and it estimates elliptical parameters based on the least squares method to determine the ellipse center, major and minor axis lengths, and rotation angle. The dynamic adjustment module is configured to dynamically adjust the shape and position of the elliptical region of the human eye based on the driver's head posture. The calibration module is configured to: calibrate the binocular camera based on the elliptical region of the human eye, obtain the intrinsic and extrinsic parameters of the camera group; and establish a three-dimensional coordinate system with the midpoint of the camera as the origin of the world coordinate system. The correction module is configured to correct the positioning error of the binocular camera in real time through error compensation based on the dynamic changes of the human eye's elliptical region and the positioning data of the marker points.

[0015] Thirdly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the test positioning method for an elliptical region-based automotive head-up display system described in the first aspect.

[0016] Fourthly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the program to implement the steps of the test positioning method for an elliptical region-based automotive head-up display system described in the first aspect.

[0017] Fifthly, the present invention also provides a computer program product, the computer program product comprising a computer program, which, when executed by a processor, implements the steps of the test positioning method for a car head-up display system based on an elliptical region as described in the first aspect.

[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention identifies and extracts the elliptical region of the human eye based on the driver's head image; dynamically adjusts the shape and position of the elliptical region of the human eye based on the driver's head posture; calibrates the binocular camera based on the elliptical region of the human eye to obtain the intrinsic and extrinsic parameters of the camera group; establishes a three-dimensional coordinate system with the midpoint of the camera as the origin of the world coordinate system; and corrects the positioning error of the binocular camera in real time through error compensation based on the dynamic changes of the elliptical region of the human eye and the positioning data of the marker points; through dynamic modeling and marker-assisted positioning, the binocular camera's capture accuracy of the elliptical region of the human eye is significantly improved, and the positioning error caused by changes in head posture is reduced.

[0019] 2. This invention incorporates an error compensation mechanism, enabling the system to adapt to complex lighting conditions and improving the reliability of test results; by optimizing the positioning process, it reduces the number of repeated tests, thereby reducing test time and costs. Attached Figure Description

[0020] The accompanying drawings, which form part of this embodiment, are used to provide a further understanding of this embodiment. The illustrative embodiments and their descriptions are used to explain this embodiment and do not constitute an improper limitation of this embodiment.

[0021] Figure 1This is a schematic diagram of the elliptical region in Embodiment 1 of the present invention. Detailed Implementation

[0022] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0023] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0024] Example 1: This embodiment provides a test positioning method for a car head-up display system based on an elliptical region, including: S1. Dynamic modeling of the human eye's elliptical region: S1.1 Real-time acquisition of driver's head images using a binocular camera, followed by image processing algorithms to identify and extract the elliptical region of the human eye. Optionally, a cascaded classifier based on multi-feature fusion and a geometrically constrained ellipse fitting algorithm may be employed, including: S1.1.1, Coarse localization stage: Using the improved Viola-Jones framework, a cascaded classifier is constructed by combining Haar-like features and LBP (Local Binary Pattern) features; the input image is scanned by a multi-scale sliding window to quickly locate potential eye regions; skin color probability maps and facial symmetry constraints are introduced to reduce the false detection rate.

[0025] Specifically, the RGB image is converted to grayscale to reduce computational complexity; histogram equalization enhances image contrast and highlights eye region features; image noise is smoothed to preserve edge information. Haar-like feature calculations are used to extract edge, linear, and center-surrounding features of the eye region; LBP feature encoding is used to describe eye texture characteristics, enhancing the robustness of the classifier; and Adaboost ensemble learning is used to combine multiple weak classifiers into a strong classifier.

[0026] The improved Viola-Jones framework combines Haar-like and LBP features to construct a cascaded classifier. The overall architecture employs a multi-layered cascade structure, including a pre-screening layer, a coarse classification layer, and a fine classification layer. The pre-screening layer uses simple rectangular features to quickly filter obvious non-eye regions; the coarse classification layer combines Haar-like and LBP features for medium-precision screening; and the fine classification layer uses complex combined features to achieve high-precision detection.

[0027] Haar-like features include edge features, line features, and center-surrounding features, used to capture the light and dark variation patterns in the eye region; LBP features capture subtle texture information of the eye through local texture descriptors; enhancing the ability to recognize the pupil and iris boundaries; feature weight allocation adopts an adaptive weighting strategy, dynamically adjusting the contribution of the two types of features according to the distribution of training samples.

[0028] The constructed cascaded classifier includes weak classifiers, strong classifiers, and a cascaded structure optimization stage. Each weak classifier makes a binary classification decision based on a single feature and determines whether it is a human eye region by comparing thresholds. The strong classifier uses the AdaBoost algorithm to combine multiple weak classifiers into a strong classifier, improving the detection accuracy layer by layer. In the cascaded structure optimization stage, the first few layers use simple features to achieve fast rejection, while the subsequent layers use complex features to ensure detection accuracy.

[0029] Improvements were made to the training strategy. Specifically, the training samples were expanded by rotating, scaling, and changing the lighting to improve the model's generalization ability. Difficult-to-classify samples were dynamically identified during training to strengthen the learning process. At the same time, the detection accuracy and the ellipse parameter estimation accuracy were optimized. All feature calculations were performed in O(1) time complexity based on integral images. The sliding window step size was dynamically adjusted according to the detection confidence. The calculation was terminated early when the output of the cascaded layer was low.

[0030] In the multi-scale sliding window scanning process, the image is scanned line by line starting from the top left corner, with a preset step size (optional window width of 10%-20%). The window size is scaled proportionally to cover various possible eye sizes, from small to large. At each scale, the window size is fixed. Multi-resolution detection is achieved through an image pyramid, with priority given to the central facial region during scanning. For rapid localization, the simplest Haar features (2-rectangle edge features) are used to quickly filter out obvious non-eye areas. Combined with LBP texture features and skin color probability verification, the candidate region is further narrowed down. Complete elliptical geometric constraints and facial symmetry analysis are applied to confirm the final result.

[0031] When constructing the skin color probability map, a probability density function in the YCbCr color space is established based on a large-scale statistical database of skin colors. For each pixel in the input image, a probability score (0-1 interval) indicating its belonging to a skin region is calculated. A Gaussian mixture model is used to model the skin color distribution, improving adaptability to different lighting conditions. Morphological opening and closing operations are used to smooth the probability map and eliminate noise interference. A skin color threshold is set (usually 0.3-0.7), and windows below the threshold are directly discarded. The average skin color probability within the window is calculated as an important reference factor for classifier decisions. Combined with window position information, the weight of parts deviating from typical facial regions is reduced.

[0032] Facial symmetry constraints are implemented with the bridge of the nose as the central axis, calculating the mirror similarity of the left and right eye regions. Normalized cross-correlation coefficients are used to measure the degree of symmetry, with an ideal value close to 1.0. A vertical brightness gradient consistency check is introduced to enhance robustness to situations such as blinking. When the asymmetry between two candidate eye regions exceeds a threshold (e.g., similarity < 0.6), a re-examination mechanism is triggered. This mechanism incorporates prior knowledge of the relative positions of facial organs (e.g., the distance between the inner corners of the eyes is approximately twice the eye width) to penalize highly asymmetrical results, reducing their final confidence score.

[0033] The system tracks the stability of detection results for the same region between adjacent frames, checks whether candidate regions meet the aspect ratio and area constraints of an ellipse, and verifies the rationality of the spatial relationship between the eye region and adjacent organs such as eyebrows and nose. It automatically adjusts various judgment thresholds based on overall image quality and lighting conditions, appropriately relaxes skin color constraints in complex backgrounds, strengthens the reliance on shape features, monitors the false detection rate in real time, and dynamically optimizes the classifier parameter configuration.

[0034] S1.1.2 Fine Extraction Stage: Canny edge detection is applied to the coarsely located eye region to obtain contour information; RANSAC (Random Sample Consensus) algorithm is used to remove noise points and extract a reliable set of edge points; ellipse parameters are estimated based on the least squares method, and the center, major and minor axis lengths and rotation angles of the ellipse are calculated; the rationality of the ellipse is verified by geometric constraints (aspect ratio range 1.2-3.0, area range 500-5000 pixels).

[0035] Specifically, the Canny operator is used to obtain the eye contour boundary points; outliers are removed using the RANSAC algorithm, retaining valid edge points; the direct least squares method is used to fit the ellipse equation to obtain the optimal parameters; and the aspect ratio, area, and position of the ellipse are checked for reasonableness. Head pitch and yaw angles are calculated using facial key points; the ellipse parameter range is dynamically adjusted according to pose changes; and stability is improved by combining detection results from consecutive frames.

[0036] When the Canny operator obtains the eye contour boundary points, it uses a Gaussian filter to smooth the image and reduce noise. It calculates the image gradient magnitude and direction, often using the Sobel operator, and applies non-maximum suppression to refine edge lines to a single pixel width. Through dual-threshold detection and edge linking, it determines the true contour boundary points. The low threshold is set to 10%-20% of the image's maximum gradient value, and the high threshold is set to 2-3 times the low threshold, following the hysteresis thresholding principle and dynamically adjusting the threshold range based on the texture complexity of the eye region.

[0037] When denoising using the RANSAC algorithm, an initial sample set is randomly selected with a minimum number of points (5 points are required for ellipse fitting). Based on the selected samples, the ellipse parameters (center coordinates, major and minor axes, rotation angle) are calculated. The distance from all edge points to the ellipse is calculated; points less than a threshold are considered inliers. The number of inliers is counted. If the number exceeds the current optimal result, the best model is updated. This process is repeated a specified number of times or until convergence is achieved, at which point the optimal ellipse model is output. The number of iterations is calculated based on the expected success rate and the outlier ratio. The distance threshold is typically set to 2-4 pixel units, and the inlier ratio threshold is set to above 70% to ensure model robustness.

[0038] When fitting an ellipse using the direct least squares method, the ellipse equation Ax² + Bxy + Cy² + Dx + Ey + F = 0 is transformed into matrix form, an overdetermined system of equations is constructed, and the parameters are solved using singular value decomposition (SVD). An ellipse constraint B² - 4AC = -1 is applied to ensure the quadratic curve is an ellipse. Coordinate normalization is performed on edge points to improve numerical stability, and weighting factors are introduced to balance the importance of points in different regions. In the post-processing stage, the geometric rationality of the fitting results is verified.

[0039] When verifying the rationality of ellipse parameters, the aspect ratio is limited to 1.2-3.0 (consistent with human eye physiological characteristics), the area is controlled within 500-8000 pixels² (adapting to different resolutions), the center position should be within the region of interest on the face (based on face detection results), and the rotation angle should not exceed ±30° (corresponding to the normal gaze direction). The area determination threshold is automatically scaled according to image resolution, the aspect ratio range is fine-tuned considering age factors, and the determination criteria for the current frame are corrected by combining historical detection results.

[0040] Head pose is calculated based on facial key points. 68 standard facial key points (including eyes, nose, mouth, etc.) are detected. A 3D reference model is built based on standard frontal and side facial features. Euler angles are obtained by solving the camera projection matrix using the PnP algorithm, and angles around the X-axis (pitch), Y-axis (yaw), and Z-axis (roll) are calculated. KLT optical flow tracing is used to supplement missing key points. A deep learning model is introduced to enhance robustness under occlusion conditions, and multi-frame joint optimization reduces the impact of instantaneous jitter. The head pitch angle [-30°, +30°] is mapped to an ellipse flattening [0.6, 1.0], and the yaw angle [-45°, +45°] affects the range of change in the ellipse's principal axis tilt angle. The distance from the camera determines the upper and lower limits of the ellipse's absolute size. The latest pose angle is calculated and interpolated for each frame to obtain new parameter limits. Smoothing is performed to avoid flickering caused by drastic fluctuations, and safe default parameters are used in abnormal pose conditions.

[0041] Multi-frame fusion is employed to enhance stability. Kalman filtering is used to predict the initial elliptic state of the next frame, which is then weighted and fused with the detection results of the current frame, taking into account historical trends in motion velocity and acceleration. Trajectory links for multiple potential targets are maintained, and the Hungarian algorithm is used to solve the inter-frame matching problem, allowing for a certain recovery period for targets that are temporarily lost. Considering detection confidence, shape regularity, and motion coherence, the weight allocation of each evaluation dimension is adaptively adjusted, and a re-initialization condition is triggered to ensure long-term tracking stability.

[0042] S1.2. Based on the driver's head posture (such as flexion, extension, lateral flexion, rotation, etc.), dynamically adjust the shape and position model of the human eye elliptical region to adapt to different driving scenarios.

[0043] When the driver tilts their head down (negative pitch) or up (positive pitch), the eyes shift in vertical space, and the center of the ellipse moves up and down along the Y-axis. Simultaneously, due to the change in the viewing angle, the major axis of the eye's projection in the image is stretched or compressed accordingly. The major axis parameter is dynamically scaled according to a non-linear function to match the perspective distortion of the physiological structure. When the head turns left or right, the eyes shift horizontally, and the center of the ellipse shifts along the X-axis. Simultaneously, due to the tilt of the eyeballs relative to the camera, the rotation angle θ of the ellipse's principal axis deflects, and its change is approximately linearly proportional to the yaw angle, ensuring that the ellipse always fits the actual eye plane. When the head tilts, the eyes no longer maintain horizontal symmetry, and the minor axis of the ellipse rotates. The system dynamically adjusts the ellipse rotation parameters through a facial symmetry axis correction mechanism to maintain the relative geometric consistency of the binocular ellipse.

[0044] In this embodiment, adaptive adjustments are made based on driving scenarios. Specifically, in nighttime / low-light scenarios, the system automatically switches to infrared imaging mode to enhance eye texture contrast. The edge point threshold for ellipse fitting is relaxed by 15%-20%, allowing more low-contrast contours to participate in the fitting, while the lower limit of the area is lowered to 400 pixels² to avoid missed detections. In cornering scenarios, combining steering wheel angle sensor data and vehicle speed data, the system predicts the direction of gaze deviation, expands the ellipse search area along the inside of the curve by 30%-50%, and temporarily relaxes the upper limit of the aspect ratio to 3.5 to accommodate non-frontal eye positions caused by steering. In strong light / backlight scenarios, a polarizing filter and dynamic exposure control are enabled to suppress windshield reflection interference. Edge continuity weight is added to the ellipse confidence score to reject false contours caused by light spots, ensuring that only the true eye contour is retained.

[0045] A multi-frame Kalman filter fusion method is employed, using the elliptic parameters of consecutive frames as state vectors to construct a four-dimensional state space (x, y, a, b). The position of the next frame is predicted through a motion model, and a weighted update is performed based on the current detection results, effectively suppressing instantaneous jitter and improving trajectory smoothness. When the yaw angle exceeds ±45° or the pitch angle exceeds ±30°, causing keypoint loss, the system enters trajectory-keeping mode. Using the most recent valid elliptic parameters as a reference, linear extrapolation is performed according to the attitude change rate, while the confidence score is reduced to below 0.3, marking it as low-confidence tracking to avoid the model misidentifying it as a new target. During the startup phase, the driver's reference eye elliptic parameters are recorded, and subsequent dynamic adjustments are all based on this reference, achieving personalized adaptation and improving detection consistency under different heights and sitting postures.

[0046] The model was constructed in accordance with relevant human body size standards, using the 95th percentile eye ellipse as the benchmark template. The center coordinates were calculated by combining the H point (hip joint) and the seat back angle, and the major axis length was set to 191.5mm to ensure the universality and compliance of engineering applications.

[0047] The overall process integrates and improves Viola-Jones coarse localization, Canny-RANSAC fine extraction, and least squares ellipse fitting to form a closed loop of detection, fitting, verification, and update, achieving millisecond-level real-time response and meeting the computing power constraints of automotive embedded systems.

[0048] S2, Binocular camera calibration optimization: S2.1. Use Zhang Zhengyou's camera calibration method to calibrate the binocular camera and obtain the intrinsic and extrinsic parameters of the camera group.

[0049] Optionally, calibration is based on a pinhole camera model, mapping 3D world points to 2D image points. Specifically, a homography matrix is ​​established. For each calibration board image, a homography matrix H is calculated using the known 3D world coordinates (chessboard corner points) and the detected 2D pixel coordinates. The intrinsic parameter matrix is ​​solved by using the constraints of the homography matrix H (its column vectors must satisfy specific geometric relationships) to construct a system of linear equations. The camera's intrinsic parameter matrix A (including focal length, principal point coordinates, distortion coefficients, etc.) is solved using the least squares method. The extrinsic parameter matrix is ​​then solved. After obtaining the intrinsic parameters, the extrinsic parameter matrix (rotation matrix R and translation vector t) corresponding to each image can be calculated.

[0050] During calibration, firstly, prepare a calibration board using a checkerboard of known size (e.g., 9x6 or 10x7 with interior corners); acquire images by taking pictures of the calibration board from different angles and distances, ideally 10-20 images to ensure the board covers most of the image area; for corner detection, use a corner detection algorithm (e.g., OpenCV's findChessboardCorners) to accurately extract the pixel coordinates of the checkerboard corners for each image. Then, calculate homography: for each image, combine the known 3D world coordinates and the detected 2D pixel coordinates to calculate the homography matrix H; solve for intrinsic parameters: using the H matrix from all images, construct and solve a system of linear equations to obtain the intrinsic parameter matrix A. Finally, solve for extrinsic parameters: using the obtained intrinsic parameters, calculate the extrinsic parameter matrix [R|t] for each image; and perform distortion correction: using the intrinsic and extrinsic parameters, calculate the distortion coefficients and correct the distortion of the image.

[0051] Calibration quality is assessed using reprojection error, which represents the deviation between the original detected corner point position and the position after reprojecting a 3D world point onto the image plane using the derived camera parameters. A smaller error indicates higher calibration accuracy.

[0052] For the binocular camera in this embodiment, Zhang Zhengyou calibration is performed on the left and right cameras respectively to obtain their intrinsic and extrinsic parameters. Then, stereo correction is achieved by calculating the relative positional relationship between the two cameras (rotation matrix R and translation vector T), laying the foundation for subsequent stereo matching and calculation.

[0053] S2.2 Establish a three-dimensional coordinate system with the midpoint of the two cameras as the origin of the world coordinate system to ensure that the positioning reference of the binocular cameras is updated synchronously with the changes in the driver's head posture.

[0054] Optionally, the midpoint of the line connecting the optical centers of the left and right cameras is chosen as the origin O of the world coordinate system. The Z-axis is defined as the direction parallel to the baseline (the line connecting the optical centers of the left and right cameras), the X-axis lies in the horizontal plane determined by the two camera optical centers and is perpendicular to the Z-axis, and the Y-axis is determined by the right-hand rule, i.e., Y = Z × X, thus establishing a complete right-handed Cartesian coordinate system {O, X, Y, Z}.

[0055] S3, Marker-assisted positioning: S3.1. Fix marker point components at the driver's facial feature locations (such as forehead, chin, ears, etc.) and acquire marker point images through an optical acquisition system.

[0056] Optionally, high-refractive-index microprism reflective materials (such as the 3M Scotchlite™ series) with a diameter of 3–8 mm are used, exhibiting >90% reflectivity in the 850nm or 940nm near-infrared band, ensuring clear identification by infrared cameras even in the absence of visible light. The surface is coated with a dust- and oil-resistant layer, resistant to changes in vehicle interior temperature and humidity (-30°C to +70°C), preventing a decrease in reflectivity due to sweat, grease, or dust. A flexible adhesive backing design conforms to the curves of the skin, causing no discomfort to the driver, and can be repeatedly applied more than 50 times while maintaining adhesion, as shown in Table 1.

[0057] Table 1 Installation Location and Fixing Method Part Installation location description Fixing method Functional Purpose Forehead Located 1–2 cm above the brow bone, slightly above the midline Single-point application, 5mm diameter reflective patch Capture head pitch angle changes as the primary reference point for attitude estimation. jaw The midpoint of the lowest edge of the mandible, close to the skin. Small circular reflective dot (4mm in diameter) Used to calculate the trajectory of mandibular movements, assisting in the identification of yawning and nodding behaviors. Ears The mastoid region behind the ear, avoiding the hairline. Miniature reflective patch (3mm in diameter) or ear hook bracket Provides a three-dimensional spatial reference for head yaw and roll angles, enhancing the robustness of attitude calculation. Optional: A binocular infrared CMOS camera with a resolution ≥1280×720, a frame rate ≥60fps, and support for global shutter to eliminate motion blur. The wavelength selection is 850nm infrared LED illumination to avoid interference from visible light while penetrating part of the skin surface, enhancing the signal-to-noise ratio of reflective points. Lens parameters are: focal length 4.5–5.2mm, F-number ≤2.5, field of view approximately 35°, ensuring coverage of the forehead to chin area (object distance 60–100cm). The synchronization mechanism is: dual-camera time synchronization error <100ns to ensure stereo matching accuracy; infrared light source and camera exposure are triggered synchronously to avoid flicker.

[0058] In this implementation, the infrared illumination intensity is automatically adjusted according to the ambient light level. In strong light, a polarizing filter is activated to suppress windshield reflections, and at night, the gain is automatically increased and the exposure time extended. The spatial coordinates of the marker points, after calibration by Zhang Zhengyou, are mapped to a world coordinate system with the midpoint of the binocular camera as the origin, sharing a unified coordinate framework with the head pose estimation module. When ear marker points are obscured by hair, the system automatically switches to a dual-point pose calculation mode for the forehead and chin to maintain tracking continuity.

[0059] S3.3. Use image processing algorithms to extract the coordinates of the marker points in the stereo camera image, and combine the camera's intrinsic and extrinsic parameters to calculate the spatial coordinates of the marker points in the world coordinate system to achieve real-time head positioning.

[0060] Optionally, in the binocular infrared image, each marker point (forehead, chin, ear) appears as a bright circular spot. First, adaptive threshold segmentation and morphological opening operations are used to suppress background noise and eliminate dust and reflection interference. Non-maximum suppression and center detection algorithms are used to initially locate the center of the marker point. Then, sub-pixel level interpolation optimization (such as Harris corner sub-pixel thinning or Gaussian fitting) is applied to improve the pixel-level coordinate accuracy to within 0.1 pixels, ensuring the stability of subsequent triangulation. For occluded or low-contrast scenes, multi-scale sliding window matching is enabled, and detection is repeated at different resolutions, prioritizing the retention of stable feature points with a confidence level higher than 0.95.

[0061] Using the epipolar correction parameters calibrated by Zhang Zhengyou, the left and right images are aligned to the same horizontal scan line, simplifying the matching of corresponding points from a two-dimensional search to a one-dimensional in-row search, significantly reducing computational complexity. Normalized cross-correlation coefficient (NCC) is used as the matching cost function, and window matching is performed within a ±15 pixel disparity range. The window size is adaptively adjusted from 7×7 to 11×11 to balance accuracy and speed. Left-right consistency checks and sub-pixel interpolation are performed on the matching results to eliminate mismatches. Finally, the precise pixel coordinates of each marker point in the left and right images are output. , )and( , ), and calculate disparity .

[0062] Based on the intrinsic parameter matrix A (including focal length f) obtained from calibration x f With principal point c x c The extrinsic parameter matrix [R|t] (rotation and translation from the left camera to the world coordinate system) converts pixel coordinates into 3D points in the camera coordinate system. ; Using the principles of triangulation, and combining the binocular baseline length B (known to be 120 mm) with the parallax d, the depth is calculated. : ; Transform the 3D points in the left camera coordinate system to the world coordinate system (with the center point of the binoculars as the origin) using an extrinsic parameter matrix: ; in, The coordinates of the point in the world coordinate system; This is the inverse of the rotation matrix of the left camera; These are the coordinates of a 3D point in the left camera coordinate system. Let be the translation vector of the left camera.

[0063] Each marker thus obtains its precise three-dimensional coordinates in the world coordinate system. , , ).

[0064] A rigid body is constructed using three marker points: the forehead, chin, and ear. Their known relative geometric relationships in the world coordinate system (based on physical measurements from the calibration phase) serve as prior information. The Perspective-n-Point (PnP) algorithm is applied, taking the world coordinates of the three marker points and their corresponding image pixel coordinates as input, to solve for the rotation matrix and translation vector of the head relative to the world coordinate system, achieving real-time calculation of 6-DOF attitude (pitch, yaw, roll).

[0065] In some other embodiments, to improve dynamic response stability, a four-dimensional Kalman filter is introduced, using attitude angle and angular velocity as state variables, fusing the previous frame prediction value with the current PnP output, suppressing instantaneous jitter, and outputting a smooth head attitude sequence with an update frequency ≥45Hz.

[0066] S4. Error Compensation Mechanism: Based on the dynamic changes of the human eye's elliptical region and marker point positioning data, an error compensation model is established to correct the positioning error of the binocular camera in real time. Through multiple data acquisitions and iterative optimizations, positioning accuracy is improved.

[0067] Changes in the driver's head posture (such as pitch, yaw, and roll) cause shifts in the ratio of the major and minor axes, rotation angle, and center position of the human eye ellipse. Traditional static models cannot adapt in real time, introducing geometric distortion errors. Subpixel-level localization of marker points (forehead, chin, ears) is affected by lighting, occlusion, or motion blur, leading to coordinate extraction deviations and consequently affecting the accuracy of rigid body pose estimation. Calibration errors of intrinsic parameters (focal length, principal point) and extrinsic parameters (rotation matrix, translation vector) are amplified in dynamic scenes, especially under non-ideal lighting conditions (such as strong backlighting), resulting in depth estimation distortion.

[0068] The error compensation model construction includes: constructing the human eye ellipse parameters (major axis) based on historical detection data. a short axis b Rotation angle θ ,center( xc , yc The dynamic feature library is categorized by head posture (pitch angle). Yaw angle ψ The data is stored in intervals. Each interval includes the reference ellipse parameters and the error correction coefficient (calculated based on the deviation between the actual detected value and the reference value, used for real-time compensation).

[0069] When establishing the marker point error propagation model, the marker point positioning error (Δu, ΔvΔ) is determined. u Δ v The error in rigid body pose estimation (ΔR, Δt) R Δ t The transfer function of ) ; ; The impact of marker point error on attitude estimation is quantified by fitting the transfer function using experimental data.

[0070] During real-time correction, dynamic ellipse parameter prediction is first performed: based on the current head pose estimate ( , ψ , ψ), query the baseline ellipse parameters for the corresponding interval from the feature library, and superimpose the error correction coefficients to generate the predicted ellipse model: ; in, and These are error correction coefficients.

[0071] Then, marker point error compensation is performed: the marker point coordinates (u, v) of the current frame are used to calculate their contribution to the attitude estimation error using the transfer function, and then superimposed on the original extrinsic parameter matrix. ; Finally, stereo camera localization optimization is performed: using the compensated extrinsic parameter matrix and the predicted ellipse model, the head position in the world coordinate system is recalculated. ; Meanwhile, based on the aspect ratio and rotation angle of the predicted ellipse, the disparity calculation of binocular matching is optimized to reduce the depth estimation error caused by ellipse deformation.

[0072] Example 2: This embodiment provides a test positioning system for a car head-up display system based on an elliptical region, including: The data acquisition module is configured to acquire images of the driver's head. The human eye elliptical region determination module is configured to: identify and extract the human eye elliptical region based on the driver's head image; specifically, it uses the Viola-Jones framework to construct a cascaded classifier by combining Haar-like features and local binary pattern features; it scans the input image through a multi-scale sliding window to locate potential eye regions; it obtains the contour information of potential eye regions and removes noise points using random sampling consistency; and it estimates elliptical parameters based on the least squares method to determine the ellipse center, major and minor axis lengths, and rotation angle. The dynamic adjustment module is configured to dynamically adjust the shape and position of the elliptical region of the human eye based on the driver's head posture. The calibration module is configured to: calibrate the binocular camera based on the elliptical region of the human eye, obtain the intrinsic and extrinsic parameters of the camera group; and establish a three-dimensional coordinate system with the midpoint of the camera as the origin of the world coordinate system. The correction module is configured to correct the positioning error of the binocular camera in real time through error compensation based on the dynamic changes of the human eye's elliptical region and the positioning data of the marker points.

[0073] The working method of the system is the same as the test positioning method of the car head-up display system based on the elliptical region in Embodiment 1, and will not be repeated here.

[0074] Example 3: This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the test positioning method for an elliptical region-based car head-up display system described in Embodiment 1.

[0075] Example 4: This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the program, it implements the steps of the test positioning method for an elliptical region-based car head-up display system described in Embodiment 1.

[0076] Example 5: This embodiment provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the test positioning method for a car head-up display system based on an elliptical region as described in Embodiment 1.

[0077] The above description is merely a preferred embodiment of this practice and is not intended to limit the scope of this practice. Various modifications and variations can be made to this practice by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this practice should be included within the protection scope of this practice.

Claims

1. A test positioning method for a car head-up display system based on an elliptical region, characterized in that, include: Obtain the driver's head image; Based on the driver's head image, the elliptical region of the human eye is identified and extracted. Specifically, the Viola-Jones framework is used to construct a cascaded classifier by combining Haar-like features and local binary pattern features. The input image is scanned by a multi-scale sliding window to locate the potential eye region. The contour information of the potential eye region is obtained, and noise points are removed using random sampling consistency. Ellipse parameters are estimated based on the least squares method to determine the ellipse center, major and minor axis lengths, and rotation angle. Based on the driver's head posture, the shape and position of the elliptical region of the human eye are dynamically adjusted; Based on the elliptical region of the human eye, the binocular camera is calibrated to obtain the intrinsic and extrinsic parameters of the camera group; a three-dimensional coordinate system is established with the midpoint of the camera as the origin of the world coordinate system. Based on the dynamic changes of the human eye's elliptical region and the positioning data of the marker points, the positioning error of the binocular camera is corrected in real time through error compensation.

2. The test positioning method for a car head-up display system based on an elliptical region as described in claim 1, characterized in that, The Viola-Jones framework comprises a pre-screening layer, a coarse classification layer, and a fine classification layer. The pre-screening layer uses rectangular features to filter out obvious non-eye regions. The coarse classification layer combines Haar-like features and LBP features for screening. The fine classification layer uses combined features for detection. Haar-like features include edge features, line features, and center-surrounding features, used to capture the brightness variation patterns of the eye region. LBP features capture subtle texture information of the eye through local texture descriptors, enhancing the ability to recognize the pupil and iris boundaries. Feature weight allocation adopts an adaptive weighting strategy, dynamically adjusting the contribution of the two types of features according to the distribution of training samples.

3. The test positioning method for a car head-up display system based on an elliptical region as described in claim 2, characterized in that, During the multi-scale sliding window scanning, the image is scanned line by line starting from the upper left corner and at a preset step size. The window size is scaled proportionally to cover various sizes from small eyes to large eyes. The window size is fixed at each scale. Multi-resolution detection is achieved through an image pyramid, and the central area of ​​the face is processed first in the scanning order.

4. The test positioning method for a car head-up display system based on an elliptical region as described in claim 1, characterized in that, When acquiring the eye contour boundary points, a Gaussian filter is used to smooth the image and reduce noise. The image gradient magnitude and direction are determined, non-maximum suppression is applied, and the edge lines are thinned to a single pixel width. The true contour boundary points are determined through double threshold detection and edge linking. During denoising, the minimum number of points is randomly selected to form an initial sample set. Based on the selected samples, the coordinates of the ellipse center, major and minor axes, and rotation angle are determined. The distance from all edge points to the ellipse is determined. Points less than the threshold are considered interior points. The number of interior points is counted. If the number exceeds the current optimal result, the best model is updated. The process is repeated for a specified number of iterations or until the convergence condition is met, at which point the optimal ellipse model is output.

5. The test positioning method for a car head-up display system based on an elliptical region as described in claim 4, characterized in that, When fitting an ellipse using the direct least squares method, the ellipse equation is transformed into a matrix form, an overdetermined system of equations is constructed, the parameters are solved by singular value decomposition, and the coordinates of the edge points are normalized.

6. The test positioning method for a car head-up display system based on an elliptical region as described in claim 1, characterized in that, When dynamically adjusting the shape and position of the elliptical region of the human eye based on the driver's head posture, in nighttime scenes, the contrast of eye texture is improved, the threshold of edge points for ellipse fitting is relaxed, allowing more low-contrast contours to participate in fitting, while the lower limit of area is reduced; in curve driving scenes, the ellipse search area is expanded along the inside of the curve by a preset percentage, and the upper limit of aspect ratio is relaxed; in strong light scenes, polarizing filters and dynamic exposure control are enabled to suppress windshield reflection interference, and edge continuity weight is added to the ellipse confidence score. A multi-frame Kalman filter fusion method is adopted, which uses the elliptic parameters of consecutive frames as state vectors to construct a four-dimensional state space. The position of the next frame is predicted by the motion model and then weighted and updated in combination with the current detection results. When the yaw angle exceeds the preset yaw angle or the pitch angle exceeds the preset pitch angle, linear extrapolation is performed based on the nearest elliptic parameter, while the confidence score is reduced.

7. The test positioning method for a car head-up display system based on an elliptical region as described in claim 1, characterized in that, The Zhang Zhengyou camera calibration method was used to calibrate the binocular camera and obtain the intrinsic and extrinsic parameters of the camera group.

8. The test positioning method for a car head-up display system based on an elliptical region as described in claim 1, characterized in that, Marker components are fixed at the driver's forehead, chin, and ear features to acquire marker images; the coordinates of the markers in the binocular camera images are extracted, and the spatial coordinates of the markers in the world coordinate system are determined by combining the camera's intrinsic and extrinsic parameters, thus achieving real-time head positioning.

9. The test positioning method for a car head-up display system based on an elliptical region as described in claim 1, characterized in that, Based on the dynamic changes of the elliptical region of the human eye and the positioning data of the marker points, an error compensation model is established to correct the positioning error of the binocular camera in real time.

10. A test positioning system for a car head-up display system based on an elliptical region, characterized in that, include: The data acquisition module is configured to acquire images of the driver's head. The human eye elliptical region determination module is configured to: identify and extract the human eye elliptical region based on the driver's head image; specifically, it uses the Viola-Jones framework to construct a cascaded classifier by combining Haar-like features and local binary pattern features; it scans the input image through a multi-scale sliding window to locate potential eye regions; it obtains the contour information of potential eye regions and removes noise points using random sampling consistency; and it estimates elliptical parameters based on the least squares method to determine the ellipse center, major and minor axis lengths, and rotation angle. The dynamic adjustment module is configured to dynamically adjust the shape and position of the elliptical region of the human eye based on the driver's head posture. The calibration module is configured to: calibrate the binocular camera based on the elliptical region of the human eye, obtain the intrinsic and extrinsic parameters of the camera group; and establish a three-dimensional coordinate system with the midpoint of the camera as the origin of the world coordinate system. The correction module is configured to correct the positioning error of the binocular camera in real time through error compensation based on the dynamic changes of the human eye's elliptical region and the positioning data of the marker points.