Glasses size determination method and device, computer equipment and storage medium

By acquiring three-dimensional data of the user's head, determining facial and ear reference points, calculating the distance to the center ear, and fusing auxiliary parameters, the data is input into the prediction model, solving the problem of poor fit of existing eyeglasses sizes and achieving accurate and automated eyeglasses size matching.

CN122065670APending Publication Date: 2026-05-19SHENZHEN HUIMING EYEGLASSES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN HUIMING EYEGLASSES CO LTD
Filing Date
2026-02-04
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing eyeglass sizing standards are mostly based on European facial data, which cannot effectively match the facial contours and feature distribution of Asian people, resulting in poor fit and a lack of quantitative standards, making it difficult for users to make accurate purchases.

Method used

By acquiring the user's 3D head data, facial and ear reference points are determined, the distance to the center ear is calculated, and auxiliary facial parameters are fused with these reference points. The data is then input into a prediction model to determine the target glasses size.

Benefits of technology

It achieves precise matching between eyeglass size and the user's three-dimensional facial structure, improving the efficiency and accuracy of eyeglass fitting, reducing manual measurement errors, and providing an automated size matching solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122065670A_ABST
    Figure CN122065670A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of data processing, and relates to a glasses size determination method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining head three-dimensional data of a user, the head three-dimensional data at least comprising face three-dimensional data and ear three-dimensional data; determining a first face reference point based on the face three-dimensional data, and determining a second face reference point according to the ear three-dimensional data; determining a central ear distance based on the first face reference point and the second face reference point; extracting auxiliary facial parameters from the facial three-dimensional data, and fusing the auxiliary facial parameters and the central ear distance to obtain fused feature data; and inputting the fused feature data into a preset target prediction model, obtaining an output result according to the target prediction model, and determining a target glasses size of the user according to the output result, thereby realizing objective, accurate and automatic matching from individual biological features to standardized product sizes in glasses fitting, and significantly improving the accuracy and efficiency of glasses fitting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, computer device, and storage medium for determining eyeglass size. Background Technology

[0002] Current eyeglasses sizing standards are primarily based on the geometric dimensions of the frames, supplemented by a classification method based on face shape.

[0003] This traditional approach relies on standardized production sizes and human experience, which has significant limitations in terms of fit. On the one hand, existing sizing systems are mostly based on European facial data, which does not match the characteristics of Asian people, whose facial features are less three-dimensional and more compact. Therefore, the designed eyeglass sizes only fit a portion of the population. On the other hand, the industry lacks more comprehensive quantitative standards, and different brands have independent sizing systems, making it difficult for users to accurately match their purchases.

[0004] This indicates that current eyeglass sizes do not fit users well. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, computer device, and storage medium for determining eyeglass size, so as to solve the problem of poor eyeglass size fit with users.

[0006] To address the aforementioned technical problems, this application provides a method for determining eyeglass size, employing the following technical solution: A method for determining eyeglass size includes the following steps: Acquire the user's three-dimensional head data, which includes at least facial three-dimensional data and ear three-dimensional data; A first facial reference point is determined based on the facial 3D data, and a second facial reference point is determined based on the ear 3D data. The distance to the center ear is determined based on the first facial reference point and the second facial reference point; Auxiliary facial parameters are extracted from the three-dimensional facial data, and the auxiliary facial parameters and the distance to the center ear are fused to obtain fused feature data; The fused feature data is input into a preset target prediction model, and the output result is obtained based on the target prediction model. The target glasses size of the user is determined based on the output result.

[0007] Furthermore, determining the first facial reference point based on the facial three-dimensional data and determining the second facial reference point based on the ear three-dimensional data includes: The facial 3D data is used to identify the user's glabella or nasal root area; The first facial reference point is determined based on the area between the eyebrows or the root of the nose. The three-dimensional data of the ear are identified to determine the user's ear attachment area; The second facial reference point is determined based on the ear attachment area.

[0008] Furthermore, determining the distance to the center ear based on the first facial reference point and the second facial reference point includes: Generate a head image based on the aforementioned three-dimensional head data; Based on the head image, calculate the pixel distance between the first facial reference point and the second facial reference point; The pixel distance is converted into the actual physical distance to obtain the center ear distance.

[0009] Furthermore, the output results are frame parameter data, which include the total frame width, bridge width, and temple length. The target prediction model includes a total frame width determination layer, a bridge width determination layer, and a temple length determination layer. The step of inputting the fused feature data into a preset target prediction model and obtaining the output result based on the target prediction model includes: The total width of the frame is determined by the layer, the central ear angle is determined by the fusion feature data, and the total width of the frame is determined based on the fusion feature data and the central ear angle. The nasal bridge width is determined by the nasal bridge width determination layer based on the fused feature data and a preset scaling factor. The temple length is determined by the temple length determination layer based on the fused feature data and a preset correction length.

[0010] Furthermore, determining the user's target glasses size based on the output result includes: If the output result is the user's glasses size, then the glasses size is determined as the target glasses size; If the output result is the user's frame parameter data, then the target glasses size is determined based on the frame parameter data.

[0011] Furthermore, the target prediction model is a target frame parameter prediction model. Before inputting the fused feature data into the preset target prediction model and obtaining the output result based on the target prediction model, the method further includes: The fusion feature data of multiple individual samples and the frame parameter data of the multiple individual samples are obtained, and the fusion feature data of the multiple individual samples and the frame parameter data of the multiple individual samples are divided into a training set and a test set. Create a basic prediction model, and train the basic prediction model based on the training set to obtain an initial frame parameter prediction model; Based on the test set, the initial frame parameter prediction model is optimized to obtain the target frame parameter prediction model.

[0012] Furthermore, the target prediction model is a target size prediction model. Before inputting the fused feature data into the preset target prediction model and obtaining the output result based on the target prediction model, the method further includes: Obtain the fusion feature data of multiple individual samples and the eyeglass size of the multiple individual samples, and divide the fusion feature data of the multiple individual samples and the eyeglass size of the multiple individual samples into a training set and a test set; Create a basic prediction model, and train the basic prediction model based on the training set to obtain an initial size prediction model; Based on the test set, the initial size prediction model is optimized to obtain the target size prediction model.

[0013] To address the aforementioned technical problems, this application also provides a device for determining eyeglass size, employing the following technical solution: A device for determining eyeglass size, comprising: The acquisition module is used to acquire the user's head three-dimensional data, which includes at least facial three-dimensional data and ear three-dimensional data; The first determining module is used to determine a first facial reference point based on the facial three-dimensional data, and to determine a second facial reference point based on the ear three-dimensional data. The second determining module is used to determine the distance to the center ear based on the first facial reference point and the second facial reference point; The fusion module is used to extract auxiliary facial parameters from the facial 3D data, and fuse the auxiliary facial parameters with the central ear distance to obtain fused feature data; The output module is used to input the fused feature data into a preset target prediction model, obtain the output result based on the target prediction model, and determine the user's target glasses size based on the output result.

[0014] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution: A computer device includes a memory and a processor, the memory storing computer-readable instructions, the processor executing the computer-readable instructions to implement the steps of the method for determining eyeglass size as described above.

[0015] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below: A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the method for determining eyeglass size as described above.

[0016] Compared with the prior art, this application has the following main advantages: The method for determining eyeglasses size disclosed in this application acquires three-dimensional head data of the user, including at least three-dimensional facial and ear data, covering key structural information of the face and ears, providing data support for subsequent benchmark positioning and distance calculation. Based on the three-dimensional facial and ear data, a first and a second facial benchmark are determined, ensuring the consistency of subsequent central ear distance calculation and avoiding measurement deviations caused by different operators or equipment. Based on the first and second facial benchmarks, the central ear distance is determined, providing accurate data for size matching. Auxiliary facial parameters are extracted from the three-dimensional facial data and fused with the facial three-dimensional data to obtain fused features. After feature fusion, individual facial differences can be more comprehensively depicted, making the model input information more complete. The fused features are input into a preset target prediction model to obtain the output result, and the eyeglasses size is determined based on the output result, realizing automated size matching, significantly improving the efficiency and accuracy of eyeglass fitting, and effectively improving the adaptability of eyeglasses size to the user's real three-dimensional facial structure. Attached Figure Description

[0017] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is an exemplary system architecture diagram to which this application can be applied; Figure 2 This is a flowchart of a method for determining eyeglass size provided in this application; Figure 3 This is a schematic diagram of a head measurement point provided in this application; Figure 4 This is a schematic diagram of a central ear distance provided in this application; Figure 5 This application provides a grading chart for eyeglasses sizes; Figure 6 This is a schematic diagram of the structure of a device for determining eyeglass size provided in this application; Figure 7 This is a schematic diagram of the structure of a computer device provided in this application. Detailed Implementation

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0020] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0022] like Figure 1 As shown, the system architecture 100 may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0023] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104, and can receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0024] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 (Moving Picture Experts Group Audio Layer Ⅲ) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptops, and desktop computers, etc.

[0025] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.

[0026] It should be noted that the method for determining eyeglass size provided in this application embodiment is generally executed by a terminal device, and correspondingly, the eyeglass size determination device is generally set in the terminal device.

[0027] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0028] Continue to refer to Figure 2 A flowchart illustrating an embodiment of the method for determining eyeglass size according to this application is shown. The method for determining eyeglass size includes the following steps: Step S201: Obtain the user's head 3D data, which includes at least facial 3D data and ear 3D data.

[0029] In this embodiment, the method for determining eyeglass size operates on an electronic device (e.g., Figure 1 The terminal device shown can send or receive data via wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, Wi-Fi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra wideband) connections, and other currently known or future wireless connection methods.

[0030] It's important to note that relying solely on static optometry data without considering differences in facial structure (such as varying nose bridge height leading to nose pad fit issues) and eye-use habits (such as office workers needing blue light protection due to frequent close-up work, and outdoor workers needing glare protection) will result in a low degree of matching between the designed eyeglasses size and the user's actual needs. Addressing the issue of data simplification from the outset through multi-dimensional data collection is a prerequisite for improving eyeglass fit.

[0031] In this embodiment, the user's three-dimensional head data can be acquired using methods such as an optometry device, a 3D facial scanner, mobile phone sensors (such as cameras and gyroscopes), ophthalmic optical biometers, and smart wearable devices (such as watches that record eye usage time). The three-dimensional head data includes data such as the head surface contour, spatial coordinates of key areas, and structural dimensions, including at least facial three-dimensional distances and ear three-dimensional distances. Facial three-dimensional distances refer to a subset of the corresponding facial region in the head three-dimensional data, including three-dimensional information of key facial structures such as the glabella, root of the nose, bridge of the nose, periorbital area, and cheeks (e.g., facial width, bridge of the nose height, interocular distance, cheek curvature, etc.). Ear three-dimensional data refers to a subset of the corresponding ear region in the head three-dimensional data, including three-dimensional information such as the auricle contour, ear canal position, and ear attachment area (the key area where the temples of the glasses contact the ear) (e.g., auricle height, distance from the ear canal to the temporal region, etc.).

[0032] The collected 3D head data is cleaned to remove duplicates and outliers. Then, it is used for data completion, filling in missing data, such as through averaging or interpolation. Finally, the data is standardized, with all units converted to centimeters or millimeters to obtain the user's 3D head data.

[0033] Step S202: Determine a first facial reference point based on the facial three-dimensional data, and determine a second facial reference point based on the ear three-dimensional data.

[0034] It should be noted that the first facial reference point refers to a key facial reference point located based on three-dimensional facial data and used for subsequent calculation of the distance between the center and ear. For example, a location on the facial midline (sagittal plane) can be selected (such as the midpoint of the glabella region, i.e., the forehead-nose suture between the two eyebrows), or a location such as the midpoint of the line connecting the root of the nose, the center of the pupil, the midpoint of the line connecting the outer corner of the eye, and the midpoint of the line connecting the inner corner of the eye can be selected as the first facial reference point.

[0035] The second facial reference point is a key reference point on the ear, located based on three-dimensional ear data, used for subsequent calculations of the distance to the center ear. For example, the second facial reference point is a point in the sacrum concha region approximately 10mm from the ear canal, or it can be a point at the tragus, the lowest point of the concha, the supraauricular point, or other similar locations. In eyeglasses, the second facial reference point is the point where the temple contacts the ear, i.e., the support point at the end of the temple.

[0036] parameter Figure 3 , Figure 3 This is a schematic diagram of head measurement points provided in this application. The first facial reference point can correspond to the glabella point (g) or the nasal root point (n) in the figure. This point is located in the frontonasal suture region between the inner endpoints of the two eyebrows and is a stable anatomical landmark on the sagittal plane (midline) of the face, ensuring the anatomical rationality of the reference point location. The second facial reference point can refer to the tragus point (t) (the apex of the small protrusion in front of the ear canal), the upper auricular attachment point (obs) (the attachment point between the upper edge of the auricle and the scalp), or the lower auricular attachment point (obi) (the attachment point between the lower edge of the auricle and the scalp) in the figure. These points are all located in the key support area of ​​the ear and are the core force points for contact between the temple of the glasses and the ear.

[0037] In this embodiment, based on the anatomical features of the face and ears (such as the facial midline and the attachment boundary of the auricle), locations that meet the definition of reference points are selected from the three-dimensional data using image recognition or three-dimensional feature matching technology. Facial midline features (such as the midline of the bridge of the nose, the line connecting the midpoint of the line connecting the pupils of both eyes and the tip of the nose), and features of the glabella or nasal root region (such as the midpoint of the line connecting the inner endpoints of the eyebrows, and the minimum gray value region in the glabella depression) are extracted from the facial three-dimensional data. Features around the ear canal (such as the circular concave outline of the ear canal) and ear attachment region features (such as the arc-shaped attachment boundary between the auricle and the scalp) are extracted from the ear three-dimensional data.

[0038] The extracted features can be matched with a pre-built reference point feature template library (containing 3D feature templates for reference points of different age groups). The similarity between the extracted features and the reference point feature templates (such as Euclidean distance and cosine similarity) is calculated, and the position with the highest similarity is selected as the candidate reference point. The candidate reference points are then validated for reasonableness (e.g., whether the first facial reference point is on the midline of the face, and whether the second facial reference point is 10±1mm from the ear canal). If there are deviations, the positions are fine-tuned to ensure that the reference points conform to anatomical logic, thus obtaining the first and second facial reference points.

[0039] Step S203: Determine the distance to the center ear based on the first facial reference point and the second facial reference point.

[0040] It should be noted that, as Figure 3 As shown, the Central Ear Distance (CED) is the straight-line distance from the glabella (g) or the root of the nose (n) to the attachment point on the upper ear (obs). (Reference) Figure 4 , Figure 4This is a schematic diagram of the center-ear distance provided in this application, where A and B refer to the attachment points on the ear (left and right obs), C refers to point G or N, G refers to the glabella, N refers to the root of the nose, and θ refers to the angle formed by the straight-line distances between G and A and between G and B. The CED (Center-Ear Disc) is a core parameter reflecting the dimensions of the key area on the user's face when wearing glasses. It directly determines key dimensions such as the total width of the frame and the length of the temples. Obtaining the CED ensures that the size output by the model accurately matches the individual facial features of the user, avoiding adaptation deviations caused by generic sizes.

[0041] In this embodiment, a first facial reference point and a second facial reference point can be extracted from the three-dimensional head data. The straight-line distance between the two points is calculated using the Euclidean distance formula to obtain... Figure 4 The distance between AG or BG in the figure is the distance to the center ear.

[0042] If the coordinate unit of the 3D data is pixels (such as 3D data converted from a 2D image), it is necessary to convert the coordinate distance to the actual physical distance by using a standard reference object for calibration (such as placing a calibration card of known size next to the face during acquisition and calculating the actual distance corresponding to each pixel). If the 3D data is directly output in physical units (such as by a professional 3D scanner), no conversion is needed, and the accuracy can be directly preserved.

[0043] Step S204: Extract auxiliary facial parameters from the three-dimensional facial data, and fuse the auxiliary facial parameters and the distance to the center ear to obtain fused feature data.

[0044] It should be noted that auxiliary facial parameters refer to facial detail parameters extracted from 3D facial data to supplement differences in the central ear distance (CED). These are individual facial feature dimensions that the CED cannot cover, including but not limited to nasal bridge height, eye distance, cheek curvature, temporal width, and the distance from the root of the nose to the glabella. Fusion feature data refers to a comprehensive feature set formed by integrating the auxiliary facial parameters and the CED. It includes both the span information corresponding to the CED and the detail difference information corresponding to the auxiliary parameters, and is used as input to the target prediction model.

[0045] Based on the requirements for glasses fitting, auxiliary facial parameters are selected from 3D facial data. For example, the vertical distance calculation method using point clouds is used to locate the 3D coordinates of the nasal root and nasal tip, and the vertical height difference between the two points is calculated using the Euclidean distance formula to obtain the nasal bridge height. The 3D coordinates of the centers of the pupils are identified, and the horizontal distance is extracted to obtain the interpupillary distance. Ten continuous point cloud data points in the middle of the cheek are selected, and the average radius of curvature of this area is calculated using a curvature fitting algorithm to obtain the cheek curvature. Next, the auxiliary facial parameters and the central ear distance are standardized to convert them into standardized values ​​in the [0,1] interval. The conversion formula can be standardized value = (original value - minimum parameter value) / (maximum parameter value - minimum parameter value), where the maximum and minimum values ​​of each parameter are determined based on a statistical sample of 500 Asian subjects. Then, a weighted average is assigned based on the influence weights of the auxiliary facial parameters and the central ear distance on glasses fitting. The weight allocation can be: central ear distance 0.4, interpupillary distance 0.25, nasal bridge height 0.2, and cheek curvature 0.15. Finally, the weighted feature values ​​are integrated and spliced ​​to obtain fused feature data.

[0046] Step S205: Input the fused feature data into a preset target prediction model, obtain the output result based on the target prediction model, and determine the user's target glasses size based on the output result.

[0047] The preset target prediction model refers to a prediction model that is trained and optimized based on a large amount of individual sample data (including the fusion features of the samples, the frame parameter data of the user's glasses and the size data of the glasses). It has the ability to map the user's fusion features to the size of the glasses. The model type includes, but is not limited to, regression models, machine learning models (such as random forests and support vector machines), and shallow neural network models. The model parameters have been determined through training and can be directly used for prediction.

[0048] Converting the obtained fused feature data into an input format acceptable to the target prediction model (e.g., if the model requires a 100-dimensional vector, the fused feature matrix needs to be reduced to a 100-dimensional vector) can avoid prediction failures caused by format mismatch. Specifically, the adapted fused features can be input into the model through system interfaces (such as API interfaces or local data transmission interfaces).

[0049] In this embodiment, the target prediction model first receives the input fused feature data and performs a secondary verification on the fused feature data to determine whether the data format is correct and whether the values ​​are within the valid range. Then, the target prediction model processes the fused feature data through internal algorithms (such as decision tree voting in random forests and formula calculations in regression models) to directly obtain the user's target glasses size.

[0050] In some implementations, the fused feature data can be processed using a target prediction model to obtain frame parameter data (e.g., total frame width 114.4mm, bridge width 11.3mm, temple length 138.5mm). The target eyeglass size can then be determined based on the parameter range of the frame parameter data (e.g., a total frame width of 114.4mm corresponds to "Medium M").

[0051] The output of the target prediction model can include size ratings (such as S / XS / M / L, which are easy for users to understand) and frame parameter data of the user's glasses (such as total frame width, bridge width, temple length, which is convenient for merchants to implement); or it can only output the frame parameter data of the user's glasses or size ratings.

[0052] Output formats include, but are not limited to, text display (such as a mobile app or computer screen displaying "Suitable size: Medium M, total frame width 114mm, bridge width 11mm, temple length 138mm"), graphic display (such as displaying icons corresponding to size levels and schematic diagrams of frame parameters), voice announcement (such as a smart terminal informing the user of the size via voice), and report generation (such as generating a PDF size report and sending it to the user's email). The output format can be adjusted according to the usage scenario. For example, offline stores need to display the information to both users and staff simultaneously, using large screens with text and graphics, while online apps use a concise display with pop-up text that redirects to a list of recommended frames.

[0053] This application obtains the distance to the center ear by locating facial reference points and measuring their distances. The data is then processed by a target prediction model to output the glasses size. This effectively solves the problem of inaccurate fitting caused by the reliance on subjective experience in traditional methods. It achieves objective, accurate and automated matching from individual biometrics to standardized product sizes, significantly improving the accuracy and efficiency of glasses fitting.

[0054] In some optional implementations of this embodiment, the above-described determination of the first facial reference point based on the facial three-dimensional data and the determination of the second facial reference point based on the ear three-dimensional data include: The facial 3D data is identified to determine the user's glabella or nasal root region; a first facial reference point is determined based on the glabella or nasal root region; the ear 3D data is identified to determine the user's ear attachment region; and a second facial reference point is determined based on the ear attachment region.

[0055] In this embodiment, the horizontal range is constrained by the facial midline (the line connecting the midpoint of the line connecting the pupils of both eyes and the tip of the nose), and the vertical range is constrained by the grayscale difference (higher grayscale value in the eyebrow area and lower grayscale value in the area between the eyebrows or the root of the nose), thus defining the area between the eyebrows or the root of the nose. Specifically, the three-dimensional coordinates of the pupils of both eyes and the tip of the nose in the facial 3D data can be identified by an edge detection algorithm (such as the Sobel operator), and the line connecting the midpoint of the line connecting the pupils and the tip of the nose is calculated, which is the facial midline. A threshold segmentation algorithm (such as binarization) is used to determine the area with a grayscale value ≥120 as the eyebrow area (high hair reflectivity), and the area with a grayscale value ≤100 as the candidate area between the eyebrows or the root of the nose. Along the facial midline, the area between the inner endpoints of the two eyebrows (the horizontal range is the distance between the inner endpoints of the two eyebrows, and the vertical range is 3-5 mm) is taken, which is the area between the eyebrows or the root of the nose. Within the area between the eyebrows or at the root of the nose, the minimum gray value point (the depression at the forehead-nose suture where light reflection is minimal) is found through grayscale analysis, or the apex of the depression is found through point cloud curvature analysis. This point is the first facial reference point.

[0056] For example, the anatomical landmarks of the ear canal (a circular depression with a higher point cloud curvature than the surrounding area) are used to determine the reference origin. Then, the attachment boundary of the auricle (where the point cloud density changes abruptly) is offset upwards by 10 mm to delineate the ear attachment area. Specifically, point cloud clustering algorithms can be used to identify the circular region of the ear's three-dimensional data (the ear canal is a concave structure with a significantly higher curvature than the auricle surface), and the center of this region is the center of the ear canal. Using the center of the ear canal as the origin, 10 mm is measured upwards along the auricle attachment boundary (through point cloud density analysis, the point cloud density at the attachment point is 20%–30% higher than that on the auricle surface), and a 3×3 mm area around this location is taken as the ear attachment area. Within the ear attachment area, the point with the smallest change in contour curvature (this point provides the strongest stability when supporting the temple of the glasses), or the center of the area, is found; this point is the second facial reference point.

[0057] This application constrains the range of reference points by using anatomical regions (between the eyebrows or the root of the nose, and the ear attachment area), avoiding the randomness of single-point positioning and reducing the error of traditional manual positioning. At the same time, for special facial features such as sparse eyebrows and deformed ears, stable landmarks such as the facial midline and ear canals can still be used to locate the area.

[0058] In some optional implementations of this embodiment, determining the central ear distance based on the first facial reference point and the second facial reference point includes: A head image is generated based on the head 3D data; the pixel distance between the first facial reference point and the second facial reference point is calculated based on the head image; the pixel distance is converted into an actual physical distance to obtain the center ear distance.

[0059] It should be noted that the head image is obtained by projecting 3D head data. For example, by projecting vertically downwards from the top of the user's head and preserving the relative positions of the first and second facial reference points, the following image is obtained: Figure 4 The image is the projected head image. The pixel coordinates (u, v) can be directly read from this head image. Pixel distance refers to the pixel coordinates of the first facial reference point in the head image (u, v). , ) and the pixel coordinates of the second facial reference point ( The straight-line distance between pixels, measured in pixels, can be calculated using the two-dimensional Euclidean distance formula. The actual physical distance refers to the true spatial distance obtained by calibrating and converting the pixel distance, i.e., the distance between the center ear and the center point.

[0060] In this embodiment, the 3D head data is converted into a 3D head model (such as a triangular mesh model) using a mesh reconstruction algorithm (e.g., Poisson reconstruction, greedy projection triangulation), giving the head structure a clear topological relationship and calculable spatial coordinates. Then, a head image can be generated using projection or other methods. First, the 3D head model is adjusted to a standard pose, and then the facial and ear structures in 3D space are projected onto a 2D plane through coordinate mapping, generating a head image that retains the relative positions of the first and second facial reference points. Simultaneously, the relative proportions of each point in the 3D head model are ensured to remain unchanged (e.g., the spatial distance between two reference points is proportional to the pixel distance in the image), avoiding distortion errors from perspective projection. In a 2D Cartesian coordinate system, the straight-line distance between two pixels can be calculated using the Euclidean distance formula, which has simple calculation logic and low computational requirements. By establishing a mapping relationship between pixels and their actual physical positions using a standard reference object, the ratio of the pixel distance of the reference object in the head image to the actual size of the reference object can be obtained. Based on this ratio, the pixel distance can be converted into the actual physical distance, ensuring that the error of the converted physical distance is controllable.

[0061] This application performs calculations by converting three-dimensional data into two-dimensional data. Two-dimensional pixel distance calculation is faster than three-dimensional spatial distance calculation, which is more conducive to real-time completion on mobile devices and improves user experience. At the same time, calibration with a standard reference object meets the accuracy requirements for size prediction and avoids distance deviations caused by device differences.

[0062] In some optional implementations of this embodiment, the output result is frame parameter data, which includes the total frame width, bridge width, and temple length. The target prediction model includes a total frame width determination layer, a bridge width determination layer, and a temple length determination layer. The above-mentioned input of the fused feature data into a preset target prediction model, and the obtaining of the output result based on the target prediction model, includes: The total width of the frame is determined by the layer, the central ear angle is determined by the fusion feature data, and the total width of the frame is determined based on the fusion feature data and the central ear angle. The nasal bridge width is determined by the nasal bridge width determination layer based on the fused feature data and a preset scaling factor. The temple length is determined by the temple length determination layer based on the fused feature data and a preset correction length.

[0063] It's important to note that the total frame width (BW) refers to the total width of the front frame (in mm), determining whether the frame fits the face and is a core basis for size classification. The bridge width (NW) refers to the horizontal width of the frame at the bridge (in mm), determining whether the nose pads fit the bridge of the nose, preventing the frame from slipping or pressing on the nose. The temple length (LE) refers to the total length of the temples (in mm), from the frame hinge to the end of the temple, determining whether the temples can stably support the ears.

[0064] The central ear angle (∠G) refers to the angle formed by the first facial reference point (g between the eyebrows or n at the root of the nose) and the two second facial reference points (obs on the left and right ears), reflecting the degree of facial width opening (unit: degrees), used for geometric calculation of BW. The preset proportional coefficient refers to a fixed ratio (usually 0.15-0.20) between CED and NW obtained from a large number of samples, ensuring that NW matches the facial nasal width (positively correlated with CED), such as 0.18 (i.e., NW = CED × 0.18). The preset correction length is a fixed value (usually ±5mm) set based on comfort and anatomical characteristics, used to adjust LE to accommodate individual differences from the ear to the temporal region.

[0065] In this embodiment, as Figure 4 As shown, an isosceles triangle is formed by the glabella point G (or the root of the nose) and the attachment points (A and B) on the left and right ears (the two sides are CED, and the base is the distance between the attachment points on the left and right ears). BW is fitted to the base (covering the outer corner of the eye by 2-3mm). Therefore, the fused feature data is analyzed using a target prediction model to obtain the CED and the central ear angle (i.e., the vertex angle of the isosceles triangle) in the fused feature data. In the layer determining the total frame width, the total frame width (BW) can be calculated using trigonometric functions: BW = 2 × CED × sin(∠G / 2) ± ΔW, where ΔW is the correction width. For example, if the user's CED is 100mm, the central ear angle ∠G is 72°, and the correction width ΔW = 2mm, then sin(∠G / 2) = sin36° = 0.587. Substituting this into the formula, we get BW = 2 × 100 × 0.587 ± 2 = 119.4mm. Therefore, the appropriate total frame width (BW) for this user is 119.4 mm.

[0066] In the nasal bridge width determination layer, based on a large number of sample statistics, the ratio of facial nasal width to the actual CED value in the fusion feature data is stable (average 0.15). Therefore, the NW is directly calculated by multiplying the actual CED value by a scaling factor to ensure that the NW matches the nasal width and avoids being too wide (frame slipping) or too narrow (nose pressure). For example, if a user's CED is 100mm and the scaling factor is 0.15, then substituting into the formula, we get NW = 100 × 0.15 ≈ 15mm, indicating that the suitable nasal bridge width for this user is 15mm.

[0067] In determining the temple length, the LE (Lead Length) needs to cover the distance from the ear attachment point to the temporal region and then to the end of the temple. This distance is positively correlated with the actual CED (Current Edge Dimension) value (the larger the CED, the wider the face, and the greater the LE requirement). Therefore, the temple length (LE) can be obtained by multiplying the CED by the proportion (e.g., 1.2) and adding the corrected length (e.g., 19.8mm), balancing the correlation with individual comfort differences. For example, if a user's CED is 100mm, the proportion is 1.2, and the corrected length is 9.8mm, then LE = 100 × 1.2 + 19.8 = 120 + 19.8 = 139.8mm ≈ 140mm.

[0068] The parameters in this application are derived from CED and are highly compatible with individual facial structures (face width, nose width, ear position). Each frame parameter has a clear quantitative logic to avoid errors from manual estimation.

[0069] In some optional implementations of this embodiment, determining the user's target glasses size based on the output result includes: If the output result is the user's glasses size, then the glasses size is determined as the target glasses size; If the output result is the user's frame parameter data, then the target glasses size is determined based on the frame parameter data.

[0070] In this embodiment, the target prediction model can be either a target size prediction model or a target frame parameter prediction model. If the target size prediction model outputs the user's glasses size, then this output glasses size is used as the target glasses size. If the target frame parameter prediction model outputs the frame parameter data suitable for the user's glasses, then the user's target glasses size is determined based on the frame parameter data.

[0071] The frame parameter prediction model outputs frame parameter data including the total frame width, bridge width, and temple length. This fused feature data is input into the model according to its preset input format (1×4-dimensional standardized vector). Based on its built-in feature-frame parameter association algorithm, the model automatically extracts core size correlation information and facial adaptation details from the fused features. After multi-dimensional parameter coupling calculations, it outputs user-specific frame parameter data. Then, based on the mapping relationship between frame parameters and eyeglass size, the user's target eyeglass size is determined.

[0072] In some implementations, the size matching strategy built into the target size prediction model can be invoked to comprehensively compare the frame parameter data output by the target frame parameter prediction model with the preset multi-size adaptation standards (the comparison dimensions include the adaptability of the total frame width and the distance to the center ear, the matching degree of the bridge of the nose and the facial bridge of the nose, etc.), and finally determine the glasses size corresponding to the current user's frame parameter data, and simultaneously output the size adaptation reliability, thus completing the final determination of the glasses size.

[0073] In other implementations, the target eyeglass size can be obtained by mapping the frame parameter data output by the target frame parameter prediction model through a mapping table or mapping formula.

[0074] In this embodiment, a grading chart for eyeglasses sizes can be preset based on a large number of sample statistics. The total frame width (BW) is given priority as the main matching criterion (because the total frame width has the greatest impact on fit). The bridge width and temple length are used for verification (if the total frame width is within the M size range, but the temple length is within the L size range, the rationality of the model output needs to be re-verified) to ensure that the size level is logically consistent with the frame parameters.

[0075] Example, reference Figure 5 , Figure 5 This application provides a grading chart for eyeglasses sizes, primarily using the total frame width (BW) as the core matching criterion. For example, if the target user's CED (Cost Estimated Dimensions) in the fused feature data is 95mm, the model will calculate the total frame width as 115mm. The target frame parameter prediction model receives the user's fused feature data and obtains the frame parameter data. In this model, the total frame width (total frame width) is 115mm. (See reference...) Figure 5 It can be seen that CED=95mm falls within the CED length range (90-100mm) of "Medium (M)" and the total frame width of 115mm also falls within the total frame width range (110-120mm) corresponding to "Medium (M)". Therefore, it can be determined that the user's glasses size is Medium (M) and is suitable for "children (9-12 years old), teenagers (13-15 years old), and adults with narrow heads".

[0076] For example, if the target user's CED is 105mm in the fused feature data, the total frame width (total frame width) in the frame parameter prediction model obtained from the target frame parameter prediction model is 125mm. (Compare) Figure 5 It can be seen that CED=105mm falls within the CED length range (100-110mm) of "Large (L)", and the total frame width of 125mm falls within the range (120-130mm) corresponding to "Large (L)". Therefore, it can be determined that the user's glasses size is Large (L), and the suitable people are "teenagers (16-18 years old) and adults with regular head shapes".

[0077] This application further determines the glasses size through the model output results, mainly based on a two-step process of parameter mapping and level matching. It utilizes the model correlation to ensure that the parameters are accurately adapted to the user's facial features (CED, auxiliary parameters), and avoids adaptation deviation caused by a single output level or parameter through parameter verification and level rule matching, thereby improving the success rate of the initial adaptation.

[0078] In some optional implementations of this embodiment, the target prediction model is a target size prediction model. Before inputting the fused feature data into the preset target prediction model and obtaining the output result based on the target prediction model, the following steps are included: Obtain the fusion feature data of multiple individual samples and the eyeglass size of the multiple individual samples, and divide the fusion feature data of the multiple individual samples and the eyeglass size of the multiple individual samples into a training set and a test set; Create a basic prediction model, and train the basic prediction model based on the training set to obtain an initial size prediction model; Based on the test set, the initial size prediction model is optimized to obtain the target size prediction model.

[0079] In this embodiment, the individual samples cover population samples with different characteristics (age 18-65 years, Asian / European, facial type including compact / standard / wide) to provide raw data for model training.

[0080] Based on anatomical and individual sample fitting verification, a positive correlation exists between the CED value in the fused feature data and frame parameters. Furthermore, a mapping relationship exists between frame parameters and eyeglass size; specifically, a larger CED corresponds to larger BW and LE. Therefore, stratified sampling can be employed to ensure consistent distribution of features (such as size grades) in the training and test sets (e.g., M size accounts for 30% in the training set and 30% in the test set), avoiding sampling bias that might cause the model to only fit a certain type of sample, and ensuring the reliable correspondence between CED, frame parameters, and size.

[0081] In some implementations, a basic predictive model can be constructed using a regression model. A regression model is a statistically based model used to study the causal relationship between independent variables (fusion feature data) and dependent variables (glasses size). For example, multiple individuals are selected, and the 3D head data of each sample is measured using a 3D scanner. A first facial reference point is determined based on the facial 3D data, and a second facial reference point is determined based on the ear 3D data. The central-ear distance is determined based on the first and second facial reference points. Auxiliary facial parameters are extracted from the facial 3D data, and these parameters are fused with the central-ear distance to obtain fusion feature data. The fusion feature data and glasses size of multiple individual samples are divided into training and test sets, for example, with a 7:3 ratio. Both the training and test sets should include the fusion feature data and glasses size of multiple individual samples. The fusion feature data from the training set is used as input features, and the glasses size is used as the output label. Next, the model parameters can be adjusted using optimization algorithms (such as gradient descent or decision tree voting in random forests) to minimize the error between the predicted values ​​and the actual labels. This allows the basic prediction model to learn the correlation between input features and output labels, resulting in an initial size prediction model. The model's generalization ability is then validated using a test set. If the test set error is large, the complexity of the initial size prediction model is adjusted (e.g., increasing the number of decision trees or adding regularization) or additional samples are added until the error reaches the target level, avoiding overfitting (accurate training set, poor test set). Finally, the target size prediction model is obtained.

[0082] This application improves the accuracy of the target size prediction model by training with a large number of samples and optimizing with a large number of test sets, far exceeding the accuracy of traditional manual judgment. At the same time, stratified sampling ensures that the model is adapted to different groups of people (such as different sizes), avoiding prediction bias for certain types of samples.

[0083] In some optional implementations of this embodiment, the target prediction model is a target frame parameter prediction model. Before inputting the fused feature data into the preset target prediction model and obtaining the output result based on the target prediction model, the following steps are included: The fusion feature data of multiple individual samples and the frame parameter data of the multiple individual samples are obtained, and the fusion feature data of the multiple individual samples and the frame parameter data of the multiple individual samples are divided into a training set and a test set. Create a basic prediction model, and train the basic prediction model based on the training set to obtain an initial frame parameter prediction model; Based on the test set, the initial frame parameter prediction model is optimized to obtain the target frame parameter prediction model.

[0084] In this embodiment, the individual samples also encompass population samples with different characteristics to provide raw data for model training. Similarly, the model parameters are adjusted through optimization algorithms (such as gradient descent and decision tree voting in random forests) to minimize the error between the predicted values ​​and the actual labels, allowing the basic prediction model to learn the correlation between input features and output labels, thus obtaining the initial frame parameter prediction model.

[0085] The fusion feature data and frame parameter data of multiple individual samples are divided into training and test sets, for example, a 7:3 ratio. Both the training and test sets should include fusion feature data and frame parameter data of multiple individual samples. The fusion feature data in the training set is used as input features, and the frame parameter data is used as output labels. A gradient boosting algorithm is used to train the model, adjusting its parameters until the training set accuracy reaches a target, resulting in an initial frame parameter prediction model. The test set is then input into the initial frame parameter prediction model, and the test set accuracy is calculated. Based on the accuracy, the initial frame parameter prediction model is optimized to improve its prediction accuracy. Finally, the optimized model is used as the target frame parameter prediction model, and its parameters are saved for later use.

[0086] This application improves the accuracy of the target frame parameter prediction model by training with a large number of samples and optimizing with a large number of test sets, far exceeding the accuracy of traditional manual judgment. At the same time, stratified sampling ensures that the model is adapted to different groups of people (such as different sizes), avoiding prediction bias for certain types of samples.

[0087] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).

[0088] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0089] Further reference Figure 6 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of a device for determining eyeglass size, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0090] like Figure 6 As shown, the eyeglasses size determination device 600 described in this embodiment includes: an acquisition module 601, a first determination module 602, a second determination module 603, a fusion module 604, and an output module 605. Wherein: The acquisition module 601 is used to acquire the user's head three-dimensional data, which includes at least facial three-dimensional data and ear three-dimensional data; The first determining module 602 is used to determine a first facial reference point based on the facial three-dimensional data, and to determine a second facial reference point based on the ear three-dimensional data. The second determining module 603 is used to determine the distance to the center ear based on the first facial reference point and the second facial reference point; The fusion module 604 is used to extract auxiliary facial parameters from the facial 3D data, and fuse the auxiliary facial parameters and the central ear distance to obtain fused feature data; The output module 605 is used to input the fused feature data into a preset target prediction model, obtain an output result based on the target prediction model, and determine the user's target glasses size based on the output result.

[0091] The eyeglasses size determination device provided in this application obtains the center-ear distance by locating facial reference points and measuring their distances, and then processes the data through a size prediction model to output the eyeglasses size. This effectively solves the problem of inaccurate fitting caused by the reliance on subjective experience in traditional methods, and realizes objective, accurate and automated matching from individual biometrics to standardized product sizes, significantly improving the accuracy and efficiency of eyeglasses fitting.

[0092] In some optional implementations of this embodiment, the first determining module 602 is further configured to: The facial 3D data is identified to determine the user's glabella or nasal root region; a first facial reference point is determined based on the glabella or nasal root region; the ear 3D data is identified to determine the user's ear attachment region; and a second facial reference point is determined based on the ear attachment region.

[0093] This application constrains the range of reference points by using anatomical regions (between the eyebrows or the root of the nose, and the ear attachment area), avoiding the randomness of single-point positioning and reducing the error of traditional manual positioning. At the same time, for special facial features such as sparse eyebrows and deformed ears, stable landmarks such as the facial midline and ear canals can still be used to locate the area.

[0094] In some optional implementations of this embodiment, the second determining module 603 is further configured to: A head image is generated based on the head 3D data; the pixel distance between the first facial reference point and the second facial reference point is calculated based on the head image; the pixel distance is converted into an actual physical distance to obtain the center ear distance.

[0095] This application performs calculations by converting three-dimensional data into two-dimensional data. Two-dimensional pixel distance calculation is faster than three-dimensional spatial distance calculation, which is more conducive to real-time completion on mobile devices and improves user experience. At the same time, calibration with a standard reference object meets the accuracy requirements for size prediction and avoids distance deviations caused by device differences.

[0096] In some optional implementations of this embodiment, the output module 605 is further configured to: The total width of the frame is determined by the layer, the central ear angle is determined by the fusion feature data, and the total width of the frame is determined based on the fusion feature data and the central ear angle. The nasal bridge width is determined by the nasal bridge width determination layer based on the fused feature data and a preset scaling factor. The temple length is determined by the temple length determination layer based on the fused feature data and a preset correction length.

[0097] This application uses parameters derived from CED to be highly compatible with individual facial structures (face width, nose width, ear position), and each frame parameter has a clear quantitative logic to avoid errors from manual estimation.

[0098] In some optional implementations of this embodiment, the output module 605 is further configured to: If the output result is the user's glasses size, then the glasses size is determined as the target glasses size; If the output result is the user's frame parameter data, then the target glasses size is determined based on the frame parameter data.

[0099] This application further determines the glasses size through the model output results, mainly based on a two-step process of parameter mapping and level matching. It utilizes the model correlation to ensure that the parameters are accurately adapted to the user's facial features (CED, auxiliary parameters), and avoids adaptation deviation caused by a single output level or parameter through parameter verification and level rule matching, thereby improving the success rate of the initial adaptation.

[0100] In some optional implementations of this embodiment, the output module 605 is further configured to: Obtain the fusion feature data of multiple individual samples and the eyeglass size of the multiple individual samples, and divide the fusion feature data of the multiple individual samples and the eyeglass size of the multiple individual samples into a training set and a test set; Create a basic prediction model, and train the basic prediction model based on the training set to obtain an initial size prediction model; Based on the test set, the initial size prediction model is optimized to obtain the target size prediction model.

[0101] This application improves the accuracy of the target size prediction model by training with a large number of samples and optimizing with a large number of test sets, far exceeding the accuracy of traditional manual judgment. At the same time, stratified sampling ensures that the model is adapted to different groups of people (such as different sizes), avoiding prediction bias for certain types of samples.

[0102] In some optional implementations of this embodiment, the output module 605 is further configured to: The fusion feature data of multiple individual samples and the frame parameter data of the multiple individual samples are obtained, and the fusion feature data of the multiple individual samples and the frame parameter data of the multiple individual samples are divided into a training set and a test set. Create a basic prediction model, and train the basic prediction model based on the training set to obtain an initial frame parameter prediction model; Based on the test set, the initial frame parameter prediction model is optimized to obtain the target frame parameter prediction model.

[0103] This application improves the accuracy of the target frame parameter prediction model by training with a large number of samples and optimizing with a large number of test sets, far exceeding the accuracy of traditional manual judgment. At the same time, stratified sampling ensures that the model is adapted to different groups of people (such as different sizes), avoiding prediction bias for certain types of samples.

[0104] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed] for details. Figure 7 , Figure 7This is a basic structural block diagram of the computer device in this embodiment.

[0105] The computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected via a system bus. It should be noted that only the computer device 7 with components 71, 72, and 73 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0106] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0107] The memory 71 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 71 may be an internal storage unit of the computer device 7, such as the hard disk or memory of the computer device 7. In other embodiments, the memory 71 may also be an external storage device of the computer device 7, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 7. Of course, the memory 71 may include both the internal storage unit and its external storage device of the computer device 7. In this embodiment, the memory 71 is typically used to store the operating system and various application software installed on the computer device 7, such as computer-readable instructions for determining eyeglass size. In addition, the memory 71 can also be used to temporarily store various types of data that have been output or will be output.

[0108] In some embodiments, the processor 72 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 72 is typically used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is used to execute computer-readable instructions stored in the memory 71 or to process data, such as executing computer-readable instructions for the method of determining eyeglass size.

[0109] The network interface 73 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 7 and other electronic devices.

[0110] The computer device provided in this application obtains the central ear distance by locating facial reference points and measuring their distances, and then processes the data through a size prediction model to output the glasses size. This effectively solves the problem of inaccurate fitting caused by the reliance on subjective experience in traditional methods, and realizes objective, accurate and automated matching from individual biometrics to standardized product sizes, significantly improving the accuracy and efficiency of glasses fitting.

[0111] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the method for determining eyeglass size as described above.

[0112] The computer-readable storage medium provided in this application obtains the central ear distance by locating facial reference points and measuring their distances, and then processes the data through a size prediction model to output the glasses size. This effectively solves the problem of inaccurate fitting caused by the reliance on subjective experience in traditional methods, and realizes objective, accurate and automated matching from individual biometrics to standardized product sizes, significantly improving the accuracy and efficiency of glasses fitting.

[0113] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0114] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A method for determining eyeglass size, characterized in that, Includes the following steps: Acquire the user's three-dimensional head data, which includes at least facial three-dimensional data and ear three-dimensional data; A first facial reference point is determined based on the facial 3D data, and a second facial reference point is determined based on the ear 3D data. The distance to the center ear is determined based on the first facial reference point and the second facial reference point; Auxiliary facial parameters are extracted from the three-dimensional facial data, and the auxiliary facial parameters and the distance to the center ear are fused to obtain fused feature data; The fused feature data is input into a preset target prediction model, and the output result is obtained based on the target prediction model. The target glasses size of the user is determined based on the output result.

2. The method for determining eyeglass size according to claim 1, characterized in that, The determination of a first facial reference point based on the facial three-dimensional data and a second facial reference point based on the ear three-dimensional data includes: The facial 3D data is used to identify the user's glabella or nasal root area; The first facial reference point is determined based on the area between the eyebrows or the root of the nose. The three-dimensional data of the ear are identified to determine the user's ear attachment area; The second facial reference point is determined based on the ear attachment area.

3. The method for determining eyeglass size according to claim 1, characterized in that, Determining the distance to the center ear based on the first facial reference point and the second facial reference point includes: Generate a head image based on the aforementioned three-dimensional head data; Based on the head image, calculate the pixel distance between the first facial reference point and the second facial reference point; The pixel distance is converted into the actual physical distance to obtain the center ear distance.

4. The method for determining eyeglass size according to claim 1, characterized in that, The output is frame parameter data, which includes the total frame width, bridge width, and temple length. The target prediction model includes a total frame width determination layer, a bridge width determination layer, and a temple length determination layer. The step of inputting the fused feature data into a preset target prediction model and obtaining the output result based on the target prediction model includes: The total width of the frame is determined by the layer, the central ear angle is determined by the fusion feature data, and the total width of the frame is determined based on the fusion feature data and the central ear angle. The nasal bridge width is determined by the nasal bridge width determination layer based on the fused feature data and a preset scaling factor. The temple length is determined by the temple length determination layer based on the fused feature data and a preset correction length.

5. The method for determining eyeglass size according to claim 1, characterized in that, Determining the user's target glasses size based on the output result includes: If the output result is the user's glasses size, then the glasses size is determined as the target glasses size; If the output result is the user's frame parameter data, then the target glasses size is determined based on the frame parameter data.

6. The method for determining eyeglass size according to claim 1, characterized in that, The target prediction model is a target size prediction model. Before inputting the fused feature data into the preset target prediction model and obtaining the output result based on the target prediction model, the method further includes: Obtain the fusion feature data of multiple individual samples and the eyeglass size of the multiple individual samples, and divide the fusion feature data of the multiple individual samples and the eyeglass size of the multiple individual samples into a training set and a test set; Create a basic prediction model, and train the basic prediction model based on the training set to obtain an initial size prediction model; Based on the test set, the initial size prediction model is optimized to obtain the target size prediction model.

7. The method for determining eyeglass size according to claim 1, characterized in that, The target prediction model is a target frame parameter prediction model. Before inputting the fused feature data into the preset target prediction model and obtaining the output result based on the target prediction model, the method further includes: The fusion feature data of multiple individual samples and the frame parameter data of the multiple individual samples are obtained, and the fusion feature data of the multiple individual samples and the frame parameter data of the multiple individual samples are divided into a training set and a test set. Create a basic prediction model, and train the basic prediction model based on the training set to obtain an initial frame parameter prediction model; Based on the test set, the initial frame parameter prediction model is optimized to obtain the target frame parameter prediction model.

8. A device for determining eyeglass size, characterized in that, include: The acquisition module is used to acquire the user's head three-dimensional data, which includes at least facial three-dimensional data and ear three-dimensional data; The first determining module is used to determine a first facial reference point based on the facial three-dimensional data, and to determine a second facial reference point based on the ear three-dimensional data. The second determining module is used to determine the distance to the center ear based on the first facial reference point and the second facial reference point; The fusion module is used to extract auxiliary facial parameters from the facial 3D data, and fuse the auxiliary facial parameters with the central ear distance to obtain fused feature data; The output module is used to input the fused feature data into a preset target prediction model, obtain the output result based on the target prediction model, and determine the user's target glasses size based on the output result.

9. A computer device, characterized in that, The device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the method for determining eyeglass size as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the method for determining eyeglass size as described in any one of claims 1 to 7.