Human eye automatic alignment method, system and device and storage medium
By using a forehead bracket and a three-dimensional motion motor on an eye biometer, combined with facial and pupil feature detection, automatic alignment of the human eye is achieved, solving the problem of low detection efficiency in the existing technology and improving alignment accuracy. and accuracy.
Patent Information
- Application Number
- CN202410799148.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-01
AI Technical Summary
Existing eye biometers cannot quickly and fully automatically and accurately achieve human eye alignment, resulting in low detection efficiency.
It uses a forehead support, forehead support motor, three-dimensional motion motor, face camera and ring light. By detecting facial features and pupil ring center, it calculates control parameters and controls the forehead support motor and three-dimensional motion motor for precise alignment.
It achieves precise automatic alignment of the human eye, reduces manpower, reduces manual errors, improves alignment accuracy, and ensures the accuracy and reliability of eye biometer detection.
Smart Images

Figure CN118736657A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical equipment, and in particular to a method, system, device and storage medium for automatic alignment of human eyes. Background Art
[0002] Ocular biometers are essential equipment in ophthalmology clinical diagnosis and treatment, which can help doctors understand ocular biological parameters more accurately and provide corresponding treatment recommendations. Ocular biological parameters include axial length, corneal curvature, corneal thickness, anterior chamber depth, lens thickness, vitreous thickness, as well as corneal diameter, pupil diameter, visual axis eccentricity (Kappa angle) and other parameters. These parameters are of great significance for ophthalmologists to diagnose and treat various eye problems.
[0003] When measuring ocular biological parameters, the ocular biometer needs to quickly capture and lock the position of the eye, and then use infrared light of a specific wavelength and interferometric measurement technology to measure multiple ocular biological parameters non-contactly. Therefore, automatic alignment of the human eye is an important link.
[0004] At present, existing eye biometers can only rely on manual operation of the instrument to find the eye, and cannot quickly and automatically achieve accurate human eye alignment, which in turn affects the detection efficiency. Summary of the invention
[0005] In view of this, the present invention provides a method, system, device and storage medium for automatic alignment of human eyes, so as to solve the problem that the existing eye biometer can only rely on manual operation of the instrument to find the eye, and cannot quickly, fully and automatically accurately achieve human eye alignment, resulting in low detection efficiency.
[0006] In order to solve the above technical problems, the present invention provides a method for automatic alignment of human eyes, which is used for an eye biometer equipped with a forehead support, wherein the eye biometer is further equipped with a forehead support motor and a three-dimensional motion motor; the forehead support motor is used to control the movement of the forehead support, and the three-dimensional motion motor is used to control the movement of the eye biometer in three directions;
[0007] The method comprises:
[0008] Detecting whether a face to be tested is placed on the forehead support;
[0009] When the face to be tested is placed on the forehead support, acquiring a facial image;
[0010] Performing facial feature detection on the facial image to obtain a set of facial key points;
[0011] Calculating an alignment control parameter based on the facial key point set;
[0012] According to the primary alignment control parameters, the forehead support motor and the three-dimensional motion motor are controlled to work respectively to perform primary alignment;
[0013] Acquire the pupil ring image of the face to be tested;
[0014] Performing ring feature detection on the pupil ring image to obtain the target ring center;
[0015] According to the center of the target ring, a secondary alignment control parameter is calculated;
[0016] According to the secondary alignment control parameters, the three-dimensional motion motor is controlled to operate to perform secondary alignment and complete automatic alignment of the human eye.
[0017] Optionally, the forehead support is provided with a forehead support pressure sensor and a forehead temperature sensor; the eye biometer is also equipped with a facial camera and a facial fill light;
[0018] The step of detecting whether a face to be tested is placed on the forehead support includes:
[0019] Real-time monitoring of whether the forehead support pressure sensor and the forehead temperature sensor output signals;
[0020] When the output signal of the forehead support pressure sensor and the output signal of the forehead temperature sensor are monitored simultaneously, it is determined that the face to be tested is placed on the forehead support, and a facial image acquisition instruction is issued; otherwise, it is determined that the face to be tested is not placed on the forehead support, and the facial image acquisition instruction is not issued;
[0021] Correspondingly, when the face to be tested is placed on the forehead support, obtaining a facial image includes:
[0022] When the face to be tested is placed on the forehead support, the facial fill light responds to the facial image acquisition instruction and starts working; at the same time, the facial camera responds to the facial image acquisition instruction and acquires the facial image.
[0023] Optionally, the primary alignment control parameter includes a first ordinate difference between any one of the two eye key points and the chin key point, and a first abscissa difference between the two eye key points in the facial image;
[0024] The step of calculating an alignment control parameter based on the facial key point set includes:
[0025] From the facial key point set, extract the first position coordinates of the chin key point and the second position coordinates of the two eye key points respectively;
[0026] Select the second position coordinate of any eye key point, and calculate the first ordinate difference according to the first position coordinate and the selected second position coordinate;
[0027] The first horizontal coordinate difference is calculated according to the second position coordinates of the two eye key points.
[0028] Optionally, the controlling the forehead support motor and the three-dimensional motion motor to move respectively according to the primary alignment control parameter to perform a primary alignment includes:
[0029] Using a camera imaging formula corresponding to the facial camera, convert the first ordinate difference into a first control distance, and convert the first abscissa difference into a second control distance;
[0030] According to the first control distance and the second control distance, the forehead support motor and the three-dimensional motion motor are controlled to work respectively, so as to respectively control the movement of the forehead support and the movement of the eye biometer in three-dimensional directions, so as to complete an alignment;
[0031] The camera imaging formula is specifically:
[0032]
[0033] Among them, l1 and l2 are the first control distance and the second control distance respectively, z is the preset working distance corresponding to the face camera, f1 is the focal length corresponding to the face camera, y and x are the first vertical coordinate difference and the first horizontal coordinate difference respectively.
[0034] Optionally, the performing facial feature detection on the facial image to obtain a set of facial key points includes:
[0035] Using the RetinaFace face detection model, performing face boundary detection on the face image to obtain face boundary data;
[0036] A Cascade classifier is used to perform regression classification processing on the facial boundary data to obtain the facial key point set; wherein the facial key point set includes 68 facial key points.
[0037] Optionally, performing ring feature detection on the pupil ring image to obtain a target ring center includes:
[0038] Grayscale processing is performed on the pupil ring image to obtain a pupil grayscale image;
[0039] Binarizing the pupil grayscale image to obtain a pupil binary image;
[0040] Performing Hough ring detection on the pupil binary image to obtain a roughly extracted ring center;
[0041] Performing edge detection on the pupil grayscale image to obtain a pupil edge image;
[0042] Taking the center of the roughly extracted circular ring as a reference, sampling is performed at equal angle intervals in the pupil edge image to obtain a plurality of edge sampling points;
[0043] All the edge sampling points are used to perform ellipse fitting to obtain the center of the target ring.
[0044] Optionally, the secondary alignment control parameter includes a second horizontal coordinate difference and a second vertical coordinate difference between the ring center coordinates corresponding to the target ring center and the image center coordinates corresponding to the pupil ring image;
[0045] The calculating of the secondary alignment control parameters according to the target ring center includes:
[0046] Extracting the image center coordinates corresponding to the pupil ring image, calculating the deviation between the ring center coordinates and the image center coordinates, and obtaining the second horizontal coordinate difference and the second vertical coordinate difference respectively;
[0047] The three-dimensional motion motor includes an x-direction motor, a y-direction motor and a z-direction motor, wherein the x-direction motor is used to control the eye biometer to move in the x-direction, the y-direction motor is used to control the eye biometer to move in the y-direction, and the z-direction motor is used to control the eye biometer to move in the z-direction;
[0048] Correspondingly, controlling the three-dimensional motion motor to work according to the secondary alignment control parameter to perform secondary alignment includes:
[0049] Determine a first movement direction of the eye biometer in the x direction controlled by the x-direction motor according to the positive or negative value of the second horizontal coordinate difference; and determine a second movement direction of the eye biometer in the z direction controlled by the z-direction motor according to the positive or negative value of the second vertical coordinate difference;
[0050] According to the first movement direction, the x-direction motor is controlled to work so as to control the eye biometer to move in the x-direction, and the second horizontal coordinate difference is recalculated after the movement, until the absolute value of the recalculated second horizontal coordinate difference is less than a first preset threshold, and the x-direction motor is stopped from working;
[0051] According to the second movement direction, the z-direction motor is controlled to operate so as to control the eye biometer to move in the z-direction, and the second longitudinal coordinate difference is recalculated after the movement, until the absolute value of the recalculated second longitudinal coordinate difference is less than a second preset threshold, the z-direction motor is stopped from being controlled to complete the secondary alignment.
[0052] In addition, the present invention also proposes a human eye automatic alignment system, which is used for an eye biometer equipped with a forehead support, wherein the eye biometer is also equipped with a forehead support motor and a three-dimensional motion motor; the forehead support motor is used to control the movement of the forehead support, and the three-dimensional motion motor is used to control the movement of the eye biometer in a three-dimensional direction;
[0053] The system is applied to the aforementioned human eye automatic alignment method, comprising:
[0054] A facial image acquisition module, used to detect whether a face to be tested is placed on the forehead support; and to acquire a facial image when the face to be tested is placed on the forehead support;
[0055] A facial feature detection module, used to perform facial feature detection on the facial image to obtain a set of facial key points;
[0056] A first calculation module, used for calculating a primary alignment control parameter according to the facial key point set;
[0057] A primary alignment module, used to control the forehead support motor and the three-dimensional motion motor to work respectively according to the primary alignment control parameters, so as to perform a primary alignment;
[0058] A pupil image acquisition module, used to acquire a pupil ring image of the face to be tested;
[0059] A pupil feature detection module, used to perform ring feature detection on the pupil ring image to obtain the target ring center;
[0060] A second calculation module, used for calculating a secondary alignment control parameter according to the center of the target ring;
[0061] The secondary alignment module is used to control the three-dimensional motion motor to work according to the secondary alignment control parameters to perform secondary alignment and complete automatic alignment of the human eye.
[0062] In addition, the present invention also proposes an automatic human eye alignment device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method steps of the aforementioned automatic human eye alignment method when executed.
[0063] In addition, the present invention also proposes a computer storage medium, which includes: at least one instruction, and when the instruction is executed by a computer, the method steps of the aforementioned human eye automatic alignment method are implemented.
[0064] The human eye automatic alignment method, system, device and storage medium provided by the present invention, when a face to be detected is placed on a forehead bracket, a facial image is obtained, the facial image can reflect the deviation of the pupil center to a certain extent, and a set of multiple facial key points (i.e., a facial key point set) is obtained through facial feature detection, which is convenient for subsequent image analysis based on the facial image to obtain a primary alignment control parameter; and then it is convenient to control the forehead bracket motor and the three-dimensional motion motor to work according to the primary alignment control parameter, so as to control the entire eye biometer to move once, and realize preliminary human eye automatic alignment; after completing the primary alignment, a pupil ring image is obtained again, and the pupil ring photo contains the ring image of the upper and lower halves formed by the ring light on the cornea; through the ring feature detection, the real pupil center (i.e., the target ring center) can be obtained; based on the target ring center, a secondary alignment control parameter is calculated, so as to control the three-dimensional motion motor to work again, and then control the entire eye biometer to move again, and truly realize automatic human eye fine alignment;
[0065] The human eye automatic alignment method, system, device and storage medium of the present invention can realize accurate human eye automatic alignment, reduce manpower, reduce manual errors and improve alignment accuracy, thereby ensuring the accuracy and reliability of the eye biometer in detecting various eye biological parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0067] Figure 1 A flow chart of a method for automatic alignment of human eyes in Embodiment 1 of the present invention is shown;
[0068] Figure 2 A flowchart of acquiring a facial image in Embodiment 1 of the present invention is shown;
[0069] Figure 3 A flow chart of obtaining a set of facial key points in Embodiment 1 of the present invention is shown;
[0070] Figure 4 A flow chart showing calculation of a primary alignment control parameter in the first embodiment of the present invention is shown;
[0071] Figure 5 A flow chart showing a primary alignment according to a primary alignment control parameter in the first embodiment of the present invention is shown;
[0072] Figure 6 A flow chart of obtaining the center of a target ring in the first embodiment of the present invention is shown;
[0073] Figure 7 A flow chart showing secondary alignment according to secondary alignment control parameters in Embodiment 1 of the present invention is shown;
[0074] Figure 8 The structure diagram of a human eye automatic alignment system in the second embodiment of the present invention is shown. DETAILED DESCRIPTION
[0075] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0076] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0077] Embodiment 1
[0078] This embodiment provides a method for automatic alignment of human eyes, which is used for an eye biometer equipped with a forehead support, wherein the eye biometer is further equipped with a forehead support motor and a three-dimensional motion motor; the forehead support motor is used to control the movement of the forehead support, and the three-dimensional motion motor is used to control the movement of the eye biometer in three directions;
[0079] like Figure 1 As shown, the method includes:
[0080] S1: Detecting whether a face to be tested is placed on the forehead support;
[0081] S2: when the face to be tested is placed on the forehead support, acquiring a facial image;
[0082] S3: performing facial feature detection on the facial image to obtain a set of facial key points;
[0083] S4: calculating and obtaining a primary alignment control parameter according to the set of facial key points;
[0084] S5: According to the primary alignment control parameter, the forehead support motor and the three-dimensional motion motor are controlled to work respectively to perform a primary alignment;
[0085] S6: Acquire the pupil ring image of the face to be tested;
[0086] S7: Performing ring feature detection on the pupil ring image to obtain the target ring center;
[0087] S8: Calculate and obtain secondary alignment control parameters according to the target ring center;
[0088] S9: According to the secondary alignment control parameters, the three-dimensional motion motor is controlled to operate to perform secondary alignment and complete automatic alignment of the human eye.
[0089] In this embodiment, when a face to be detected is placed on the forehead support, a facial image is obtained, which can reflect the deviation of the pupil center to a certain extent. A set of multiple facial key points (i.e., a facial key point set) is obtained through facial feature detection, which is convenient for subsequent image analysis based on the facial image to obtain a primary alignment control parameter; and then it is convenient to control the forehead support motor and the three-dimensional motion motor to work according to the primary alignment control parameter, so as to control the entire eye biometer to move once, and realize preliminary automatic alignment of the human eye; after the primary alignment is completed, a pupil ring image is obtained again, and the pupil ring photo contains the ring image of the upper and lower halves formed by the ring light on the cornea; through the ring feature detection, the real pupil center (i.e., the target ring center) can be obtained; based on the target ring center, the secondary alignment control parameter is calculated, which is convenient for controlling the three-dimensional motion motor to work again, and then controlling the entire eye biometer to move again, and truly realizing automatic fine alignment of the human eye.
[0090] The human eye automatic alignment method of this embodiment can achieve accurate human eye automatic alignment, reduce manpower, reduce manual errors and improve alignment accuracy, thereby ensuring the accuracy and reliability of the eye biometer in detecting various eye biological parameters.
[0091] Each step of the method for automatic eye alignment in this embodiment is described in detail below.
[0092] The forehead support of this embodiment includes a first support and a second support, the first support is used to support and fix the user's chin, and the second support is used to fix the user's forehead; in actual design, the first support and the second support can be provided on the eye biometer as an integral structure, or as two independent structures, depending on the specific situation.
[0093] Preferably, a forehead support pressure sensor and a forehead temperature sensor are provided on the forehead support; further, the forehead support pressure sensor is provided on the first support, and the forehead temperature sensor is provided on the second support.
[0094] Through the forehead support pressure sensor and forehead temperature sensor, it is convenient to detect whether the user's face is correctly placed on the forehead support, ensuring the reliability of human eye alignment, and further ensuring the reliability of the eye biometer.
[0095] Preferably, the eye biometrics meter is also equipped with a facial camera and a facial fill light.
[0096] The facial camera makes it convenient to collect facial images when the face to be tested is placed on the forehead support; the facial fill light makes it convenient to fill in the light of the face when the facial camera collects the facial image, thereby improving the image quality of the facial image and ensuring the accuracy of eye alignment to a certain extent.
[0097] like Figure 2 As shown, this embodiment S1 includes:
[0098] S11: monitoring in real time whether the forehead support pressure sensor and the forehead temperature sensor output signals;
[0099] S12: when the output signal of the forehead support pressure sensor and the output signal of the forehead temperature sensor are monitored simultaneously, it is determined that the face to be tested is placed on the forehead support, and a facial image acquisition instruction is issued; otherwise, step S13 is executed;
[0100] S13: Determine that the face to be tested is not placed on the forehead support, and do not issue the facial image acquisition instruction.
[0101] When the face of the user to be tested (i.e., the face to be tested) is placed on the forehead support, the forehead support pressure sensor can detect the pressure applied by the chin of the user to be tested; at the same time, the forehead temperature sensor can detect the temperature of the forehead of the user to be tested; if the output signal of the forehead support pressure sensor and the output signal of the forehead temperature sensor are monitored at the same time, it means that the face to be tested is placed on the forehead support at this time, and the user to be tested needs to use the eye biometer to detect relevant eye biological parameters, then a facial image acquisition instruction is issued to trigger the start of the human eye automatic alignment process; otherwise, when it is monitored that at least one of the forehead support pressure sensor and the forehead temperature sensor does not output a signal, it means that the face to be tested is not placed on the forehead support, then no facial image acquisition instruction is issued, and the start of the human eye automatic alignment process is not triggered.
[0102] Correspondingly, this embodiment S2 includes:
[0103] When the face to be tested is placed on the forehead support, the facial fill light responds to the facial image acquisition instruction and starts working; at the same time, the facial camera responds to the facial image acquisition instruction and acquires the facial image.
[0104] When a facial image acquisition instruction is issued, the facial fill light first responds to the facial image acquisition instruction and starts working, which can illuminate the forehead support, thereby achieving fill light for the face to be tested on the forehead support, and ensuring the quality of the facial image; then the facial camera responds to the facial image acquisition instruction and shoots the face to be tested to obtain a facial image. This embodiment can achieve the start control of acquiring a facial image through the triggering of the facial image acquisition instruction and the response of the facial fill light and the facial camera, thereby achieving the intelligent start of the entire human eye automatic alignment process.
[0105] like Figure 3 As shown, this embodiment S3 includes:
[0106] S31: using the RetinaFace face detection model to perform face boundary detection on the face image to obtain face boundary data;
[0107] S32: using a Cascade classifier to perform regression classification processing on the facial boundary data to obtain the facial key point set; wherein the facial key point set includes 68 facial key points.
[0108] The RetinaFace face detection model is a high-precision face detection model that uses the Feature Pyramid Network (FPN) architecture for hierarchical processing to detect small faces. The model uses ResNet50 as its backbone and provides feature vectors of multiple layers of ResNet50 to the detection stage. RetinaFace is trained on the WIDERFACE dataset, which contains 32,203 images and 393,703 high-precision face bounding boxes. The dataset covers the changes in scale, posture, expression, occlusion, and lighting of the face, providing a wealth of training samples for the model. It can output three types of detection results: the first is the confidence of face classification, which is used to determine whether the detection area is a face; the second is the coordinate information of the bounding box, which is used to determine the position and size of the face in the image; the third is the coordinate information of facial feature points, such as the position coordinates of key points such as eyes, nose, and mouth. Therefore, the use of the RetinaFace face detection model can make face detection more accurate and reliable, obtain accurate face boundary data, and provide rich information on facial feature points, providing important data support for the subsequent calculation of primary alignment control parameters.
[0109] The Cascade classifier is a strong classifier composed of a series of weak classifiers (such as Haar features or Local Binary Patterns (LBP) feature classifiers). It uses a cascade method to gradually filter out non-target areas through multiple stages. The weak classifiers in each stage detect specific features or patterns. Therefore, this embodiment uses the Cascade classifier to regress facial boundary data, which can further improve the accuracy and efficiency of facial detection.
[0110] Among them, the specific operation methods of the RetinaFace face detection model and the Cascade cascade classifier all adopt conventional operation methods, and the specific details are not repeated here.
[0111] In this embodiment, the primary alignment control parameter includes a first ordinate difference between any one of the two eye key points and the chin key point, and a first abscissa difference between the two eye key points in the facial image;
[0112] like Figure 4 As shown, this embodiment S4 includes:
[0113] S41: extracting the first position coordinates of the chin key point and the second position coordinates of the two eye key points from the set of facial key points respectively;
[0114] S42: Select the second position coordinate of any eye key point, and calculate the first vertical coordinate difference according to the first position coordinate and the selected second position coordinate;
[0115] S43: Calculate the first horizontal coordinate difference according to the second position coordinates of the two eye key points.
[0116] In the primary alignment control parameters, the first ordinate difference can reflect the difference in the distance between the eyes and the chin in the up and down directions in the real environment, and the first abscissa difference can reflect the difference in the distance between the eyes in the left and right directions in the real environment. Therefore, both the first abscissa difference and the second ordinate difference can preliminarily reflect the deviation in the placement position of the eyes of the user to be tested. Adjustment based on the primary alignment control parameters containing the two data can realize adjustment of the placement position of the eyes of the user to be tested, so as to achieve coarse alignment of the center of the human eye; based on the coarse alignment, the efficiency and accuracy of the subsequent secondary alignment can be improved, thereby realizing automated fine alignment of the human eye.
[0117] like Figure 5 As shown, this embodiment S5 includes:
[0118] S51: using a camera imaging formula corresponding to the facial camera, converting the first ordinate difference into a first control distance, and converting the first abscissa difference into a second control distance;
[0119] S52: According to the first control distance and the second control distance, the forehead support motor and the three-dimensional motion motor are controlled to work respectively, so as to respectively control the movement of the forehead support and the movement of the eye biometer in three-dimensional directions, thereby completing an alignment;
[0120] The camera imaging formula is specifically:
[0121]
[0122] Among them, l1 and l2 are the first control distance and the second control distance respectively, z is the preset working distance corresponding to the face camera, f1 is the focal length corresponding to the face camera, y and x are the first vertical coordinate difference and the first horizontal coordinate difference respectively.
[0123] The first control distance is the difference in distance between the eye and the chin in the up-down direction in the real environment, and the second control distance is the difference in distance between the eyes in the left-right direction in the real environment. Based on the imaging principle of the facial camera, the two distance differences have a certain relationship with the first ordinate difference and the first abscissa difference. Therefore, in the one-time alignment process of this embodiment, the first control distance and the second control distance are first calculated using the camera imaging formula corresponding to the facial camera, and then the first control distance and the second control distance are used to control the forehead support motor and the three-dimensional motion motor to work respectively, thereby controlling the forehead support movement and the eye biometer movement in the three-dimensional direction respectively. Simple imaging knowledge can be used to accurately and efficiently adjust the placement position of the eyes of the user to be tested to achieve rough alignment of the center of the human eye.
[0124] Specifically, the three-dimensional motion motor includes an x-direction motor, a y-direction motor and a z-direction motor, the x-direction motor is used to control the eye biometer to move in the x-direction, the y-direction motor is used to control the eye biometer to move in the y-direction, and the z-direction motor is used to control the eye biometer to move in the z-direction.
[0125] In the above S52, after the first control distance and the second control distance are obtained, the designated position of the eyes of the user to be measured at the placement position can be determined. At this time, by simultaneously controlling the forehead support motor, the x-direction motor, the y-direction motor and the z-direction motor, the operation and control of the forehead support and the three-dimensional movement of the eye biometer in the x-direction, y-direction and z-direction (specifically, left and right, front and back, and up and down) can be realized, so that the eyes can be found in a large range fully automatically, thereby completing the automatic rough alignment of the human eyes.
[0126] Specifically, the eye biometer is further configured with a pupil camera and a ring light. In this embodiment, when an alignment is completed once, a pupil image acquisition instruction is issued in S5. Then, in S6, the ring light responds to the pupil image acquisition instruction, starts working, and illuminates the user's eyes. The user's eyes reflect light to the pupil camera. At the same time, the pupil camera also responds to the pupil image acquisition instruction and acquires the pupil ring image.
[0127] Specifically, the circular ring light can be arranged on or near the forehead support, and the pupil circular ring image is a black and white image.
[0128] like Figure 6 As shown, this embodiment S7 includes:
[0129] S71: grayscale the pupil ring image to obtain a pupil grayscale image;
[0130] S72: performing binarization processing on the pupil grayscale image to obtain a pupil binary image;
[0131] S73: Performing Hough ring detection on the pupil binary image to obtain a roughly extracted ring center;
[0132] S74: performing edge detection on the pupil grayscale image to obtain a pupil edge image;
[0133] S75: Taking the center of the roughly extracted circular ring as a reference, sampling is performed at equal angle intervals in the pupil edge image to obtain a plurality of edge sampling points;
[0134] S76: Perform ellipse fitting using all the edge sampling points to obtain the target ring center.
[0135] In this embodiment, the contrast of the pupil ring image can be increased and the image quality can be adjusted by grayscale processing, so as to facilitate the subsequent improvement of the accuracy of pupil center detection; the pupil ring image can be simplified by binarization processing, the amount of data can be reduced, and the influence of irrelevant factors on the subsequent pupil center detection can be avoided, and the efficiency of pupil center detection can be improved to a certain extent; Hough ring detection is an extended algorithm based on Hough transform, which can map the circle in the image space to the point in the parameter space to find the circular contour. Therefore, this embodiment can achieve the rough extraction of the pupil center image and obtain the rough extracted ring center by Hough ring detection; then edge detection (specifically, Canny edge detection method) can be used to accurately extract the pupil edge to form a binary edge image; taking the roughly extracted ring center (i.e., pupil center) as the reference, equal-angle interval sampling is performed on the pupil edge image, wherein the equal-angle interval sampling can ensure that the sampling points are evenly obtained on the pupil edge, thereby reducing the error caused by pupil shape change or noise interference, and has good adaptability to pupils of different sizes, shapes, and rotation angles. Therefore, for different pupils, a series of sampling points distributed on the pupil edge can be quickly obtained, and these sampling points can effectively characterize the shape and position of the pupil edge; finally, based on these sampling points, ellipse fitting is performed to obtain the accurate position of the pupil edge and the pupil center, wherein the accurate position of the pupil center is the target ring center.
[0136] The specific operation methods of the grayscale processing, binarization processing, Hough ring detection, edge detection and other steps in the above steps all adopt the conventional operation methods in image processing, and the specific details are not repeated here.
[0137] Specifically, in S8, the secondary alignment control parameter includes a second horizontal coordinate difference and a second vertical coordinate difference between the ring center coordinates corresponding to the target ring center and the image center coordinates corresponding to the pupil ring image;
[0138] This embodiment S8 includes:
[0139] The image center coordinates corresponding to the pupil ring image are extracted, and the deviation between the ring center coordinates and the image center coordinates is calculated to obtain the second horizontal coordinate difference and the second vertical coordinate difference respectively.
[0140] The image center coordinates corresponding to the image center in the pupil ring image are obtained, which include abscissas and ordinates, and the deviation between the center coordinates of the ring and the image center coordinates is calculated (including the deviation between the abscissas in the center coordinates of the ring and the abscissas in the center coordinates of the image and the deviation between the ordinates in the center coordinates of the ring and the ordinates in the center coordinates of the image), and the second abscissa deviation and the second ordinate deviation can be obtained respectively, and the two deviations reflect the deviation of the pupil center. In this embodiment, the two deviations are used as secondary alignment control parameters to realize the control of the three-dimensional motion motor, and the deviation of the pupil center can be finely adjusted, thereby truly realizing the automatic fine alignment of the human eye.
[0141] like Figure 7 As shown, this embodiment S9 includes:
[0142] S91: determining a first movement direction of the eye biometer in the x direction controlled by the x-direction motor according to the positive or negative value of the second horizontal coordinate difference; and determining a second movement direction of the eye biometer in the z direction controlled by the z-direction motor according to the positive or negative value of the second vertical coordinate difference;
[0143] S92: according to the first movement direction, controlling the x-direction motor to work, so as to control the eye biometer to move in the x-direction, and recalculating the second horizontal coordinate difference after the movement, until the absolute value of the recalculated second horizontal coordinate difference is less than a first preset threshold, and then stopping controlling the x-direction motor to work;
[0144] S93: According to the second movement direction, the z-direction motor is controlled to operate to control the eye biometer to move in the z-direction, and the second ordinate difference is recalculated after the movement, until the absolute value of the recalculated second ordinate difference is less than a second preset threshold, and the z-direction motor is stopped from operating to complete the secondary alignment.
[0145] The positive or negative sign of the second horizontal coordinate difference reflects the directional deviation of the pupil center in the x direction (specifically, the left-right direction), the positive or negative sign of the second vertical coordinate difference reflects the directional deviation of the pupil center in the z direction (specifically, the up-down direction), the value of the second horizontal coordinate difference (i.e., the absolute value of the second horizontal coordinate difference) reflects the distance deviation of the pupil center in the left-right direction, and the value of the second vertical coordinate difference (i.e., the absolute value of the second vertical coordinate difference) reflects the distance deviation of the pupil center in the up-down direction; this embodiment first determines the first movement direction of the x-direction motor-controlled eye biometer in the x direction and the first movement direction of the z-direction motor-controlled eye biometer in the z direction according to the positive or negative sign of the second horizontal coordinate difference and the positive or negative sign of the second vertical coordinate difference. The second movement direction is controlled based on the two movement directions, and the two motors are controlled to work respectively, thereby controlling the movement of the entire eye biometer in the two directions respectively; then the new second horizontal coordinate difference and the second vertical coordinate difference are recalculated. Once the absolute value of the new second horizontal coordinate difference is less than the first preset threshold value, it means that there is no distance deviation between the pupil center in the left and right directions at this time, and the x-direction motor can be controlled to stop working, thereby stopping the movement of the eye biometer in the x direction; similarly, once the absolute value of the new second vertical coordinate difference is less than the second preset threshold value, it means that there is no distance deviation between the pupil center in the up and down directions at this time, and the z-direction motor can be controlled to stop working, thereby stopping the movement of the eye biometer in the z direction, and completing the secondary alignment. Through the above steps S91 to S93, this embodiment can realize fully automatic small-range fine adjustment, and truly realize the final automated fine alignment of the human eye.
[0146] It should be understood that the execution order of steps S92 and S93 in this embodiment is not specific, that is, step S92 can be executed first and then step S93, or step S93 can be executed first and then step S92, or they can be executed simultaneously, which is not limited in this embodiment.
[0147] This embodiment uses the complete human eye automatic alignment method described in S1 to S9 above to achieve fully automatic human eye precise alignment when the eye biometer is unattended, effectively ensuring the accuracy and reliability of the eye biometer in detecting various eye biological parameters, and greatly improving the detection speed and detection accuracy.
[0148] Embodiment 2
[0149] An automatic human eye alignment system is used for an eye biometer equipped with a forehead support, wherein the eye biometer is also equipped with a forehead support motor and a three-dimensional motion motor; the forehead support motor is used to control the movement of the forehead support, and the three-dimensional motion motor is used to control the movement of the eye biometer in three directions;
[0150] The system is applied to the human eye automatic alignment method in the first embodiment, such as Figure 8 As shown, including:
[0151] A facial image acquisition module, used to detect whether a face to be tested is placed on the forehead support; and to acquire a facial image when the face to be tested is placed on the forehead support;
[0152] A facial feature detection module, used to perform facial feature detection on the facial image to obtain a set of facial key points;
[0153] A first calculation module, used for calculating a primary alignment control parameter according to the facial key point set;
[0154] A primary alignment module, used to control the forehead support motor and the three-dimensional motion motor to work respectively according to the primary alignment control parameters, so as to perform a primary alignment;
[0155] A pupil image acquisition module, used to acquire a pupil ring image of the face to be tested;
[0156] A pupil feature detection module, used to perform ring feature detection on the pupil ring image to obtain the target ring center;
[0157] A second calculation module, used for calculating a secondary alignment control parameter according to the center of the target ring;
[0158] The secondary alignment module is used to control the three-dimensional motion motor to work according to the secondary alignment control parameters to perform secondary alignment and complete automatic alignment of the human eye.
[0159] In the automatic eye alignment system of this embodiment, when a face to be detected is placed on the forehead support, a facial image is acquired by using a facial image acquisition module, and the deviation of the pupil center can be reflected to a certain extent. The facial feature detection module performs facial feature detection to obtain a set of multiple facial key points (i.e., a facial key point set), so that the first calculation module can perform image analysis based on the facial image to obtain a primary alignment control parameter; and then the primary alignment module can be used to control the forehead support motor and the three-dimensional motion motor to work according to the primary alignment control parameter to control the entire eye biometric measurement. The instrument moves once, which can realize preliminary automatic alignment of human eyes; after completing the primary alignment, the pupil image acquisition module is used to obtain the pupil ring image, and the pupil ring photo contains the ring images of the upper and lower halves formed by the ring light on the cornea; the pupil feature detection module is used to detect the ring features, and the real pupil center (that is, the target ring center) can be obtained; the second calculation module is used to calculate the secondary alignment control parameters based on the target ring center, so that the secondary alignment module is used to control the three-dimensional motion motor to work again, and then the entire eye biometer is controlled to move again, so as to truly realize the automatic fine alignment of human eyes.
[0160] The human eye automatic alignment system of this embodiment can realize fully automatic human eye precise alignment when the eye biometer is unattended, effectively ensure the accuracy and reliability of the eye biometer in detecting various eye biological parameters, and greatly improve the detection speed and detection accuracy.
[0161] The functions of each module in the human eye automatic alignment system described in this embodiment correspond to the method steps in the human eye automatic alignment method described in Example 1. Therefore, for details not included in this embodiment, please refer to Example 1 and Figures 1 to 7 The detailed description will not be repeated here.
[0162] Embodiment 3
[0163] This embodiment also provides a human eye automatic alignment device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method steps of the human eye automatic alignment method of the first embodiment when executed.
[0164] By storing the computer program in the memory and running it on the processor, the fully automatic accurate alignment of the human eye can be realized when the ocular biometer is unattended, effectively ensuring the accuracy and reliability of the ocular biometer in detecting various ocular biological parameters, and greatly improving the detection speed and accuracy.
[0165] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of a computer device, and uses various interfaces and lines to connect various parts of the entire computer device.
[0166] The memory can be used to store computer programs and / or models. The processor realizes various functions of the computer device by running or executing the computer programs and / or models stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, video data, etc.). In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0167] It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by a computer program. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0168] These computer programs may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0169] These computer programs can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0170] This embodiment also provides a computer storage medium, which includes: at least one instruction, which implements the method steps of the human eye automatic alignment method of embodiment 1 when the instruction is executed by the computer.
[0171] By executing a computer storage medium containing at least one instruction, fully automatic accurate alignment of human eyes can be achieved when the eye biometer is unattended, effectively ensuring the accuracy and reliability of the eye biometer in detecting various eye biological parameters, and greatly improving the detection speed and detection accuracy.
[0172] Similarly, for details not yet provided in this embodiment, please refer to Embodiment 1, Embodiment 2 and Figures 1 to 8 The detailed description will not be repeated here.
[0173] Obviously, the embodiments described above are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, ordinary technicians in this field can make other different forms of changes or modifications without creative work, which should fall within the scope of protection of the present invention.
Claims
1. A method for automatic alignment of human eyes, for use in an eye biometer provided with a forehead bracket, characterized in that: The eye biometer is also equipped with a forehead support motor and a three-dimensional motion motor; the forehead support motor is used to control the movement of the forehead support, and the three-dimensional motion motor is used to control the movement of the eye biometer in three-dimensional directions; The method comprises: Detecting whether a face to be tested is placed on the forehead support; When the face to be tested is placed on the forehead support, acquiring a facial image; Performing facial feature detection on the facial image to obtain a set of facial key points; Calculating an alignment control parameter based on the facial key point set; According to the primary alignment control parameters, the forehead support motor and the three-dimensional motion motor are controlled to work respectively to perform primary alignment; Acquire the pupil ring image of the face to be tested; Performing ring feature detection on the pupil ring image to obtain the target ring center; According to the center of the target ring, a secondary alignment control parameter is calculated; According to the secondary alignment control parameters, the three-dimensional motion motor is controlled to operate to perform secondary alignment and complete automatic alignment of the human eye.
2. The method according to claim 1, characterized in that The forehead support is provided with a forehead support pressure sensor and a forehead temperature sensor; the eye biometer is also equipped with a facial camera and a facial fill light; The step of detecting whether a face to be tested is placed on the forehead support includes: Real-time monitoring of whether the forehead support pressure sensor and the forehead temperature sensor output signals; When the output signal of the forehead support pressure sensor and the output signal of the forehead temperature sensor are monitored simultaneously, it is determined that the face to be tested is placed on the forehead support, and a facial image acquisition instruction is issued; otherwise, it is determined that the face to be tested is not placed on the forehead support, and the facial image acquisition instruction is not issued; Correspondingly, when the face to be tested is placed on the forehead support, obtaining a facial image includes: When the face to be tested is placed on the forehead support, the facial fill light responds to the facial image acquisition instruction and starts working; at the same time, the facial camera responds to the facial image acquisition instruction and acquires the facial image.
3. The method according to claim 2, characterized in that The primary alignment control parameter includes a first ordinate difference between any one of the two eye key points and the chin key point, and a first abscissa difference between the two eye key points in the facial image; The step of calculating an alignment control parameter based on the facial key point set includes: From the facial key point set, extract the first position coordinates of the chin key point and the second position coordinates of the two eye key points respectively; Select the second position coordinate of any eye key point, and calculate the first ordinate difference according to the first position coordinate and the selected second position coordinate; The first horizontal coordinate difference is calculated according to the second position coordinates of the two eye key points.
4. The method according to claim 3, characterized in that The method of controlling the forehead support motor and the three-dimensional motion motor to move respectively according to the primary alignment control parameter to perform a primary alignment includes: Using a camera imaging formula corresponding to the facial camera, convert the first ordinate difference into a first control distance, and convert the first abscissa difference into a second control distance; According to the first control distance and the second control distance, the forehead support motor and the three-dimensional motion motor are controlled to work respectively, so as to respectively control the movement of the forehead support and the movement of the eye biometer in three-dimensional directions, so as to complete an alignment; The camera imaging formula is specifically: Among them, l1 and l2 are the first control distance and the second control distance respectively, z is the preset working distance corresponding to the face camera, f1 is the focal length corresponding to the face camera, y and x are the first vertical coordinate difference and the first horizontal coordinate difference respectively.
5. The method according to claim 1, characterized in that The step of performing facial feature detection on the facial image to obtain a set of facial key points includes: Using the RetinaFace face detection model, performing face boundary detection on the face image to obtain face boundary data; A Cascade classifier is used to perform regression classification processing on the facial boundary data to obtain the facial key point set; wherein the facial key point set includes 68 facial key points.
6. The method according to claim 1, characterized in that The performing ring feature detection on the pupil ring image to obtain the target ring center includes: Grayscale processing is performed on the pupil ring image to obtain a pupil grayscale image; Binarizing the pupil grayscale image to obtain a pupil binary image; Performing Hough ring detection on the pupil binary image to obtain a roughly extracted ring center; Performing edge detection on the pupil grayscale image to obtain a pupil edge image; Taking the center of the roughly extracted circular ring as a reference, sampling is performed at equal angle intervals in the pupil edge image to obtain a plurality of edge sampling points; All the edge sampling points are used to perform ellipse fitting to obtain the center of the target ring.
7. The method according to claim 6, characterized in that The secondary alignment control parameters include a second horizontal coordinate difference and a second vertical coordinate difference between the center coordinates of the target ring corresponding to the center of the target ring and the image center coordinates of the pupil ring image; The calculating of the secondary alignment control parameters according to the target ring center includes: Extracting the image center coordinates corresponding to the pupil ring image, calculating the deviation between the ring center coordinates and the image center coordinates, and obtaining the second horizontal coordinate difference and the second vertical coordinate difference respectively; The three-dimensional motion motor includes an x-direction motor, a y-direction motor and a z-direction motor, wherein the x-direction motor is used to control the eye biometer to move in the x-direction, the y-direction motor is used to control the eye biometer to move in the y-direction, and the z-direction motor is used to control the eye biometer to move in the z-direction; Correspondingly, controlling the three-dimensional motion motor to work according to the secondary alignment control parameter to perform secondary alignment includes: Determine a first movement direction of the eye biometer in the x direction controlled by the x-direction motor according to the positive or negative value of the second horizontal coordinate difference; and determine a second movement direction of the eye biometer in the z direction controlled by the z-direction motor according to the positive or negative value of the second vertical coordinate difference; According to the first movement direction, the x-direction motor is controlled to work so as to control the eye biometer to move in the x-direction, and the second horizontal coordinate difference is recalculated after the movement, until the absolute value of the recalculated second horizontal coordinate difference is less than a first preset threshold, and the x-direction motor is stopped from working; According to the second movement direction, the z-direction motor is controlled to operate so as to control the eye biometer to move in the z-direction, and the second longitudinal coordinate difference is recalculated after the movement, until the absolute value of the recalculated second longitudinal coordinate difference is less than a second preset threshold, the z-direction motor is stopped from being controlled to complete the secondary alignment.
8. An automatic human eye alignment system for an eye biometer provided with a forehead bracket, characterized in that: The eye biometer is also equipped with a forehead support motor and a three-dimensional motion motor; the forehead support motor is used to control the movement of the forehead support, and the three-dimensional motion motor is used to control the movement of the eye biometer in three-dimensional directions; The system is applied to the human eye automatic alignment method according to any one of claims 1 to 7, comprising: A facial image acquisition module, used to detect whether a face to be tested is placed on the forehead support; and to acquire a facial image when the face to be tested is placed on the forehead support; A facial feature detection module, used to perform facial feature detection on the facial image to obtain a set of facial key points; A first calculation module, used for calculating a primary alignment control parameter according to the facial key point set; A primary alignment module, used to control the forehead support motor and the three-dimensional motion motor to work respectively according to the primary alignment control parameters, so as to perform a primary alignment; A pupil image acquisition module, used to acquire a pupil ring image of the face to be tested; A pupil feature detection module, used to perform ring feature detection on the pupil ring image to obtain the target ring center; A second calculation module is used to calculate the secondary alignment control parameters according to the center of the target ring; The secondary alignment module is used to control the three-dimensional motion motor to work according to the secondary alignment control parameters to perform secondary alignment and complete automatic alignment of the human eye.
9. A human eye automatic alignment device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method steps as claimed in any one of claims 1 to 7 when executed.
10. A computer storage medium, characterized in that: The computer storage medium comprises: at least one instruction, which implements the method steps according to any one of claims 1 to 7 when the instruction is executed by a computer.
