Method for detecting near vision based on adaptive technology

By monitoring the posture and detection distance of the subject in real time, and adjusting the visual scale size on the vision chart adaptively, the problem of inaccurate detection results caused by changes in detection distance and angle in the prior art is solved, and higher objectivity and standardization are achieved.

CN119769985AInactive Publication Date: 2025-04-08GUANGDONG GENERAL HOSPITAL +1

Patent Information

Application Number
CN202411837466.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When existing methods of detecting myopia are faced with diverse eye habits, the detection distance and detection angle frequently change, which affects the objectivity and accuracy of the detection results.

Method used

By monitoring the posture and detection distance of the subject in real time, adaptive technology is used to dynamically adjust the size and shape of the visual mark on the vision chart to ensure that the detection distance and angle during the detection process are consistent.

Benefits of technology

It significantly improves the objectivity and accuracy of the detection results, enhances the standardization level of the detection process, simplifies the detection process, optimizes the user experience, and provides personalized detection solutions for subjects with different eye-use habits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119769985A_ABST
    Figure CN119769985A_ABST
Patent Text Reader

Abstract

The invention relates to a method for detecting near vision based on an adaptive technology, and the method comprises the steps: S1, carrying out the initialization of a program, and obtaining a device DPI; s2, turning on a camera, acquiring focal length information of the camera, controlling parameters of the camera of the mobile phone to remain unchanged, and detecting whether a human face is in a state of being parallel to a screen and centered or not in real time; if it is detected that the face is not parallel to the screen or not located in the center of the screen, the program pauses detection and guides the user to adjust the position of the face, and then the step S2 is executed again until it is detected that the face is parallel to the screen and located in the center of the screen; s3, entering an interpupillary distance measurement program, and measuring the interpupillary distance; s4, starting a near vision detection program, calculating a detection distance according to the interpupillary distance, and dynamically adjusting the sighting mark size of the visual chart according to the detection distance; and S5, performing near vision detection, and recording a near vision detection result. By dynamically adjusting the size of the sighting mark, the detection error is effectively avoided, and the objectivity and accuracy of the detection result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vision detection, and more specifically, to a method for detecting near vision based on adaptive technology. Background Art

[0002] Through near vision testing, we can accurately evaluate the visual ability of individuals when working at close range, detect potential vision problems in a timely manner, and take necessary measures to improve and protect vision. Among the existing methods for testing near vision, a significant drawback comes from the diverse near-distance eye habits of the subjects, such as differences in posture and distance when reading and writing, and the high freedom of hand-held movement of the eye chart. These external factors inevitably lead to frequent changes in the detection distance and detection angle during the test, while the size and shape of the sight mark (font) on the eye chart remain constant. This contradiction between fixity and change greatly weakens the objectivity and standardization of the test process. Specifically, since the subjects cannot completely standardize their eye habits and test behaviors, each test may present different results due to minor differences, which makes the reliability of the test results questionable. At the same time, the static design of the eye chart fails to fully consider the dynamic changes in individual use, further exacerbating the subjective color and poor repeatability of the test.

[0003] In summary, the existing methods for detecting near vision are in urgent need of improvement to improve their adaptability and standardization level in the face of diverse eye habits, so as to ensure the objectivity, accuracy and repeatability of the test results. In order to solve the above problems, the present invention follows the core concept of eye chart design and GB11533-2011 standard, and proposes a near vision detection method that can monitor the posture and distance of the subject in real time and adaptively adjust the eye chart specifications according to the detection distance. Summary of the invention

[0004] The present invention aims to overcome at least one defect (shortcoming) of the above-mentioned prior art and provide a method for detecting near vision based on adaptive technology, which is used to solve the problem in the prior art that due to external factors, the detection distance and the detection angle are frequently marked during the detection process, while the size of the sight mark on the eye chart remains constant, resulting in each detection may present different results due to slight differences, making the vision test results inaccurate.

[0005] The technical solution adopted by the present invention is a method for detecting near vision based on adaptive technology, comprising:

[0006] S1: Initialize the program and obtain the device DPI;

[0007] S2: Turn on the camera, obtain the camera focal length information and control the phone camera parameters to remain unchanged, and detect in real time whether the face is parallel to the screen and centered; if it is detected that the face is not parallel to the screen or not located in the center of the screen, the program will pause the detection and guide the user to adjust the face position, and then re-execute step S2 until it is detected that the face is parallel to the screen and located in the center of the screen;

[0008] S3: Enter the pupil distance measurement program and measure the pupil distance;

[0009] S4: Start the near vision test program, calculate the test distance according to the pupil distance, and dynamically adjust the size of the sight mark on the vision chart according to the test distance;

[0010] S5: Perform near vision test and record the near vision test result;

[0011] In the present invention, by real-time monitoring of the subject's posture and detection distance, and adaptively adjusting the size and shape of the sight mark on the eye chart accordingly, the influence of frequent changes in the detection distance and angle caused by the diverse eye habits of the subject on the detection result is effectively eliminated, and the objectivity and accuracy of the detection result are significantly improved; and on the basis of real-time monitoring and adaptive adjustment, personalized detection solutions can be provided for subjects with different eye habits, which is helpful to more accurately identify myopia problems and their development trends, and provide a more scientific and reasonable basis for subsequent vision correction and treatment; at the same time, the design of the present invention follows the core concept of eye chart design and the national standard GB11533-2011, and through an intelligent and automated adjustment mechanism, the consistency of the eye chart specifications during the detection process is ensured, the detection errors caused by human factors are avoided, and the standardization level of the detection process is improved; in addition, since the detection method provided by the present invention can adapt to the specific eye conditions of the subject, each detection can be carried out under the same or similar conditions, thereby improving the repeatability and reliability of the detection results, helping doctors or optometrists to more accurately evaluate the myopia of the subject, simplify the detection process, improve detection efficiency, and optimize user experience.

[0012] Preferably, step S2 includes:

[0013] S21: Capture continuous video frames of human faces through a camera;

[0014] S22: Input the captured video frame into the RetinaFace deep learning face detection algorithm to detect the face, and output the detected face frame and facial feature point coordinates;

[0015] S23: Match the obtained facial feature points with the corresponding feature points of the preset frontal face model, calculate the rotation matrix using the matched feature points, and then decompose the rotation matrix into different angles to represent the degree of rotation of the face on the X, Y, and Z axes, and finally determine whether the face is parallel to the screen or located at the center of the screen based on the degree of rotation.

[0016] The RetinaFace deep learning face detection algorithm adopted in the present invention combines a feature pyramid network (FPN) and a single-stage detector, and can accurately detect faces in video frames at multiple scales, provide high-accuracy detection results, and the algorithm is superior in speed and efficiency, suitable for real-time face detection applications, and can also locate key points of the face. Deploying it in an ophthalmic vision detection device or system can enable real-time monitoring of the subject's posture and detection distance when performing vision detection on the subject. When the subject's posture is not parallel to the screen or not centered, the subject can be reminded to adjust his posture in time, and then the size of the sight mark on the eye chart is adaptively adjusted according to the detection distance, thereby effectively avoiding the problem that the detection distance and the detection angle change frequently during the detection process due to external factors, while the size of the sight mark on the eye chart remains constant, resulting in each detection may present different results due to slight differences, resulting in inaccurate vision detection results.

[0017] Further preferably, the step S22 includes:

[0018] S221: Load the pre-trained RetinaFace model into the memory, and pre-process the captured video frames to adapt to the input requirements of the model;

[0019] S222: The detected face frame is represented by a rectangular frame, and is determined by the coordinates of the upper left corner and the lower right corner, that is, (x_min, y_min, x_max, y_max);

[0020] S223: outputting a regression vector r_box=[dx, dy, dw, dh] representing the face box, where dx and dy represent the horizontal and vertical offsets of the face box relative to a reference point, and dw and dh represent the scaling factors of the width and height of the face box relative to the reference size;

[0021] S224: The preset reference point is the center point (cx, cy) of the image and the preset reference size is the width w_ref and the height h_ref, so that the coordinates of the upper left corner and the lower right corner of the face frame can be calculated as:

[0022] x_min=cx+dx*w_ref / 2

[0023] y_min=cy+dy*h_ref / 2

[0024] x_max=cx+(dx+dw)*w_ref / 2

[0025] y_max=cy+(dy+dh)*h_ref / 2

[0026] S225: For the calculation of the coordinates of facial feature points, the model recognizes the video frame and outputs a regression vector representing the offset of the feature point relative to the reference point of the face frame. By applying these offsets to the reference point, the precise coordinates of the facial feature points can be obtained.

[0027] By using the RetinaFace model, the precise coordinates of the face frame and facial feature points can be quickly detected, and the coordinates of the center of the subject's pupil can be captured. This can accurately determine the relative position of the subject's face and the screen, thereby reminding the subject to adjust the face position and improving the accuracy of the detection results.

[0028] Preferably, in step S23, the rotation matrix is:

[0029]

[0030] Where R represents the rotation matrix, rij represents the element in the i-th row and j-th column of the matrix;

[0031] The rotation matrix is ​​decomposed into three Euler angles: pitch angle θ, yaw angle φ, and roll angle ψ. These three angles are used to represent the degree of rotation of the face around the Z axis, Y axis, and X axis, respectively.

[0032] Further preferably, the calculation formulas of the pitch angle θ, the yaw angle φ and the roll angle ψ are respectively:

[0033] Pitch angle θ = atan2(r 21 ,r 11 );

[0034] Yaw angle

[0035] Roll angle ψ=atan2(r 32 ,r 33 );

[0036] When the pitch angle is ≤±15°, the yaw angle is ≤±5°, and the roll angle is ≤20°, it is determined that the face is parallel to the screen; otherwise, it is considered that the face is not parallel to the screen.

[0037] Preferably, step S23 also includes calculating the coordinates of the center point of the face frame and comparing them with the coordinates of the center point of the screen. If the distance between the center point of the face frame and the center point of the screen is ≥10% of the screen width or ≥10% of the screen height, it is considered that the face is not located at the center of the screen, otherwise it is considered that the face is located at the center of the screen.

[0038] The above steps accurately determine the positional relationship between the subject's face and the screen. If the face is not located at the center of the screen or is not parallel to the screen, the user is promptly reminded to adjust the position, and real-time feedback and guidance are provided to help the user maintain the correct face position and orientation.

[0039] Preferably, step S3 includes:

[0040] S31: prompting the user to place a card that complies with the ISO7810 standard size close to the forehead, where the standard size is 85.60 mm×53.98 mm, and to keep the card horizontally centered with the lower edge higher than the eyebrows;

[0041] S32: The camera captures the edges and corners of the card, and sets the pixel size of the detected long side of the card in the device to Pw, and the pixel size of the line connecting the pupil centers of both eyes in the device to Pd. Combining the card size, it can be obtained that the actual size of the user's pupil distance is PD = 85.6mm / Pw*Pd.

[0042] Since cards such as ID cards and bank cards all conform to the ISO7810 standard size, using them to calculate the actual size of the subject's pupil distance can effectively ensure the objectivity and accuracy of the test results.

[0043] Preferably, step S4 includes:

[0044] S41: Design the initial vision chart according to GB11533-2011 standard. When the design distance is D and the side length of the sight mark is B, the display side length of the sight mark in the device can be obtained as L0=B*DPI / 25.4mm;

[0045] S42: Calculate the current detection distance M according to the parameters obtained in step S3;

[0046] S43: According to the design principle of the vision chart and the principle of variable distance application, the current detection distance is compared with the vision chart with a design distance of D, and the size of the current vision chart sight mark can be calculated, so as to dynamically adjust the current sight mark size.

[0047] Further preferably, in step S42, the current detection distance represents the distance from the user's eyes to the camera, and its formula is: M=f*PD / Pd, where f represents the focal length of the camera.

[0048] More preferably, in step S43, the calculation formula for the current sight mark size is obtained as follows: L=M / D*L0.

[0049] In this application, the core concept of eye chart design and the national standard GB11533-2011 are followed. Through an intelligent and automated adjustment mechanism, the consistency of eye chart specifications during the detection process is ensured, detection errors caused by human factors are avoided, and the standardization level of the detection process is improved. The detection distance is used to achieve adaptive dynamic adjustment of the current eye chart sight mark size, thereby reducing the need for the subject to adjust the detection distance by themselves and other tedious steps, thereby realizing the automation and intelligence of vision testing, improving detection efficiency, and optimizing user experience.

[0050] Preferably, the step S1 includes using the DisplayMetrics class to obtain the DPI of the device, specifically:

[0051] S11: Create an instance of the DisplayMetrics class and use it as a container to store various measurement information obtained from the screen;

[0052] S12: Get the current WindowManager service through the getWindowManager() method of the Activity, and call the getDefaultDisplay() method to get the default Display object, where the Display object represents the current display screen of the device;

[0053] S13: Call the getMetrics(DisplayMetrics outMetrics) method to obtain the metric information of the screen, and fill the information into the DisplayMetrics class instance created in S11;

[0054] S14: By reading the densityDpi field in the DisplayMetrics instance, the DPI value of the device can be obtained.

[0055] In the present invention, the DisplayMetrics class is also used to obtain the DPI of the device, thereby laying a foundation for the subsequent calculation of the sight mark size and effectively improving the objectivity and accuracy of the detection result.

[0056] Compared with the prior art, the present invention has the following beneficial effects:

[0057] 1. Improve the objectivity and accuracy of the test results: By real-time monitoring of the subject's posture and detection distance, and adaptively adjusting the size and shape of the sight mark (font) on the eye chart, the present invention effectively eliminates the impact of frequent changes in detection distance and angle caused by the subject's diverse eye habits on the test results, thereby significantly improving the objectivity and accuracy of the test results.

[0058] 2. Enhance the standardization of the detection process: The design of the present invention follows the core concept of vision chart design and the national standard GB11533-2011. Through an intelligent and automated adjustment mechanism, it ensures the consistency of the vision chart specifications during the detection process, avoids detection errors caused by human factors, and improves the standardization level of the detection process.

[0059] 3. Improve the repeatability and reliability of detection: Since the present invention can automatically adapt to the specific eye conditions of the subject, each test can be performed under the same or similar conditions, thereby improving the repeatability and reliability of the test results, and helping doctors or optometrists to more accurately evaluate the myopia of the subject.

[0060] 4. Optimize user experience: By reducing the cumbersome steps that the subject needs to adjust the detection distance and posture by himself, the present invention simplifies the detection process and improves the detection efficiency, while also reducing the discomfort of the subject and optimizing the overall user experience.

[0061] 5. Promote the formulation of personalized detection plans: On the basis of real-time monitoring and adaptive adjustment, the present invention can also provide personalized detection plans for subjects with different eye habits, which helps to more accurately identify myopia problems and their development trends, and provide a more scientific and reasonable basis for subsequent vision correction and treatment. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 A schematic diagram of the flow chart of the method for detecting near vision provided in this embodiment.

[0063] Figure 2 The visual acuity display provided in this embodiment is designed according to the GB11533-2011 standard.

[0064] Figure 3 A schematic diagram of the process of dynamically adjusting the size of the sight mark provided in this embodiment. DETAILED DESCRIPTION

[0065] The drawings of the present invention are only for illustrative purposes and should not be construed as limiting the present invention. In order to better illustrate the following embodiments, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; it is understandable to those skilled in the art that some well-known structures and their descriptions in the drawings may be omitted.

[0066] Example 1

[0067] like Figure 1 As shown, this embodiment provides a method for detecting near vision based on adaptive technology, the method comprising:

[0068] Step S1: Initialize the program and obtain the device DPI;

[0069] Step S2: Turn on the camera and control the camera parameters of the mobile phone to remain unchanged, and detect in real time whether the face is parallel to the screen and centered; if it is detected that the face is not parallel to the screen or not located in the center of the screen, the program will pause the detection and guide the user to adjust the face position, and then re-execute step S2 until it is detected that the face is parallel to the screen and located in the center of the screen;

[0070] Step S3: Entering the pupil distance measurement program to measure the pupil distance;

[0071] Step S4: starting the near vision detection program, calculating the detection distance according to the pupil distance, and dynamically adjusting the size of the sight mark on the vision chart according to the detection distance;

[0072] Step S5: Perform near vision test and record the near vision test result;

[0073] In the present invention, by real-time monitoring of the subject's posture and detection distance, and adaptively adjusting the size and shape of the sight mark on the eye chart accordingly, the influence of frequent changes in the detection distance and angle caused by the diverse eye habits of the subject on the detection result is effectively eliminated, and the objectivity and accuracy of the detection result are significantly improved; and on the basis of real-time monitoring and adaptive adjustment, personalized detection solutions can be provided for subjects with different eye habits, which is helpful to more accurately identify myopia problems and their development trends, and provide a more scientific and reasonable basis for subsequent vision correction and treatment; at the same time, the design of the present invention follows the core concept of eye chart design and the national standard GB11533-2011, and through an intelligent and automated adjustment mechanism, the consistency of the eye chart specifications during the detection process is ensured, the detection errors caused by human factors are avoided, and the standardization level of the detection process is improved; in addition, since the detection method provided by the present invention can adapt to the specific eye conditions of the subject, each detection can be carried out under the same or similar conditions, thereby improving the repeatability and reliability of the detection results, helping doctors or optometrists to more accurately evaluate the myopia of the subject, simplify the detection process, improve detection efficiency, and optimize user experience.

[0074] Preferably, in step S1, the DisplayMetrics class is used to obtain the DPI (dots per inch) of the device, specifically:

[0075] Step S11: first, create a DisplayMetrics class instance, and use this instance as a container to store various metric information obtained from the screen;

[0076] Step S12: Get the current WindowManager service through the getWindowManager() method of Activity, and call the getDefaultDisplay() method to get the default Display object, where the Display object represents the current display screen of the device;

[0077] Step S13: After obtaining the default Display object, call the getMetrics(DisplayMetricsoutMetrics) method to obtain the screen's metric information, including screen width, height, DPI and other metric information, and then fill this information into the DisplayMetrics class instance created in step S11;

[0078] Step S14: Finally, by reading the densityDpi field in the DisplayMetrics instance, the DPI value of the device can be obtained.

[0079] In the present invention, the DisplayMetrics class is also used to obtain the DPI of the device, thereby laying a foundation for the subsequent calculation of the sight mark size and effectively improving the objectivity and accuracy of the detection result.

[0080] Preferably, step S2 includes:

[0081] Step S21: Capture continuous video frames of the face through a camera.

[0082] Specifically, first, call the getSystemService(Context.CAMERA_SERVICE) method of Context to obtain the CameraManager instance, and select the front camera to open it through the openCamera method of CameraManager. After the camera is successfully opened, use the getCameraCharacteristics method to query the properties of the camera, such as the supported preview and image size, exposure and white balance mode, focal length, etc. Then, prepare multiple Surfaces as camera output targets, and call the createCaptureSession method of CameraDevice to create a CameraCaptureSession. After the session is successfully created, use the CameraDevice.createCaptureRequest method to build a CaptureRequest, and preset parameters such as exposure, white balance, focal length, etc. to ensure that these parameters remain unchanged in subsequent requests. Submit the configured CaptureRequest to CameraCaptureSession for execution, and reconfigure and submit the same parameters when the application life cycle changes to maintain the consistency and stability of the camera parameters. After configuring the camera, use it to capture continuous video frames of the face, which are continuously updated at 30 frames per second in this embodiment.

[0083] Preferably, in step S22, for each captured video frame image, the RetinaFace deep learning face detection algorithm is called to search for and detect the face, and the detected face frame and facial feature point coordinates are returned in real time.

[0084] Specifically, the step S22 includes:

[0085] Step S221: first, use the deep learning framework PyTorch to load the pre-trained RetinaFace model into the memory, and pre-process the captured video frames to adapt to the input requirements of the model;

[0086] Among them, the preprocessing of the captured video frames includes adjusting the image to the input size required by the model, selecting the appropriate height and width according to the requirements of the model, and selecting methods such as bilinear interpolation for scaling according to actual needs, and normalizing the image to adjust the image pixel value to a specific range to accelerate training and improve model stability. A diverse data set is generated through random transformations (such as rotation, flipping, scaling, adding noise, etc.) to enhance the robustness of the model, so that the captured video frames are adapted to the input requirements of the model.

[0087] Step S222: The preprocessed video frame is input into the RetinaFace model for detection. The detected face frame is represented by a rectangular frame and is determined by the coordinates of the upper left corner and the lower right corner, i.e. (x_min, y_min, x_max, y_max). These coordinates obtained in the RetinaFace algorithm are obtained by predicting the face area in the input image.

[0088] Step S223: then outputting a regression vector r_box=[dx, dy, dw, dh] representing the face box, where dx and dy represent the horizontal and vertical offsets of the face box relative to a reference point, and dw and dh represent the scaling factors of the width and height of the face box relative to the reference size;

[0089] Step S224: preset the reference point and reference size, the preset reference point is the center point (cx, cy) of the image and the preset reference size is the width w_ref and the height h_ref, so that the coordinates of the upper left corner and the lower right corner of the face frame can be calculated, and the formula is:

[0090] x_min=cx+dx*w_ref / 2

[0091] y_min=cy+dy*h_ref / 2

[0092] x_max=cx+(dx+dw)*w_ref / 2

[0093] y_max=cy+(dy+dh)*h_ref / 2

[0094] Step S225: The calculation of the coordinates of facial feature points is similar to the step of calculating the coordinates of the face frame. After recognizing the video frame, the model outputs a regression vector representing the offset of the feature point relative to the reference point of the face frame. By applying these offsets to the reference point, the precise coordinates of the facial feature points can be obtained.

[0095] Therefore, by using the RetinaFace model, the precise coordinates of the face frame and facial feature points can be quickly detected, and the coordinates of the center of the subject's pupil can be captured. This can accurately determine the relative position of the subject's face and the screen, thereby reminding the subject to adjust the face position and improving the accuracy of the detection results.

[0096] Preferably, in step S23: the obtained facial feature points are matched with corresponding feature points of a preset frontal face model, a rotation matrix is ​​calculated using the matched feature points, and then the rotation matrix is ​​decomposed into different angles to represent the degree of rotation of the face on the X, Y, and Z axes, and finally, the degree of rotation is used to determine whether the face is parallel to the screen or located at the center of the screen.

[0097] Specifically, the step S23 includes:

[0098] The rotation matrix, which describes the affine transformation from the "frontal" face model to the current face, is represented by the following formula:

[0099]

[0100] Where R represents the rotation matrix, rij represents the element in the i-th row and j-th column of the matrix;

[0101] The rotation matrix is ​​decomposed into three Euler angles: pitch angle θ, yaw angle φ and roll angle ψ. These three angles are used to represent the degree of rotation of the face around the Z axis, Y axis and X axis respectively. The specific decomposition method depends on the rotation order along the axis. The ZYX order is adopted in this embodiment.

[0102] Further preferably, after determining the rotation order along the axis, the rotation angle of each Euler angle is calculated by the following method, and the calculation formulas of the pitch angle θ, the yaw angle φ and the roll angle ψ are respectively:

[0103] Pitch angle θ = atan2(r 21 ,r 11 );

[0104] Yaw angle

[0105] Roll angle ψ=atan2(r 32 ,r 33 );

[0106] Among them, when the pitch angle is ≤±15°, the yaw angle is ≤±5°, and the roll angle is ≤20°, it is determined that the face is parallel to the screen, otherwise it is considered that the face is not parallel to the screen.

[0107] Further preferably, step S23 also includes calculating the coordinates of the center point of the face frame and comparing them with the coordinates of the center point of the screen. If the distance between the center point of the face frame and the center point of the screen is ≥ 10% of the screen width or ≥ 10% of the screen height, it is considered that the face is not located at the center of the screen; otherwise, it is considered that the face is located at the center of the screen.

[0108] The above steps accurately determine the positional relationship between the subject's face and the screen. Once it is detected that the face is not parallel to the screen or not centered, the program will suspend further face detection processing and prompt the user to adjust the face position so that it is parallel to and centered on the screen. After the user adjusts the position according to the prompt, the application will restart the detection and re-evaluate the position and orientation of the face based on the new video frame. This process will be repeated continuously to provide real-time feedback and guidance to help users maintain the correct face position and orientation.

[0109] Preferably, step S3 includes:

[0110] Step S31: prompting the user to place a card that complies with the ISO7810 standard size close to the forehead. The card may be an ID card, a bank card, etc., and its standard size is 85.60 mm×53.98 mm. The card should be centered horizontally and its lower edge should be higher than the eyebrows.

[0111] Step S32: The subject can pinch the upper left or upper right corner of the card with his fingers, making sure not to cover the lower half of the card so that the camera can capture the edges and corners of the card clearly. Then, based on the fact that the face is centered and parallel to the screen in step S2 and the eye pupil center coordinates have been captured, the pixel size of the detected long side of the card in the device is set to Pw, and the pixel size of the line connecting the pupil centers of both eyes in the device is Pd. Combined with the card size, the actual size of the user's pupil distance can be calculated as PD=85.6mm / Pw*Pd.

[0112] Since cards such as ID cards and bank cards all conform to the ISO7810 standard size, using them to calculate the actual size of the subject's pupil distance can effectively ensure the objectivity and accuracy of the test results.

[0113] Preferably, in step S4, Figure 3 As shown, including:

[0114] Step S41: Design an initial vision chart according to GB11533-2011 standard. The designed vision chart is as follows: Figure 2 As shown, in this embodiment, taking the 5.0 visual acuity sight mark as an example, by looking at Figure 2 It can be seen from the eye chart that when the design distance D is 25cm, the side length B of the sight mark is 0.36mm, and the display side length of the sight mark in the device can be obtained as L0=0.36*DPI / 25.4mm, where 1 inch is equal to 25.4mm;

[0115] Step S42: Calculate the current detection distance M according to the parameters obtained in step S3; the current detection distance represents the distance from the user's eyes to the camera, and its formula is: M=f*PD / Pd, where f represents the focal length of the camera.

[0116] Step S43: According to the design principle of the vision chart and the application principle of variable distance, and from Figure 2 From the table, it can be seen that the design distance D is 25cm. Then, by comparing the current detection distance with the vision chart with a design distance D of 25cm, the current vision chart sight mark size can be calculated, thereby dynamically adjusting the current sight mark size.

[0117] Among them, in the step S43, the current sight mark size calculation formula obtained is: L = M / 250*0.36*DPI / 25.4mm. The current sight mark size of the vision chart can be calculated and adjusted by the above formula, and then the operation of step S5 is performed to perform near vision test and record the near vision test result, thereby enhancing the standardization of the test process, avoiding the test error caused by human factors, and improving the repeatability and reliability of the test result.

[0118] In this application, the core concept of eye chart design and the national standard GB11533-2011 are followed. Through an intelligent and automated adjustment mechanism, the consistency of eye chart specifications during the detection process is ensured, detection errors caused by human factors are avoided, and the standardization level of the detection process is improved. The detection distance is used to achieve adaptive dynamic adjustment of the current eye chart sight mark size, thereby reducing the need for the subject to adjust the detection distance by themselves and other tedious steps, thereby realizing the automation and intelligence of vision testing, improving detection efficiency, and optimizing user experience.

[0119] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the claims of the present invention shall be included in the protection scope of the claims of the present invention.

Claims

1. A method for detecting near vision based on adaptive technology, comprising: S1: Initialize the program and obtain the device DPI; S2: Turn on the camera, obtain the camera focal length information and control the phone camera parameters to remain unchanged, and detect in real time whether the face is parallel to the screen and centered; if it is detected that the face is not parallel to the screen or not located in the center of the screen, the program will pause the detection and guide the user to adjust the face position, and then re-execute step S2 until it is detected that the face is parallel to the screen and located in the center of the screen; S3: Enter the pupil distance measurement program and measure the pupil distance; S4: Start the near vision test program, calculate the test distance according to the pupil distance, and dynamically adjust the size of the sight mark on the vision chart according to the test distance; S5: Perform near vision test and record the near vision test result; It is characterized in that the step S2 includes: S21: Capture continuous video frames of human faces through a camera; S22: Input the captured video frame into the RetinaFace deep learning face detection algorithm to detect the face, and output the detected face frame and facial feature point coordinates; S23: Match the obtained facial feature points with the corresponding feature points of the preset frontal face model, calculate the rotation matrix using the matched feature points, and then decompose the rotation matrix into different angles to represent the degree of rotation of the face on the X, Y, and Z axes, and finally determine whether the face is parallel to the screen or located at the center of the screen based on the degree of rotation.

2. The method for detecting near vision based on adaptive technology according to claim 1, characterized in that: The step S22 comprises: S221: Load the pre-trained RetinaFace model into the memory, and pre-process the captured video frames to adapt to the input requirements of the model; S222: The detected face frame is represented by a rectangular frame, and is determined by the coordinates of the upper left corner and the lower right corner, that is, (x_min, y_min, x_max, y_max); S223: outputting a regression vector r_box=[dx, dy, dw, dh] representing the face box, where dx and dy represent the horizontal and vertical offsets of the face box relative to a reference point, and dw and dh represent the scaling factors of the width and height of the face box relative to the reference size; S224: The preset reference point is the center point (cx, cy) of the image and the preset reference size is the width w_ref and the height h_ref, so that the coordinates of the upper left corner and the lower right corner of the face frame can be calculated as: x_min=cx+dx*w_ref / 2 y_min=cy+dy*h_ref / 2 x_max=cx+(dx+dw)*w_ref / 2 y_max=cy+(dy+dh)*h_ref / 2 S225: For the calculation of the coordinates of facial feature points, the model recognizes the video frame and outputs a regression vector representing the offset of the feature point relative to the reference point of the face frame. By applying these offsets to the reference point, the precise coordinates of the facial feature points can be obtained.

3. The method for detecting near vision based on adaptive technology according to claim 2, characterized in that: In step S23, the rotation matrix is: Where R represents the rotation matrix, rij represents the element in the i-th row and j-th column of the matrix; The rotation matrix is ​​decomposed into three Euler angles: pitch angle θ, yaw angle φ, and roll angle ψ. These three angles are used to represent the degree of rotation of the face around the Z axis, Y axis, and X axis, respectively.

4. The method for detecting near vision based on adaptive technology according to claim 3, characterized in that: The calculation formulas of the pitch angle θ, yaw angle φ and roll angle ψ are respectively: Pitch angle θ = atan2(r 21 ,r 11 ); Yaw angle Roll angle ψ=atan2(r 32 ,r 33 ); When the pitch angle is ≤±15°, the yaw angle is ≤±5°, and the roll angle is ≤20°, it is determined that the face is parallel to the screen; otherwise, it is considered that the face is not parallel to the screen.

5. The method for detecting near vision based on adaptive technology according to claim 3, characterized in that: The step S23 also includes calculating the coordinates of the center point of the face frame and comparing them with the coordinates of the center point of the screen. If the distance between the center point of the face frame and the center point of the screen is ≥ 10% of the screen width or ≥ 10% of the screen height, it is considered that the face is not located at the center of the screen, otherwise it is considered that the face is located at the center of the screen.

6. The method for detecting near vision based on adaptive technology according to claim 1, characterized in that: The step S3 includes: S31: prompting the user to place a card that complies with the ISO7810 standard size close to the forehead, where the standard size is 85.60 mm×53.98 mm, and to keep the card horizontally centered with the lower edge higher than the eyebrows; S32: The camera captures the edges and corners of the card, and sets the pixel size of the detected long side of the card in the device to Pw, and the pixel size of the line connecting the pupil centers of both eyes in the device to Pd. Combining the card size, it can be obtained that the actual size of the user's pupil distance is PD = 85.6mm / Pw*Pd.

7. The method for detecting near vision based on adaptive technology according to claim 6, characterized in that: The step S4 includes: S41: Design the initial vision chart according to GB11533-2011 standard. When the design distance is D and the side length of the sight mark is B, the display side length of the sight mark in the device can be obtained as L0=B*DPI / 25.4mm; S42: Calculate the current detection distance M according to the parameters obtained in step S3; S43: According to the design principle of the vision chart and the principle of variable distance application, the current detection distance is compared with the vision chart with a design distance of D, and the size of the current vision chart sight mark can be calculated, so as to dynamically adjust the current sight mark size.

8. The method for detecting near vision based on adaptive technology according to claim 7, characterized in that: In step S42, the current detection distance represents the distance from the user's eyes to the camera, and its formula is: M=f*PD / Pd, where f represents the focal length of the camera.

9. The method for detecting near vision based on adaptive technology according to claim 7, characterized in that: In step S43, the current sight mark size calculation formula is obtained as: L=M / D*L0.

10. A method for detecting near vision based on adaptive technology according to any one of claims 1 to 9, characterized in that: Step S1 includes using the DisplayMetrics class to obtain the DPI of the device, specifically: S11: Create an instance of the DisplayMetrics class and use it as a container to store various measurement information obtained from the screen; S12: Get the current WindowManager service through the getWindowManager() method of the Activity, and call the getDefaultDisplay() method to get the default Display object, where the Display object represents the current display screen of the device; S13: Call the getMetrics(DisplayMetrics outMetrics) method to obtain the metric information of the screen, and fill the information into the DisplayMetrics class instance created in S11; S14: By reading the densityDpi field in the DisplayMetrics instance, the DPI value of the device can be obtained.

Citation Information

Patent Citations

  • Interpupillary distance computation apparatus and method

    CN110674666A

  • Method and system for carrying out vision test on terminal screen and storage medium

    CN111367484A

  • Deep learning-based ophthalmic parameter measuring method and system and equipment

    CN111938567A

  • Vision detection method and system using general equipment with camera shooting function

    CN113854952A

  • Calibration method for visual mark displayed on terminal screen and vision detection system

    CN113951810A

Cited By

  • Image structure dynamic labeling method and system based on artificial intelligence

    CN120783343A

  • Method and apparatus for navigation with GNSS-INS-EO sensor fusion

    US20240328787A1