Pupil distance measurement and calculation correction method, device, equipment and medium in glasses preparation process

Through the automated pupil distance calculation and correction method, the wide angle of the camera and the identification points of the frame bracket are used to calculate and correct the pupil distance, which solves the problems of low pupil distance calculation accuracy and efficiency in the existing technology, and improves the accuracy of the lens fitting and Comfort.

CN118892300APending Publication Date: 2024-11-05GUANGZHOU MINGRUI SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410929547.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

During the installation of existing glasses, the accuracy of pupil distance measurement is difficult to ensure, and it is greatly disturbed by human factors and has low efficiency, which affects visual experience and vision health.

Method used

A pupil distance calculation and correction method is adopted to automatically calculate and correct the pupil distance by obtaining the horizontal wide angle of the camera, identifying the preset marking points on the frame bracket, calculating the pixel proportion and angle proportion, and combining the pupil position information, the pupil distance is automatically calculated and corrected to improve the pupil distance. Calculate accuracy and efficiency.

Benefits of technology

It improves the accuracy and glass adaptation efficiency of pupil distance measurement, simplifies the glass adaptation process, enhances the user experience, ensures the accurate alignment of the optical center of the glasses and the pupil position, and reduces visual problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118892300A_ABST
    Figure CN118892300A_ABST
Patent Text Reader

Abstract

The invention relates to the field of optical glasses fitting, and discloses a pupil distance measurement and correction method, device and equipment in the glasses fitting process and a medium, and the method comprises the steps: obtaining a transverse wide angle of a camera of the current equipment; identifying preset identification points on the two sides of the glasses frame bracket of the wearer, and calculating a pixel proportion generated by the distance between the preset identification points; based on the pixel ratio and the transverse wide angle, calculating an angle ratio of a single side on the mirror bracket; based on the distance between the support and the eyeball and the angle ratio, the length to be corrected of the single side and the corrected length of the distance from the support to the eyeball surface are calculated; obtaining a correction rate based on the correction length and an actual distance between preset identification points; identifying the pixel quantity between pupils, and calculating to obtain a first pupil distance; and obtaining a final interpupillary distance based on the first interpupillary distance and the correction rate. The optical center deviation caused by distance difference can be avoided, and the accuracy and the lens matching efficiency in the lens matching process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of optical glasses fitting, and more specifically, to a method, device, equipment and medium for measuring and correcting pupil distance in the process of glasses fitting. Background Art

[0002] With the development of economic and medical levels, people pay more and more attention to eye health and vision protection. As an important tool for vision correction, the accuracy of glasses is directly related to the wearer's visual experience and vision health. As an extremely critical parameter in the glasses, the pupil distance plays a vital role in the glasses fitting process. The accuracy of the pupil distance directly affects the comfort, visual clarity and visual health of glasses. An accurate pupil distance value can ensure that the optical center of the glasses corresponds to the wearer's pupil position, so that light can accurately pass through the center of the lens into the eye, thereby avoiding problems such as visual fatigue, dizziness and even vision loss caused by inaccurate pupil distance. Traditional pupil distance measurement methods often rely on manual measurement, which is not only inefficient, but also subject to greater interference from human factors, making it difficult to ensure the accuracy of pupil distance measurement. In addition, due to differences in the wearer's facial features, the shape and size of the glasses frame, it will also have a certain impact on the measurement of pupil distance.

[0003] Therefore, in the existing glasses fitting process, the determination of the optical center of the glasses is greatly interfered by human factors, the efficiency is low, and the accuracy of pupil distance measurement in the process is difficult to ensure, which needs to be solved urgently. Summary of the invention

[0004] The main purpose of this application is to provide a method for measuring and correcting the pupil distance during the glasses fitting process, aiming to solve the technical problems in the existing glasses fitting process that the determination of the optical center of the glasses is greatly interfered by human factors, the efficiency is low, and the accuracy of the pupil distance measurement is difficult to guarantee during the process.

[0005] The first aspect of the present application provides a method for measuring and correcting pupil distance in the process of fitting glasses, comprising:

[0006] Get the horizontal wide angle of the current device camera;

[0007] Identify the preset marking points on both sides of the wearer's frame bracket and calculate the pixel ratio generated by the distance between the preset marking points;

[0008] Based on the pixel ratio and the horizontal wide angle, calculating the angle ratio of a single side on the frame bracket;

[0009] Based on the distance between the bracket and the eyeball and the angle ratio, the length to be corrected on one side and the corrected length of the distance from the bracket to the eyeball surface are calculated;

[0010] Based on the correction length and the actual distance between the preset marking points, a correction rate is obtained;

[0011] Identify the number of pixels between pupils and calculate the first pupil distance;

[0012] A final pupil distance is obtained based on the first pupil distance and the correction rate.

[0013] Furthermore, the step of obtaining the horizontal wide angle of the current device camera includes:

[0014] Get the vertical distance between the current device camera and the subject;

[0015] Get the length of the picture in which the subject is photographed;

[0016] Based on the vertical distance and the length of the picture, the length of the hypotenuse is calculated by the Pythagorean theorem;

[0017] The non-right angle with the camera as the starting point is obtained by trigonometric calculation;

[0018] The lateral wide angle is obtained by calculating the multiples of the non-right angle.

[0019] Furthermore, the step of identifying the preset identification points on both sides of the wearer's frame support and calculating the pixel ratio generated by the distance between the preset identification points includes:

[0020] Identify the marker points of the preset shape through computer AI vision algorithm and determine the position of each marker point;

[0021] Based on the positions of the marking points, determining the leftmost marking point and the rightmost marking point on the frame support, i.e., the preset marking points;

[0022] Get the first pixel in the horizontal direction of the current device screen;

[0023] Identify a second pixel quantity included in the distance between the leftmost marking point and the rightmost marking point;

[0024] The pixel ratio generated by the distance between the preset marking points is calculated by using the first pixel quantity and the second pixel quantity.

[0025] Furthermore, the step of calculating the angle proportion of a single side on the frame bracket based on the pixel proportion and the horizontal wide angle includes:

[0026] Obtaining the angle value of the horizontal wide angle;

[0027] An effective angle value is obtained based on the pixel ratio*the angle value of the horizontal wide angle;

[0028] Take half of the effective angle value to obtain the second angle value, that is, the angle ratio of a single side on the frame bracket.

[0029] Furthermore, the step of calculating the length to be corrected on one side and the corrected length of the distance from the bracket to the eyeball surface based on the distance between the bracket and the eyeball and the angle ratio includes:

[0030] Get the distance between the bracket and the eyeball;

[0031] The length to be corrected is calculated based on H=F*cos(E), where H is the length to be corrected, F is the distance between the bracket and the eyeball, and E is the angle ratio;

[0032] Get the actual distance between the preset marking points;

[0033] Based on the multiples of the length to be corrected on one side, the total length to be corrected is obtained;

[0034] The total length to be corrected and the actual distance are calculated to obtain a corrected length, that is, a corrected length of the distance from the bracket to the eyeball surface.

[0035] Furthermore, the step of identifying the number of pixels between pupils and calculating the first pupil distance includes:

[0036] identifying the amount of third pixels included in the distance between the two pupils;

[0037] Calculating a pixel ratio between the third pixel quantity and the pixel quantity between the preset marking points;

[0038] The first pupil distance is calculated based on M=I*L / B, where M is the first pupil distance; I is the actual distance between the preset marking points; L / B is the pixel ratio, where L is the third pixel amount; and B is the pixel amount between the preset marking points.

[0039] Furthermore, the step of obtaining the final pupil distance based on the first pupil distance and the correction rate includes:

[0040] The final pupil distance is calculated by N=M*K, wherein N is the final pupil distance, M is the first pupil distance, and K is the correction rate.

[0041] The second aspect of the present application further provides a pupil distance measurement and correction device in the process of glasses fitting, comprising:

[0042] The horizontal wide angle acquisition module is used to obtain the horizontal wide angle of the current device camera;

[0043] The marking point calculation module is used to identify the preset marking points on both sides of the wearer's frame bracket and calculate the pixel ratio generated by the distance between the preset marking points;

[0044] An angle calculation module, used to calculate the angle ratio of a single side on the frame bracket based on the pixel ratio and the horizontal wide angle;

[0045] A correction length acquisition module, used to calculate the length to be corrected on one side and the correction length of the distance from the bracket to the eyeball surface based on the distance between the bracket and the eyeball and the angle ratio;

[0046] A correction rate calculation module, used to obtain a correction rate based on the correction length and the actual distance between the preset marking points;

[0047] A first pupil distance acquisition module is used to identify the number of pixels between pupils and calculate the first pupil distance;

[0048] A final calculation module is used to obtain a final pupil distance based on the first pupil distance and the correction rate.

[0049] The third aspect of the present application provides a pupil distance measurement and correction device in the process of glasses fitting, comprising:

[0050] processor;

[0051] Memory for storing computer programs;

[0052] Wherein, when the processor executes the computer program, the pupil distance measurement and correction method in the glasses fitting process described in any one of the above-mentioned methods is implemented.

[0053] A fourth aspect of the present application provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the pupil distance measurement and correction method in the glasses fitting process described in any one of the above-mentioned methods is implemented.

[0054] The first aspect of this program brings about the following beneficial effects:

[0055] This application not only improves the accuracy of pupil distance measurement by introducing pupil distance measurement correction in the process of glasses fitting, but also greatly improves the efficiency and comfort of users' glasses fitting. In actual application, the user only needs to simply place the frame and the frame bracket device fixed on it in front of the eyes, and the device will automatically start the pupil distance measurement correction calculation, combine the preset identification points of the frame bracket for calculation, and capture the user's pupil position information to obtain accurate and corrected pupil distance data. This process does not require the user to perform any complex operations, greatly simplifies the glasses fitting process, and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a schematic diagram of the steps of a method for measuring and correcting pupil distance in a glasses fitting process according to an embodiment of the present application;

[0057] Figure 2 It is a schematic block diagram of the structure of a device for measuring and correcting pupil distance in the process of fitting glasses according to an embodiment of the present application;

[0058] Figure 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the present application;

[0059] Figure 4 It is a schematic diagram of correction of pupil distance measurement in the process of fitting glasses according to one embodiment of the present application;

[0060] Figure 5 This is a schematic diagram of the use of a frame bracket in the process of assembling glasses according to an embodiment of the present application;

[0061] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0063] It will be appreciated by those skilled in the art that, unless expressly stated, the singular forms "one", "above", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when an element is said to be "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may also be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any module and all combinations of one or more associated listed items.

[0064] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0065] Reference Figure 1The embodiment of the present application provides a method for measuring and correcting pupil distance in the process of fitting glasses, comprising the following steps S1-S7:

[0066] S1. Get the horizontal wide angle of the current device camera;

[0067] S2, identifying the preset marking points on both sides of the wearer's frame bracket, and calculating the pixel ratio generated by the distance between the preset marking points;

[0068] S3, calculating the angle ratio of a single side on the frame bracket based on the pixel ratio and the horizontal wide angle;

[0069] S4, based on the distance between the bracket and the eyeball and the angle ratio, calculating the length to be corrected on one side and the corrected length of the distance from the bracket to the eyeball surface;

[0070] S5. Obtaining a correction rate based on the correction length and the actual distance between the preset marking points;

[0071] S6, identifying the number of pixels between pupils, and calculating a first pupil distance;

[0072] S7. Obtain a final pupil distance based on the first pupil distance and the correction rate.

[0073] In step S1, first, the lateral wide angle of the camera of the shooting and measuring equipment used in the current glasses fitting process is determined. The lateral wide angle may refer to the angle parameter fixed by the manufacturer of the equipment when it leaves the factory. For example, some equipment is set to shoot with a wide-angle camera when it leaves the factory. Then, the subject photographed at this time is different from the actual subject. At this time, it is necessary to obtain the corresponding lateral wide angle, and restore the corresponding data corresponding to the actual subject on this basis. If there is no corresponding clear lateral wide angle parameter, the lateral wide angle can be automatically calculated before the glasses fitting process. Specifically, a ruler can be used to take pictures (other items that can represent or have accurate scales can also be used), the distance between the camera and the subject, and the size (length) of the captured picture can be measured, and the lateral wide angle of the equipment can be calculated. Assume that the image is taken at a distance of 15 cm, and the length of the image is 17 cm. Then, trigonometric calculation can be used. If the base of the triangle is 17 cm and the height is 15 cm, the height is used as the dividing line of the triangle to form two symmetrical right triangles. The hypotenuse of the right triangle can be calculated by the Pythagorean theorem. For example, if the right-angle side a = 8.5 cm and b = 15 cm, according to the Pythagorean theorem: Finally, the hypotenuse is calculated to be approximately 17cm (keep two decimal places); after calculating the hypotenuse of the right triangle, you can use trigonometric functions to calculate the corresponding angle value. Here, the inverse tangent function is used to calculate the angle θ: Finally, the calculation shows that θ is approximately equal to 60°. Therefore, the angle between the right-angled sides a and b is approximately 60 degrees, and the length of the hypotenuse c is approximately 17. If the angle between a and b is approximately 60 degrees, since the calculation of the lateral wide angle is formed by the angle between two symmetrical right triangles, the lateral wide angle at this time is approximately 120 degrees. Because the difference in lateral wide angle will directly affect the proportional relationship between the image captured by the camera and the actual object, this step can ensure the accuracy of the subsequent calculation of the pupil distance and improve the accuracy of the glasses fitting process.

[0074] In step S2, preset shape AI identification points are set on the border of the frame bracket. These identification points can be pre-defined marking points of specific shapes, colors or textures, which are used for identification and positioning in the image. In the method for measuring and correcting the pupil distance during the glasses fitting process, the computer AI vision algorithm can first be used to identify the border of the frame bracket, and then the identification points on the border are identified. Once the border of the frame bracket and the identification points of the preset shape are identified, the computer AI vision algorithm can determine their specific positions on the glasses frame and obtain their coordinates in the image. There may be multiple identification points set on the border of the frame bracket. The algorithm needs to determine which identification points are the corresponding positions that need to be identified for measuring the pupil distance. Generally, they are in the horizontal direction, that is, the identification points on the upper left and right sides of the same horizontal line; the distance between the two identification points is used to calculate the pixel ratio of the current screen; for example, referring to Figure 4 , A = 2400, which is the resolution length pixel of the current captured image (screen); B = 1600, which is the distance pixel corresponding to the coordinates of the upper left and upper right sides of the bracket (the coordinates of the preset identification points) in the captured screen after AI recognizes them; this step can provide the relationship between the actual physical distance between the preset identification points on the glasses frame and the number of pixels occupied in the camera capture screen; by automatically identifying the preset identification points and calculating the pixel ratio, the degree of automation of the glasses fitting process is increased and the efficiency is improved; at the same time, the use of computer AI vision algorithms to locate the marking points and calculate the pixel ratio greatly reduces the interference of human factors in the measurement of the optical center of the glasses, thereby improving the accuracy of the measurement. In addition, the calculation of the angle between the camera and the frame bracket is realized, providing an accurate angle reference for the subsequent pupil distance measurement and correction.

[0075] In step S3, the angle between the camera and the frame bracket is calculated according to the pixel ratio and the horizontal wide angle, that is, the angle ratio of one side on the frame bracket; it can be used to correct the measurement result of the pupil distance, thereby improving the accuracy of fitting glasses. First, according to the pixel ratio between the preset marking points obtained in step S2, the proportional relationship between the actual physical distance and the number of pixels in the image can be obtained. Figure 4, assuming that a pixel ratio of B / A is obtained, that is, 1600 / 2400=2 / 3; next, it is necessary to calculate the pixel ratio according to the horizontal wide angle C. If the horizontal wide angle C is 120 degrees at this time, the pixel ratio is 2 / 3 at this time, then the effective angle value is 120*2 / 3=80 degrees, then the coordinates of the upper left and upper right sides of the bracket (preset identification points) respectively account for 80 / 2=40 in the angle of the picture; that is, the angle ratio of one side on the frame bracket is 40 degrees; step S3 corrects the measurement result of the pupil distance by calculating the angle between the camera and the frame bracket, thereby improving the accuracy of fitting glasses. The proportional relationship between the actual physical distance and the number of pixels in the image is calculated using the pixel ratio and the horizontal wide angle, while adapting to the horizontal wide angle of different devices. This method simplifies the calculation process, can effectively improve the accuracy of fitting glasses, and provide users with a better visual experience.

[0076] In step S4, based on the distance between the bracket and the eyeball and the angle ratio, the length to be corrected on one side and the corrected length of the distance from the bracket to the eyeball surface are calculated. First, it is necessary to know the preset distance between the bracket and the eyeball, which is usually set based on ergonomics and optical principles. Figure 4 , assuming that this preset distance is F, then, combined with the angle ratio E calculated in step S3, calculate the length of the corrected single side, that is, H = F*cos(E) = 2.382. Because E is the angle ratio of a single side on the frame bracket, it represents the offset angle of the side relative to the center line in the camera's field of view. Using the cosine function, the angle can be converted into a distance ratio to derive the length of the single side that should be corrected. Next, since it is the length that should be corrected on a single side, both sides need to be corrected equally in actual applications, so the total length to be corrected should be H*2; at this time, the corrected length J is calculated based on the actual distance I of the coordinates of the upper left and upper right sides of the bracket (preset identification points), that is, the corrected length of the distance from the bracket to the eyeball surface. If I = 75mm, then the corrected length J = I+H*2 = 79.7.

[0077] In step S5, based on the corrected length and the actual distance between the preset marking points, a correction rate is obtained, and the correction rate is applied to the original measured value of the pupil distance to obtain the corrected pupil distance value. In step S4, the total corrected length and the actual distance between the preset marking points have been obtained. In order to obtain the correction rate of the pupil distance, it is necessary to calculate the ratio of the difference between the corrected length J and the actual distance I to , refer to Figure 4 , that is, the correction rate K = J / I, that is, K = 79.7 / 75 = 1.063. This step obtains the correction rate based on the distance between the bracket and the eyeball and the camera shooting angle. This correction rate can accurately reflect the deviation of the pupil distance measurement value caused by factors such as shooting angle, equipment parameters and ergonomics.

[0078] In step S6, it is necessary to identify the number of pixels between pupils and calculate the first pupil distance; based on the known number of pixels between preset identification points and the actual distance between the preset identification points, the actual distance represented by the unit pixel can be known. At this time, by obtaining the number of pixels when the eyeball is on the support surface (the third number of pixels), the distance of the eyeball when on the support surface (the first pupil distance) can be known;

[0079] Reference Figure 4-Figure 5 As shown, the distance between the eyeballs when the bracket is on the surface (the first pupil distance) M = I (the actual distance between the preset identification points) * L (the number of pixels when the eyeball is on the bracket surface (the third number of pixels)) / B (the number of pixels between the preset identification points); if I = 75mm, L = 1300; B = 1600, then M = I*L / B = 61mm; that is, the first pupil distance is 61mm. The first pupil distance is the pupil distance before correction. This step indirectly obtains the distance between the pupils (the first pupil distance) by calculating the number of pixels of the pupils in the picture captured by the camera, which provides basic data for the subsequent pupil distance correction.

[0080] In step S7, the final pupil distance is obtained based on the first pupil distance and the correction rate. The correction rate indicates the degree of correction of the deviation of the pupil distance measurement value caused by factors such as shooting angle, equipment parameters and ergonomics. Therefore, by multiplying the first pupil distance by the correction rate, a pupil distance value that is more accurate and closer to the actual situation can be obtained. Figure 4 , the final pupil distance N = M (first pupil distance) * K (correction rate), when the first pupil distance M = 61mm, the correction rate K = 1.063, the final pupil distance N = 61mm * 1.063 = 64.85mm. In step S7, a more accurate pupil distance value that is more in line with the actual situation is obtained. The completion of this step not only improves the accuracy of glasses fitting, but also provides users with a more comfortable and more suitable glasses fitting experience. If no correction is made, the optical center may deviate due to the distance between the bracket and the person, causing discomfort or visual problems when the wearer uses the glasses. Therefore, this step can ensure that the optical center of the glasses is aligned with the wearer's eye position, thereby improving the comfort and visual effect of the glasses. The corrected data can help avoid optical center deviations caused by distance differences, ensure that the wearer obtains more accurate glasses fitting, and reduce the occurrence of visual problems.

[0081] In one embodiment, the step of obtaining the horizontal wide angle of the current device camera includes:

[0082] S10, obtaining the vertical distance between the current device camera and the photographed subject;

[0083] S11, obtaining the length of the image of the subject being photographed;

[0084] S12, calculating the length of the hypotenuse based on the vertical distance and the picture length using the Pythagorean theorem;

[0085] S13, obtaining a non-right angle with the camera as the starting point by trigonometric calculation;

[0086] S14, calculating the multiples of the non-right angle to obtain the lateral wide angle.

[0087] In this embodiment, first, by measuring the actual horizontal distance between the camera and the subject, a specific value can be obtained, such as 15 cm. Then, the length of the subject in the image is measured, for example, 17 cm. Then, the base and height of the right triangle can be determined based on the actual horizontal distance and the length in the image. The length of the hypotenuse is calculated using the Pythagorean theorem, that is, the length of the hypotenuse from the camera to the subject. Then, the non-right angle in the current right triangle with the camera as the starting point is calculated by trigonometric functions. For example, the corresponding angle value is calculated by the inverse tangent function. Finally, the horizontal wide angle value is obtained, that is, the angle of the subject photographed by the device camera is obtained.

[0088] Through this embodiment, the horizontal wide angle of the current device camera can be obtained, which can be used to ensure the proportional relationship between the captured image and the actual object, provide an accurate angle reference for subsequent pupil distance measurement and correction, and ensure the accuracy and precision of the glasses fitting process.

[0089] In one embodiment, the step of identifying the preset identification points on both sides of the wearer's frame support and calculating the pixel ratio generated by the distance between the preset identification points includes:

[0090] S20, identifying the recognition points of the preset shape through a computer AI vision algorithm, and determining the position of each recognition point;

[0091] S21, based on the positions of the identification points, determining the leftmost identification point and the rightmost identification point on the frame support, that is, the preset identification points;

[0092] S22, obtaining a first pixel quantity in the horizontal direction of the current device screen;

[0093] S23, identifying a second pixel quantity included in the distance between the leftmost identification point and the rightmost identification point;

[0094] S24. Calculate the pixel ratio generated by the distance between the preset identification points through the first pixel quantity and the second pixel quantity.

[0095] In this embodiment, some identification points of preset shapes are set on the frame support, such as marking points of specific shapes, colors or textures, and then they are identified by computer AI vision algorithms and their positions in the image are determined. This can be achieved through modern computer vision technology, such as feature point detection algorithms or convolutional neural networks. Next, according to the positions of the identification points, the leftmost and rightmost identification points on the frame support, i.e., the pre-identification points, are determined, so that two iconic points on the frame support that are needed to calculate the pixel ratio of the distance can be obtained. Then, the total number of pixels between the first pixel and the next pixel in the horizontal direction of the current device screen is obtained, which can be realized by reading the image or video frame and obtaining its width (i.e., how many pixels are contained in the horizontal direction). Finally, by calculating the proportional relationship between the first pixel amount and the second pixel amount, the pixel ratio generated by the distance between the preset identification points is calculated. In this way, through the steps of S20-S24, the present application can calculate the pixel ratio generated by the distance between them based on the device identifying the preset identification points on the frame support. This method can automatically obtain the pixel ratio between the preset identification points, and provide important data support for the subsequent pupil distance measurement and correction of glasses.

[0096] In one embodiment, the step of calculating the angle ratio of a single side on the frame bracket based on the pixel ratio and the horizontal wide angle comprises:

[0097] S30, obtaining the angle value of the horizontal wide angle;

[0098] S31, obtaining an effective angle value based on the pixel ratio*the angle value of the horizontal wide angle;

[0099] S32. Take half of the effective angle value to obtain a second angle value, that is, obtain the angle ratio of a single side on the frame bracket.

[0100] In this embodiment, the ratio value of the pixel ratio generated by the distance between the preset identification points is first obtained, and this value reflects the pixel ratio occupied by the two points on the frame bracket in the image. Next, the angle value of the horizontal wide angle of the subject photographed by the device camera is obtained, and this value represents the horizontal angle range that the camera can cover. The effective angle value is obtained based on the pixel ratio * the angle value of the horizontal wide angle; in order to obtain the angle ratio of a single side, half of the effective angle value is taken. This is because the two sides of the frame bracket are symmetrical, so only the angle of one side needs to be considered. Then, the angle ratio of a single side on the frame bracket can be obtained. This angle ratio represents the angle ratio of a single side on the frame bracket within the camera shooting range, which provides important data support for the subsequent calculation of pupil distance and correction.

[0101] In one embodiment, the step of calculating the length to be corrected on one side and the corrected length of the distance from the bracket to the eyeball surface based on the distance between the bracket and the eyeball and the angle ratio includes:

[0102] S40, obtaining the distance between the bracket and the eyeball;

[0103] S41, based on H=F*cos(E), the length to be corrected is calculated, where H is the length to be corrected, F is the distance between the bracket and the eyeball; and E is the angle ratio;

[0104] S42, obtaining the actual distance between the preset marking points;

[0105] S43, obtaining a total length to be corrected based on multiples of the length to be corrected on one side;

[0106] S44, calculating the total length to be corrected and the actual distance, and obtaining the corrected length, that is, the corrected length of the distance from the bracket to the eyeball surface.

[0107] In this embodiment, first, the distance between the frame and the eyeball is obtained, which reflects the actual physical distance from the frame frame to the user's eyeball. Figure 4 (As shown in the figure), the cosine function (cos) in the trigonometric function and the angle ratio (E) calculated above are used to calculate the length (H) to be corrected on one side by the formula H = F*cos(E), where F is the distance between the bracket and the eyeball. This length to be corrected represents the length that needs to be corrected on one side of the frame bracket due to the difference between the camera shooting angle and the actual wearing angle. Then, the actual distance between the preset identification points is obtained. This actual distance is the physical distance between the two preset identification points in the real world. By obtaining this actual distance, the length to be corrected on one side can be converted into the total correction length. Since the frame bracket is bilaterally symmetrical, the total length to be corrected can be obtained by multiplying the length to be corrected on one side by 2 (or other appropriate multiples, if the design differences of the frame bracket are taken into account). Finally, the total length to be corrected and the actual distance between the preset identification points are added to calculate the corrected length, that is, the corrected length of the distance from the bracket to the eyeball surface. This corrected length takes into account the difference between the camera shooting angle and the actual wearing angle, providing more accurate data support for subsequent pupil distance measurement and correction. Through this embodiment, the correction length from the frame bracket to the eyeball surface can be automatically calculated based on the camera shooting angle, the preset marking points on the frame bracket, and the distance between the bracket and the eyeball, thereby ensuring the accuracy and precision of the glasses fitting process. This method not only improves the efficiency of glasses fitting, but also improves the comfort and satisfaction of glasses fitting.

[0108] In one embodiment, the step of identifying the number of pixels between pupils and calculating the first pupil distance includes:

[0109] S50, identifying a third pixel quantity included in the distance between the two pupils;

[0110] S51, calculating a pixel ratio between the third pixel quantity and the pixel quantity between the preset marking points;

[0111] S52. Calculate the first pupil distance based on M=I*L / B, where M is the first pupil distance; I is the actual distance between the preset marking points; L / B is the pixel ratio, where L is the third pixel amount; and B is the pixel amount between the preset marking points.

[0112] In this embodiment, in order to obtain accurate pupil distance data, the third pixel quantity occupied by the distance between the two pupils in the image is first identified. This pixel quantity represents the relative position relationship between the pupils in the image. Next, the pixel ratio of the third pixel quantity and the pixel quantity between the preset identification points is calculated. This pixel ratio reflects the relative size relationship between the pupils and the preset identification points in the image. With this pixel ratio, the first pupil distance can be calculated according to the actual distance between the preset identification points through the formula M=I*L / B. Figure 4 , where M is the first pupil distance, I is the actual distance between the preset identification points, L / B is the pixel ratio calculated above, L is the third pixel quantity, and B is the pixel quantity between the preset identification points. This first pupil distance is calculated based on the picture taken by the camera, which provides important data support for the subsequent glasses fitting process. Through this embodiment, the pixel quantity between the pupils can be accurately and quickly identified, and the first pupil distance can be calculated, thereby improving the accuracy and efficiency of glasses fitting. The first pupil distance is the preliminary pupil distance data obtained based on the picture taken by the camera, and the calculation of the first pupil distance can provide a basis for the subsequent more accurate pupil distance measurement and correction.

[0113] In one embodiment, the step of obtaining a final pupil distance based on the first pupil distance and the correction rate comprises:

[0114] S60, calculating the final pupil distance by N=M*K, wherein N is the final pupil distance, M is the first pupil distance, and K is the correction rate.

[0115] In this embodiment, based on the first pupil distance calculated previously and the known correction rate, we perform further calculations to obtain the final pupil distance. The final pupil distance N is calculated by the formula N=M*K. This final pupil distance is the result obtained after comprehensive consideration of multiple factors, and can more accurately reflect the user's actual pupil distance requirements. Through this embodiment, we can not only quickly and accurately obtain the user's pupil distance data, but also make corrections based on the user's actual situation, thereby ensuring the accuracy and comfort of glasses fitting. This greatly improves the efficiency of glasses fitting and user satisfaction. Through the corrected final pupil distance, the optical center can be more accurately positioned at the user's pupil center, further improving the wearing effect and visual experience of the glasses.

[0116] refer to Figure 2 , a pupil distance measurement and correction device in the process of glasses fitting, comprising:

[0117] A horizontal wide angle acquisition module 100 is used to acquire the horizontal wide angle of the current device camera;

[0118] The marking point calculation module 200 is used to identify the preset marking points on both sides of the wearer's frame bracket and calculate the pixel ratio generated by the distance between the preset marking points;

[0119] An angle calculation module 300, used to calculate the angle proportion of a single side on the frame bracket based on the pixel proportion and the horizontal wide angle;

[0120] A correction length acquisition module 400 is used to calculate the length to be corrected on one side and the correction length of the distance from the bracket to the eyeball surface based on the distance between the bracket and the eyeball and the angle ratio;

[0121] A correction rate calculation module 500, for obtaining a correction rate based on the correction length and the actual distance between the preset marking points;

[0122] A first pupil distance acquisition module 600 is used to identify the number of pixels between pupils and calculate the first pupil distance;

[0123] The final calculation module 700 is used to obtain a final pupil distance based on the first pupil distance and the correction rate.

[0124] Furthermore, the above-mentioned horizontal wide-angle acquisition module 100 includes:

[0125] A vertical distance acquisition unit is used to obtain the vertical distance between the current device camera and the subject being photographed;

[0126] A picture length acquisition unit, used to acquire the length of the picture of the photographed subject;

[0127] A hypotenuse length calculation unit, used to calculate the length of the hypotenuse based on the vertical distance and the picture length by the Pythagorean theorem;

[0128] A non-right angle calculation unit, used for calculating a non-right angle with the camera as the starting point through trigonometric functions;

[0129] The first angle acquisition subunit is used to calculate the multiples of the non-right angle to obtain the horizontal wide angle.

[0130] Furthermore, the above-mentioned identification point calculation module 200 includes:

[0131] An identification point position determination unit, used to identify identification points of a preset shape through a computer AI vision algorithm and determine the position of each identification point;

[0132] A left and right identification unit, used to determine the leftmost identification point and the rightmost identification point on the frame support, i.e., the preset identification point, based on the position of the identification point;

[0133] A first pixel quantity acquisition unit, used to acquire a first pixel quantity in the horizontal direction of the current device screen;

[0134] A second pixel quantity acquisition unit, used to identify a second pixel quantity included in the distance between the leftmost identification point and the rightmost identification point;

[0135] The pixel ratio calculation unit is used to calculate the pixel ratio generated by the distance between the preset identification points through the first pixel quantity and the second pixel quantity.

[0136] Furthermore, the angle calculation module 300 further includes:

[0137] A first angle value acquisition unit, used to acquire the angle value of the horizontal wide angle;

[0138] An effective angle calculation unit, used to obtain an effective angle value based on the pixel ratio*the angle value of the horizontal wide angle;

[0139] The second angle value calculation unit is used to take half of the effective angle value to obtain a second angle value, that is, to obtain the angle ratio of a single side on the frame bracket.

[0140] Furthermore, the above-mentioned corrected length acquisition module 400 includes:

[0141] A first distance acquisition unit, used to acquire the distance between the bracket and the eyeball;

[0142] The first formula calculation unit is used to calculate the length to be corrected based on H=F*cos(E), where H is the length to be corrected, F is the distance between the bracket and the eyeball; and E is the angle ratio;

[0143] A first actual distance acquisition unit, used to acquire the actual distance between preset marking points;

[0144] A correction total acquisition unit, used for obtaining the total length to be corrected based on the multiples of the length to be corrected on one side;

[0145] The corrected length acquisition unit is used to calculate the total length to be corrected and the actual distance, and calculate the corrected length, that is, the corrected length of the distance from the bracket to the eyeball surface.

[0146] Furthermore, the first pupil distance acquisition module 600 includes:

[0147] A third identification unit, used for identifying a third pixel quantity included in the distance between the two pupils;

[0148] A third pixel ratio calculation unit, used for calculating a pixel ratio between the third pixel quantity and the pixel quantity between the preset marking point;

[0149] The second formula calculation unit is used to calculate the first pupil distance based on M=I*L / B, where M is the first pupil distance; I is the actual distance between the preset marking points; L / B is the pixel ratio, where L is the third pixel amount; and B is the pixel amount between the preset marking points.

[0150] Furthermore, the above-mentioned final calculation module 700 includes:

[0151] The final correction unit is used to calculate the final pupil distance through N=M*K; wherein N is the final pupil distance; M is the first pupil distance; and K is the correction rate.

[0152] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface and a database connected by a bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores operations, computer programs and a database. The internal memory provides an environment for the operation and computer program in the non-volatile storage medium. The database of the computer device is used to store data such as the pupil distance measurement and correction method in the glasses fitting process. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by a processor, it implements a method for measuring and correcting the pupil distance in the process of fitting glasses, including the following steps: obtaining the horizontal wide angle of the current device camera; identifying the preset identification points on both sides of the wearer's frame bracket, and calculating the pixel ratio generated by the distance between the preset identification points; based on the pixel ratio and the horizontal wide angle, calculating the angle ratio of a single side on the frame bracket; based on the distance between the bracket and the eyeball and the angle ratio, calculating the length that should be corrected for a single side, and the corrected length of the distance from the bracket to the eyeball surface; based on the corrected length and the actual distance between the preset identification points, obtaining the correction rate; identifying the number of pixels between the pupils, and calculating the first pupil distance; based on the first pupil distance and the correction rate, obtaining the final pupil distance.

[0153] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a method for measuring and correcting the pupil distance in the process of fitting glasses is implemented, comprising the following steps: obtaining the horizontal wide angle of the current device camera; identifying preset identification points on both sides of the wearer's frame bracket, and calculating the pixel ratio generated by the distance between the preset identification points; calculating the angle ratio of a single side on the frame bracket based on the pixel ratio and the horizontal wide angle; calculating the length to be corrected for a single side and the corrected length of the distance from the bracket to the eyeball surface based on the distance between the bracket and the eyeball and the angle ratio; obtaining a correction rate based on the corrected length and the actual distance between the preset identification points; identifying the number of pixels between the pupils, and calculating a first pupil distance; and obtaining a final pupil distance based on the first pupil distance and the correction rate.

[0154] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in the present application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0155] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for measuring and correcting pupil distance in the process of fitting glasses. It is characterized in that include: Get the horizontal wide angle of the current device camera; Identify the preset marking points on both sides of the wearer's frame bracket and calculate the pixel ratio generated by the distance between the preset marking points; Based on the pixel ratio and the horizontal wide angle, calculating the angle ratio of a single side on the frame bracket; Based on the distance between the bracket and the eyeball and the angle ratio, the length to be corrected on one side and the corrected length of the distance from the bracket to the eyeball surface are calculated; Based on the correction length and the actual distance between the preset marking points, a correction rate is obtained; Identify the number of pixels between pupils and calculate the first pupil distance; A final pupil distance is obtained based on the first pupil distance and the correction rate.

2. The method for calculating and correcting pupil distance in the process of fitting glasses according to claim 1, It is characterized in that The step of obtaining the horizontal wide angle of the current device camera includes: Get the vertical distance between the current device camera and the subject; Get the length of the picture in which the subject is photographed; Based on the vertical distance and the length of the picture, the length of the hypotenuse is calculated by the Pythagorean theorem; The non-right angle with the camera as the starting point is obtained by trigonometric calculation; The lateral wide angle is obtained by calculating the multiples of the non-right angle.

3. The method for measuring and correcting pupil distance in the process of fitting glasses according to claim 1, It is characterized in that The step of identifying the preset identification points on both sides of the wearer's frame support and calculating the pixel ratio generated by the distance between the preset identification points includes: Identify the marker points of the preset shape through computer AI vision algorithm and determine the position of each marker point; Based on the positions of the marking points, determining the leftmost marking point and the rightmost marking point on the frame support, i.e., the preset marking points; Get the first pixel in the horizontal direction of the current device screen; Identify a second pixel quantity included in the distance between the leftmost marking point and the rightmost marking point; The pixel ratio generated by the distance between the preset marking points is calculated by using the first pixel quantity and the second pixel quantity.

4. The method for measuring and correcting pupil distance in the process of fitting glasses according to claim 1, It is characterized in that The step of calculating the angle ratio of a single side on the frame bracket based on the pixel ratio and the horizontal wide angle comprises: Obtaining the angle value of the horizontal wide angle; An effective angle value is obtained based on the pixel ratio*the angle value of the horizontal wide angle; Take half of the effective angle value to obtain the second angle value, that is, the angle ratio of a single side on the frame bracket.

5. The method for measuring and correcting pupil distance in the process of fitting glasses according to claim 1, It is characterized in that The step of calculating the length to be corrected on one side and the corrected length of the distance from the bracket to the eyeball surface based on the distance between the bracket and the eyeball and the angle ratio includes: Get the distance between the bracket and the eyeball; The length to be corrected is calculated based on H=F*cos(E), where H is the length to be corrected, F is the distance between the bracket and the eyeball, and E is the angle ratio; Get the actual distance between the preset marking points; Based on the multiples of the length to be corrected on one side, the total length to be corrected is obtained; The total length to be corrected and the actual distance are calculated to obtain a corrected length, that is, a corrected length of the distance from the bracket to the eyeball surface.

6. The method for calculating and correcting pupil distance in the process of fitting glasses according to claim 1, It is characterized in that The step of identifying the number of pixels between pupils and calculating the first pupil distance comprises: identifying the amount of third pixels included in the distance between the two pupils; Calculating a pixel ratio between the third pixel quantity and the pixel quantity between the preset marking points; The first pupil distance is calculated based on M=I*L / B, where M is the first pupil distance; I is the actual distance between the preset marking points; L / B is the pixel ratio, where L is the third pixel amount; and B is the pixel amount between the preset marking points.

7. The method for measuring and correcting pupil distance in the process of fitting glasses according to claim 1, It is characterized in that The step of obtaining the final pupil distance based on the first pupil distance and the correction rate comprises: The final pupil distance is calculated by N=M*K, wherein N is the final pupil distance, M is the first pupil distance, and K is the correction rate.

8. A device for measuring and correcting pupil distance during the process of fitting glasses. It is characterized in that include: The horizontal wide angle acquisition module is used to obtain the horizontal wide angle of the current device camera; The marking point calculation module is used to identify the preset marking points on both sides of the wearer's frame bracket and calculate the pixel ratio generated by the distance between the preset marking points; An angle calculation module, used to calculate the angle ratio of a single side on the frame bracket based on the pixel ratio and the horizontal wide angle; A correction length acquisition module, used to calculate the length to be corrected on one side and the correction length of the distance from the bracket to the eyeball surface based on the distance between the bracket and the eyeball and the angle ratio; A correction rate calculation module, used to obtain a correction rate based on the correction length and the actual distance between the preset marking points; A first pupil distance acquisition module is used to identify the number of pixels between pupils and calculate the first pupil distance; A final calculation module is used to obtain a final pupil distance based on the first pupil distance and the correction rate.

9. A device for measuring and correcting pupil distance during the process of fitting glasses. It is characterized in that include: processor; Memory for storing computer programs; Camera, to take pictures; Wherein, when the processor executes the computer program, the method for calculating and correcting pupil distance in the process of fitting glasses according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for calculating and correcting pupil distance in the glasses fitting process according to any one of claims 1 to 7 is implemented.