Frame modeling method and device, computer device and storage medium
By constructing a baseline geometric model of the eyeglass frame, identifying material parameters, and rendering a similarity matrix to correct the eyeglass frame model, the problem of insufficient precision in 3D modeling of eyeglass frames was solved, and high-precision 3D model reconstruction of eyeglass frames was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN HUIMING EYEGLASSES CO LTD
- Filing Date
- 2026-06-23
- Publication Date
- 2026-07-21
AI Technical Summary
Existing 3D modeling technology for eyeglass frames suffers from insufficient modeling precision, resulting in reduced quality and practicality of the 3D models and failing to meet the industry's requirements for high-precision modeling.
By acquiring initial point cloud data and reference images of the frame, a baseline geometric model is constructed, the material parameters of the components are identified, the model material is adjusted, the image is rendered and a similarity matrix is calculated, and the model is corrected based on the similarity matrix to gradually eliminate appearance deviations and improve modeling precision.
It achieves high-precision reproduction of the three-dimensional model of the eyeglass frame, with an appearance close to the real object, eliminating the appearance gap between the model and the real object, and reaching a higher production standard.
Smart Images

Figure CN122435166A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of eyeglass frame modeling technology, and in particular to an eyeglass frame modeling method, apparatus, computer equipment and storage medium. Background Technology
[0002] With the popularization of virtual try-on technology and the advancement of the construction of industry digital asset libraries, the demand for 3D digital modeling of eyeglass frames continues to rise. High-precision and high-fidelity 3D models have become the foundation for product display and process review.
[0003] Currently, the main methods for obtaining 3D models of eyeglass frames are manual modeling, multi-view image reconstruction, and conventional 3D scanning. These are the mainstream methods in the industry and can initially achieve a 3D digital representation of eyeglass frames.
[0004] However, the aforementioned technologies generally suffer from insufficient modeling precision during the 3D modeling of eyeglass frames. Manual modeling relies on human experience and struggles to accurately replicate the complex curved surfaces and microstructures of the frames; multi-view image reconstruction is susceptible to interference, leading to missing model details and structural distortion; conventional 3D scanning cannot effectively capture the features of minute components, resulting in low model dimensional accuracy and blurred edge contours.
[0005] Such deficiencies in precision significantly reduce the quality and practicality of 3D models of eyeglass frames, failing to meet the industry's requirements for high-precision modeling and becoming a key bottleneck restricting the application and development of 3D digital technology for eyeglass frames.
[0006] In view of the above, this application is hereby submitted. Summary of the Invention
[0007] The purpose of this application is to provide a method, apparatus, computer equipment, and storage medium for modeling eyeglass frames, in order to solve the technical problem of insufficient modeling precision during the 3D scanning modeling of eyeglass frames.
[0008] To address the aforementioned technical problems, this application provides a method for modeling eyeglass frames, employing the following technical solution: Acquire the initial point cloud data and reference image of the eyeglass frame, and construct the reference geometric model of the eyeglass frame based on the initial point cloud data; The material parameters of each component of the eyeglass frame are identified based on the reference image to obtain a set of material parameters. The reference geometric model is then adjusted based on the set of material parameters to obtain an initial eyeglass frame model. Based on preset environmental parameters, the initial frame model is rendered to obtain a rendered image of the frame, and the similarity matrix between the rendered image and the reference image is calculated. The initial frame model is corrected based on the similarity matrix to obtain the target frame model.
[0009] Furthermore, calculating the similarity matrix between the rendered image and the reference image includes: The rendered image is divided into multiple rendered image blocks, and the reference image is divided into multiple reference image blocks, with one rendered image block corresponding to one reference image block; Calculate the similarity data between each of the rendered image blocks and each of the reference image blocks; Obtain the arrangement sequence of all the reference image blocks, and sort all the similarity data according to the arrangement sequence of all the reference image blocks to obtain the similarity matrix.
[0010] Furthermore, the step of correcting the initial frame model based on the similarity matrix to obtain the target frame model includes: Determine whether each of the aforementioned similarity data falls within a preset similarity range; If all the similarity data are within the similarity interval, then the initial frame model is determined as the target frame model; If there is similarity data that is not in the similarity range, then identify the difference image block between the rendered image and the reference image, and correct the material parameters of the component corresponding to the difference image block to obtain the locally corrected material parameters; The material parameter set is updated according to the locally modified material parameters to obtain the target material parameter set. The target material parameter set is used as the material parameter set, and the process of adjusting the reference geometric model according to the material parameter set is returned to obtain the initial frame model.
[0011] Furthermore, the step of correcting the material parameters of the components corresponding to the difference image blocks to obtain locally corrected material parameters includes: Obtain the mapping relationship between the rendered image and the frame; based on the mapping relationship, locate the component corresponding to the difference image block; and read the material parameters of the component corresponding to the difference image block. Based on the similarity matrix, determine the gradient deviation value corresponding to the differing image patch; Based on the gradient deviation value, the material parameters of the corresponding components of the difference image block are corrected to obtain the local corrected material parameters.
[0012] Furthermore, constructing the reference geometric model of the eyeglass frame based on the initial point cloud data includes: Based on the initial point cloud data, an initial geometric model of the eyeglass frame is generated; Obtain the central symmetry plane of the initial geometric model, and based on the central symmetry plane, mirror the initial geometric model to obtain mirrored point cloud data; Based on the mirrored point cloud data and the initial point cloud data, generate the deformation deviation matrix of the eyeglass frame; The initial geometric model is corrected based on the deformation deviation matrix to obtain the reference geometric model.
[0013] Furthermore, the step of adjusting the baseline geometric model according to the set of material parameters to obtain the initial frame model includes: Calculate the principal curvature data corresponding to each component in the reference geometric model, and generate the curvature distribution characteristics of the reference geometric model based on multiple principal curvature data. Based on the curvature distribution characteristics, the seam hiding area of the frame is selected from the reference geometric model, and the texture coordinates of the frame are obtained based on the seam hiding area. The baseline geometric model is adjusted based on the set of material parameters and the texture coordinates to obtain the initial frame model.
[0014] Furthermore, the frame includes metal components and transparent components, and acquiring the initial point cloud data of the frame includes: The metal component is scanned according to preset exposure parameters to obtain the first point cloud data; Multiple sampling points of the transparent component are obtained, the normal vector and reflection intensity of each sampling point are extracted, interference points in the sampling points are identified based on the normal vector and the reflection intensity, and the interference points are filtered out from the sampling points to obtain the second point cloud data; The initial point cloud data is generated based on the first point cloud data and the second point cloud data.
[0015] To address the aforementioned technical problems, this application also provides a frame modeling device, which employs the following technical solution: A frame modeling device, comprising: A construction module is used to acquire initial point cloud data and reference images of the eyeglass frame, and to construct a reference geometric model of the eyeglass frame based on the initial point cloud data. The adjustment module is used to identify the material parameters of each component of the eyeglass frame based on the reference image, obtain a set of material parameters, and adjust the reference geometric model according to the set of material parameters to obtain an initial eyeglass frame model; The rendering module is used to render the initial frame model according to preset environmental parameters to obtain a rendered image of the frame, and to calculate the similarity matrix between the rendered image and the reference image. The correction module is used to correct the initial frame model based on the similarity matrix to obtain the target frame model.
[0016] 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 eyeglass frame modeling method as described above.
[0017] 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 that, when executed by a processor, implement the steps of the eyeglass frame modeling method described above.
[0018] Compared with the prior art, this application has the following main advantages: The eyeglass frame modeling method disclosed in this application acquires initial point cloud data and reference images of the eyeglass frame, and constructs a baseline geometric model of the frame based on the initial point cloud data. This method can completely reproduce the overall shape and various fine structures of the frame, improving the accuracy of the geometric shape reproduction. Secondly, by identifying the material parameters of corresponding components in the reference image and adjusting the baseline geometric model according to these parameters, an initial eyeglass frame model is obtained. This allows the model to present an appearance similar to the real object, reducing the appearance gap between the model and the actual object. Next, the initial eyeglass frame model is rendered according to preset environmental parameters to obtain a rendered image, and the similarity matrix between the rendered image and the reference image is calculated. This clearly shows the magnitude of the appearance difference between the model and the actual object, providing a direct reference for subsequent model adjustments. Finally, the initial eyeglass frame model is corrected based on the similarity matrix to obtain the target eyeglass frame model. This gradually eliminates appearance deviations in the model, improves the modeling precision of the final model, and allows the 3D eyeglass frame model to reach a higher manufacturing standard. Attached Figure Description
[0019] 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 based on these drawings without creative effort.
[0020] Figure 1 This is an exemplary system architecture diagram to which this application can be applied; Figure 2 This is a flowchart of an embodiment of the frame modeling method according to this application; Figure 3 This is a schematic diagram of a structure of one embodiment of the eyeglass frame modeling device according to this application; Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0021] 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.
[0022] 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.
[0023] 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.
[0024] 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.
[0025] 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 to 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.
[0026] 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.
[0027] 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.
[0028] It should be noted that the eyeglass frame modeling method provided in this application embodiment is generally executed by a terminal device, and correspondingly, the eyeglass frame modeling device is generally set in the terminal device.
[0029] 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.
[0030] Continue to refer to Figure 2 A flowchart of an embodiment of the eyeglass frame modeling method according to this application is shown. The eyeglass frame modeling method includes the following steps: Step S201: Obtain the initial point cloud data and reference image of the eyeglass frame, and construct the reference geometric model of the eyeglass frame based on the initial point cloud data.
[0031] In this embodiment, the frame modeling method operates on electronic devices (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-wide band) connections, and other currently known or future wireless connection methods.
[0032] In this embodiment, the initial point cloud data refers to the set of discrete points representing the three-dimensional spatial structure of the eyeglass frame, obtained by multi-directional acquisition of the entire frame using a three-dimensional scanning device and after preprocessing; the reference image refers to the image data obtained by photographing the actual eyeglass frame; and the baseline geometric model refers to the basic model of the eyeglass frame with complete geometric shape and regular topological structure, constructed based on the initial point cloud data.
[0033] The frame was scanned from all angles using a 3D scanning device to obtain initial point cloud data. Simultaneously, reference images of the frame from different perspectives, including the front and side views, were acquired using a camera. The initial point cloud data was obtained by using scanning methods adapted to the different material properties of the frame. For material differences in different areas of the frame, matching scanning parameters were used to complete the data acquisition and then stitching together to ensure the integrity of the point cloud data. The initial point cloud data was imported into a modeling platform, where point cloud regularization and geometric modeling operations were performed. Considering the frame's symmetrical structural characteristics, the model underwent geometric calibration to eliminate morphological deviations generated during scanning, making the model's geometry more closely match the standard structure of the actual frame. The final result is a baseline geometric model of the frame, which fully presents the frame's outline and fine structure, with a geometric shape conforming to the actual standard.
[0034] Step S202: Identify the material parameters of each component of the eyeglass frame based on the reference image to obtain a set of material parameters, and adjust the reference geometric model based on the set of material parameters to obtain an initial eyeglass frame model.
[0035] In this embodiment, the material parameter set is a set of parameters representing the surface texture and visual effect of the eyeglass frame, including at least color parameters, roughness parameters, metallicity parameters, transparency parameters, and texture parameters. Specifically, the color parameter determines the base color of the frame surface; the roughness parameter describes the smoothness of the frame surface; the metallicity parameter represents the strength of the frame's metallic material properties, reflecting mirror reflection and highlighting effects; the transparency parameter reflects the degree of transparency in the transparent or semi-transparent areas of the frame; and the texture parameter presents the patterns and markings on the frame surface.
[0036] Specifically, the reference image of the eyeglass frame is first preprocessed to remove background interference and retain the image data of the main body area of the frame. The processed reference image is then converted to a Hue, Saturation, Value (HSV) color space, and the hue, saturation, and value distribution characteristics of the pixels within the image are statistically analyzed. Based on the hue distribution in the HSV color space, the basic color data of the frame surface is extracted to obtain the frame's color parameters. Based on the reflection characteristics of saturation and value in the HSV color space, the metallic optical reflection properties of the frame surface are identified to obtain metallicity parameters. Highlight areas in the image are located based on the value reflection characteristics. The gradient values of light and dark transitions at the edges of these highlight areas are calculated to characterize the degree of light and dark transition at the highlight edges. The variance of the value of value for all pixels within the highlight area is statistically analyzed to characterize the uniformity of brightness within the highlight area. Finally, the pixel area ratio of the highlight area is calculated to characterize the diffusion range of the highlight. The three values—light and dark transition gradient value, lightness variance, and area ratio—are weighted. A weighted sum of these values is then calculated, and the sum is clamped between [0,1] to obtain the roughness parameter. The weights are set such that the sum of the three values equals 1; for example, the weight for the light and dark transition gradient value can be set to 0.5, the lightness variance to 0.3, and the area ratio to 0.2. Transparent areas in the image are located, and the mean saturation and lightness variance of the pixels in these areas are statistically analyzed to obtain the transparency parameter. The mean saturation represents the transparency, and the lightness variance represents the transparency texture. Details such as textures and markings on the surface of the eyeglass frame in the reference image are identified to obtain the texture parameter. All the above parameters are then integrated to obtain the material parameter set.
[0037] Finally, based on the UV coordinates in the baseline geometric model, texture parameters are attached to the corresponding surfaces of the baseline geometric model. Here, UV coordinates refer to the two-dimensional texture coordinates of the mesh surface of the baseline geometric model. Specifically, this can be achieved by meshing and automatically unwrapping the baseline geometric model to generate globally unified two-dimensional texture coordinates. The material application areas are then divided according to the frame structure boundaries, and material parameters such as color, roughness, metallicity, transparency, and texture from the material parameter set are matched and bound to the corresponding UV areas to obtain the initial frame model. Alternatively, the baseline geometric model can be divided into multiple independent structural components according to the actual frame structure, including the frame, temples, nose pads, lenses, and hinges. Local texture coordinates or independent material channels are generated for each independent component, and each component is matched with its corresponding material parameters. Material assignment and adjustment are completed independently for each component, and finally, these components are stitched together to obtain the complete initial frame model.
[0038] Step S203: Render the initial frame model according to preset environmental parameters to obtain a rendered image of the frame, and calculate the similarity matrix between the rendered image and the reference image.
[0039] In this embodiment, environmental parameters are a set of parameters used to limit the rendering conditions of the model, including at least lighting parameters, rendering viewpoint parameters, and background parameters. Lighting parameters are used to set the type, intensity, and distribution of light sources in the rendering scene, ensuring that the lighting and shadow effects on the model surface conform to the standard state of a real-world object. Rendering viewpoint parameters are used to determine the viewing angle during model rendering, ensuring that the rendering viewpoint matches the shooting angle of the reference image. Background parameters are used to set the background state during rendering, avoiding background interference with the model's appearance. The rendered image is a visual representation of the initial frame model generated under the aforementioned environmental parameter settings, used for appearance comparison with the real-world reference image. The similarity matrix is a set of values characterizing the degree of difference between different regions of the rendered image and the reference image, intuitively reflecting the degree of matching between the model's appearance and the real object.
[0040] In this embodiment, unified environmental parameters are first set to keep lighting conditions, rendering perspective, background state, and image resolution stable, ensuring that the model rendering conditions are consistent with the shooting conditions of the reference image. Under the set environmental parameters, a rendering operation is performed on the initial frame model to generate a rendered image consistent with the viewing perspective of the actual object. The rendered image and the reference image are aligned in position and size so that the main area of the frame in the two images corresponds completely. The color, texture, and details of the two images are compared region by region, and a similarity matrix reflecting the differences between each region is generated based on the comparison results. Specifically, a fixed-size sliding window can be used to perform full-coverage sliding sampling on both the rendered image and the reference image; the similarity of each local image region captured by the sliding window is calculated, and then all similarity values are integrated sequentially according to the row and column spatial arrangement order of the sliding window in the image to generate a two-dimensional similarity matrix. Alternatively, visual features such as overall texture, color, and gradient can be extracted from both the rendered image and the reference image to form a set of image feature vectors. The similarity data between each pair of these feature vectors can then be calculated. Following the arrangement dimension of the feature vectors, the resulting similarity data can be neatly arranged and combined to construct a similarity matrix. Alternatively, the rendered image and the reference image can be segmented to obtain multiple image patches. The similarity data for all corresponding image patches can be calculated, and these similarity data can be combined to obtain a similarity matrix. For the above similarity calculation, the pixel mean of the two image regions to be compared can be calculated to determine the brightness similarity; then, the contrast similarity can be calculated using the pixel standard deviation; and the structural similarity can be solved using the pixel covariance. Finally, the three indicators are multiplied and normalized to obtain similarity data in the 0-1 range.
[0041] Step S204: Correct the initial frame model according to the similarity matrix to obtain the target frame model.
[0042] In this embodiment, based on the difference information between the rendered image and the reference image reflected by the similarity matrix, the initial frame model is optimized and corrected to eliminate appearance deviations on the model surface. After correction, the appearance of the initial frame model is closer to that of the actual frame, ultimately forming a target frame model that meets modeling standards. This process aims to improve the model's appearance fidelity, allowing the final model to present the same visual effect as the real object. Specifically, based on the similarity matrix, the degree of difference between the rendered image and the reference image, i.e., the degree of difference between the model and the real object, can be determined first. When there is a difference between the rendered image and the reference image, the area with the difference is located in the rendered image, and the material parameters of the frame component corresponding to the area with the difference are corrected, resulting in locally corrected material parameters.
[0043] In some implementations, the similarity data corresponding to the differences in the similarity matrix can be converted into gradient deviation values, which can then be used to correct the material parameters of the components corresponding to the differences. Alternatively, in color spaces such as HSV and RGB, the hue, saturation, brightness, and pixel color differences between the rendered image and the reference image in the areas with differences can be statistically analyzed. These color residuals can be used as a basis for correction, allowing for targeted adjustment of color and transparency parameters to correct the frame's base color, saturation, and transparency. The corrected local material parameters are then used to update the original material parameter set. The updated material parameter set is then used to remap the initial frame model before rendering and comparison. If the model's appearance matches the actual object, the current model is directly used as the final model, thus defining the initial frame model as the target frame model. If the matching does not meet the requirements, the material parameters in the model are continuously optimized and adjusted until the model's appearance conforms to the standard.
[0044] This application acquires initial point cloud data and reference images of the eyeglass frame and constructs a baseline geometric model of the frame based on the initial point cloud data. This allows for the complete reproduction of the overall shape and various fine structures of the frame, improving the accuracy of the geometric reproduction. Secondly, by identifying the material parameters of corresponding components in the reference image and adjusting the baseline geometric model accordingly, an initial frame model is obtained. This allows the model to present an appearance similar to the real object, reducing the appearance difference between the model and the actual object. Next, the initial frame model is rendered according to preset environmental parameters to obtain a rendered image, and the similarity matrix between the rendered image and the reference image is calculated. This reflects the magnitude of the appearance difference between the model and the actual object, providing a direct reference for subsequent model adjustments. Finally, the initial frame model is corrected based on the similarity matrix to obtain the target frame model. This gradually eliminates appearance deviations in the model, improves the modeling precision of the final model, and allows the 3D frame model to reach a higher manufacturing standard.
[0045] In some optional implementations of this embodiment, the step of calculating the similarity matrix between the rendered image and the reference image includes: The rendered image is divided into multiple rendered image blocks, and the reference image is divided into multiple reference image blocks, with one rendered image block corresponding to one reference image block; Calculate the similarity data between each of the rendered image blocks and each of the reference image blocks; Obtain the arrangement sequence of all the reference image blocks, and sort all the similarity data according to the arrangement sequence of all the reference image blocks to obtain the similarity matrix.
[0046] In this embodiment, the complete rendered image is uniformly cropped and divided according to preset specification parameters to obtain several rendered image blocks of the same size that do not overlap or partially overlap. Similarly, a reference image is divided according to the same specification parameters to obtain reference image blocks. The spatial positions of the rendered image blocks and the reference image blocks are matched and correspond to each other. The preset specification parameters include a fixed size and a step size. The fixed size is a pre-calibrated uniform pixel specification for a single image block, ensuring that the length and width of all image blocks are completely consistent in pixels. It can be 32×32 pixels or 64×64 pixels. The step size is the cropping offset distance between two adjacent image blocks. If non-overlapping blocks are performed, the step size is equal to the size of the image block, that is, the step size is equal to the value of the fixed size. If overlapping blocks are performed, the step size can be set to a value smaller than the fixed size.
[0047] For each pair of corresponding rendered image blocks and reference image blocks, pixel data of each pair of matching image blocks is extracted. Based on the pixel data, the mean pixel grayscale, standard deviation pixel grayscale, and covariance of each pair of image blocks are calculated. The mean pixel grayscale represents the brightness deviation of the image block; the standard deviation pixel grayscale represents the local light and shadow fluctuations and differences in reflectivity; and the covariance pixel covariance represents the structural details of the image block. Furthermore, brightness similarity data is calculated based on the mean pixel grayscale of each pair of image blocks; contrast similarity data is calculated based on the standard deviation pixel grayscale of each pair of image blocks; and structural similarity data is calculated based on the covariance pixel covariance of each pair of image blocks. The similarity data of each pair of image blocks is obtained by multiplying the brightness similarity, contrast similarity, and structural similarity data. Collect all reference image blocks in the spatial arrangement sequence formed by row and column distribution in the whole image. Using this arrangement sequence as the regular order, arrange all discrete similarity data in order and combine them in a regular row and column to form a similarity matrix S with the spatial location of the image. Each element S(i,j) in the matrix corresponds to the similarity value of the image block at position (i,j) (0≤S(i,j)≤1).
[0048] This application completes the equal segmentation of images using a unified specification, comprehensively calculates the similarity of image blocks from the perspectives of brightness, contrast, and structure, integrates various data into a matrix according to the image arrangement sequence, and orderly organizes the difference information between images, providing orderly basic data for subsequent image difference determination and material adjustment.
[0049] In some optional implementations of this embodiment, the step of modifying the initial frame model based on the similarity matrix to obtain the target frame model includes: Determine whether each of the aforementioned similarity data falls within a preset similarity range; If all the similarity data are within the similarity interval, then the initial frame model is determined as the target frame model; If there is similarity data that is not in the similarity range, then identify the difference image block between the rendered image and the reference image, and correct the material parameters of the component corresponding to the difference image block to obtain the locally corrected material parameters; The material parameter set is updated according to the locally modified material parameters to obtain the target material parameter set. The target material parameter set is used as the material parameter set, and the process of adjusting the reference geometric model according to the material parameter set is returned to obtain the initial frame model.
[0050] In this embodiment, the similarity interval is a pre-defined numerical range used to determine whether the appearance matching degree between the rendered image and the reference image meets the standard. The value of the similarity interval can be [0.85, 1]. The lower limit of the interval is set to 0.85, which is mainly determined based on the actual usage requirements of the eyeglass frame model and the reasonable error range of image comparison. Eyeglass frame models are mostly used for product display, rendering, and virtual try-on scenarios, requiring the model's appearance to maintain a high degree of consistency with the real object. When the similarity value reaches 0.85 or above, the appearance difference between the model and the real object cannot be clearly perceived by the human eye, which can meet the visual requirements of various usage scenarios. The upper limit of the interval is set to 1, representing that the appearance of the model and the real object are completely consistent, which is the ideal state of model making. The target area is the area where there is a difference in visual appearance between the rendered image and the reference image, used to locate the specific position of the model that needs to be adjusted. The target material parameters are the optimized material parameters that, after adjustment, can make the appearance of the model more consistent with the real object.
[0051] Specifically, first, all similarity data in the similarity matrix is read, and each set of data is compared with a preset similarity interval. If all data falls within the interval, it means that the appearance of the current initial frame model matches the actual object, and this model is directly used as the target frame model. If there is data that does not fall within the interval, it means that there is a deviation between the local appearance of the model and the actual object. The image block corresponding to the similarity data that does not fall within the interval is located, and this image block is the difference image block. The similarity data corresponding to the difference image block in the similarity matrix is converted into gradient deviation values. The degree of deviation of the difference image block is judged according to the gradient deviation value. The material parameters of the corresponding parts of the difference image block are compensated and corrected according to the degree of deviation, so as to obtain the local corrected material parameters of the frame parts corresponding to the difference image block. In order to make the generated frame model closer to the actual frame, the material parameter set in step 202 is updated according to the local corrected material parameters to obtain the target material parameter set. The target material parameter set is then used as the material parameter set, and the process of mapping the reference geometric model according to the material parameter set in step 202 is returned to obtain the initial frame model. The model is then re-rendered and compared until the appearance of the model meets the requirements.
[0052] This application determines the degree of appearance matching between the model and the real object by using similarity intervals. When the match meets the standard, the final model can be directly determined, simplifying the modeling operation. When the match does not meet the standard, the difference areas are located and the corresponding material parameters are adjusted. The model appearance is then iteratively optimized to make the model's visual appearance consistent with the real object, meeting the appearance requirements of the eyeglass frame model in different usage scenarios.
[0053] In some optional implementations of this embodiment, the step of correcting the material parameters of the components corresponding to the difference image blocks to obtain locally corrected material parameters includes: Obtain the mapping relationship between the rendered image and the frame; based on the mapping relationship, locate the component corresponding to the difference image block; and read the material parameters of the component corresponding to the difference image block. Based on the similarity matrix, the gradient deviation value corresponding to the difference image patch is determined. Based on the gradient deviation value, the material parameters of the component corresponding to the difference image patch are corrected to obtain the local corrected material parameters.
[0054] In this embodiment, since the rendered image is obtained from the initial frame model, the mapping relationship between each rendered image block and the frame component can be determined in the rendered image. Based on this mapping relationship, the frame component corresponding to the difference image block can be determined. The material parameters of the component corresponding to the difference image block are read.
[0055] In the similarity matrix, find the similarity data corresponding to the differing image patch. Select the similarity data of the image patches surrounding the differing image patch. The surrounding image patches include the image patches that are adjacent to the differing image patch horizontally in the same row, and the image patches that are adjacent to the differing image patch vertically in the same column. Calculate the absolute value of the difference between the similarity data of the surrounding image patches and the similarity data of the differing image patch. The largest absolute value of the difference is taken as the gradient deviation value corresponding to the differing image patch. The gradient deviation value represents the degree of abrupt change in the rendering visual effect between the current differing image patch and the surrounding area. The larger the value, the more serious the deviation of the material parameters and the more abrupt the texture transition.
[0056] A multi-level threshold range for gradient deviation values is pre-set, and a corresponding material parameter correction step size is preset for each range to control the correction magnitude in stages. For example, when the gradient deviation value is less than 0.2, it is judged as a slight difference, and each material parameter is finely adjusted with a small step size of 0.02; when the gradient deviation value is greater than or equal to 0.2 and less than 0.6, it is judged as a moderate difference, and each material parameter is adjusted with a medium step size of 0.05; when the gradient deviation value is greater than or equal to 0.6, it is judged as a severe difference, and each material parameter is significantly corrected with a large step size of 0.1. Each material parameter type has a corresponding preset standard value. When the material parameter of the component corresponding to the difference image block is greater than the preset standard value, the correction step size is reduced; if it is less than or equal to the preset standard value, the correction step size is increased. After increasing or decreasing the correction step size of the material parameter of the component corresponding to the difference image block, the locally corrected material parameters are obtained. For example, the preset standard value for metallicity is 0.7, and the current metallicity is 0.65, which is less than 0.7, so the correction step size is increased based on 0.65.
[0057] This application locates relevant components by mapping rendered images to the frame, calculates gradient deviation values based on a similarity matrix, classifies different difference levels, and sets corresponding adjustment step sizes. Adjustments are made based on the comparison of material parameters with standard values to soften the abruptness of rendered textures between components, resulting in a more natural and harmonious overall visual appearance of the frame.
[0058] In some optional implementations of this embodiment, the step of constructing the reference geometric model of the eyeglass frame based on the initial point cloud data includes: Based on the initial point cloud data, an initial geometric model of the eyeglass frame is generated; Obtain the central symmetry plane of the initial geometric model, and based on the central symmetry plane, mirror the initial geometric model to obtain mirrored point cloud data; Based on the mirrored point cloud data and the initial point cloud data, generate the deformation deviation matrix of the eyeglass frame; The initial geometric model is corrected based on the deformation deviation matrix to obtain the reference geometric model.
[0059] In this embodiment, the central symmetry plane is a symmetry reference plane that fits the physical structure of the eyeglass frame itself, the mirror point cloud data is a set of symmetric point clouds formed by mirroring the initial geometric model along the central symmetry plane, and the deformation deviation matrix is used to record the morphological and positional differences between the initial point cloud and the mirror point cloud.
[0060] Specifically, the initial point cloud data is first preprocessed, including removing noise outliers, reducing point cloud density, and performing point cloud registration. Geometric features such as edge contours and surface normals are extracted from the point cloud. A surface mesh is reconstructed based on the discrete point cloud, and a fitting method is used to generate the initial geometric model. Next, the overall structural features of the frame are identified to determine the central symmetry plane. The initial geometric model is then mirrored along this plane to obtain matching mirrored point cloud data. Each initial point cloud and its corresponding mirrored point cloud are considered a pair. The actual offset between the initial and mirrored point cloud data in each pair is calculated. Based on the spatial distribution of the initial point cloud data, the actual offsets of each pair are integrated to obtain a deformation deviation matrix. The deformation offset data corresponding to each region in the deformation deviation matrix is read, and the mesh vertex coordinates and surface contour positions of the initial geometric model are corrected by reverse compensation according to the offset magnitude. Finally, the surface of the corrected initial geometric model is smoothed to ensure the continuity and regularity of the frame structure lines, resulting in a symmetrical baseline geometric model.
[0061] This application constructs an initial geometric model of the eyeglass frame using point cloud data, generates a mirror point cloud by setting a central symmetry plane, constructs a deformation deviation matrix by combining point offset information, adjusts the model mesh and surface shape based on the offset data, optimizes the smoothness of the model surface, improves the asymmetry problem of the eyeglass frame structure, and makes the overall lines of the model more coherent and regular.
[0062] In some optional implementations of this embodiment, the step of adjusting the reference geometric model according to the material parameters to obtain the initial frame model includes: Calculate the principal curvature data corresponding to each component in the reference geometric model, and generate the curvature distribution characteristics of the reference geometric model based on multiple principal curvature data. Based on the curvature distribution characteristics, the seam hiding area of the frame is selected from the reference geometric model, and the texture coordinates of the frame are obtained based on the seam hiding area. The reference geometric model is adjusted based on the material parameters and the texture coordinates to obtain the initial frame model.
[0063] In this embodiment, the frame includes multiple components such as the lens rim, temples, bridge, and hinges. Based on the material, these components can be classified as metal components, transparent components, or plastic components. The principal curvature data includes the maximum and minimum principal curvatures corresponding to the mesh vertices of each component. The hidden seam area includes visually invisible areas such as the inner groove of the lens rim and the bottom edge of the temple. The texture coordinates are the 2D texture mapping coordinates of the model surface without stretching.
[0064] Specifically, local quadric surfaces are fitted to each component in the baseline geometric model. The principal curvature data corresponding to each point on the local quadric surface is calculated, and the principal curvature data of all components are summarized to obtain the complete curvature distribution characteristics of the baseline geometric model. Then, UV seams are generated with the hidden seam area as the boundary, and the baseline geometric model is UV unwrapped based on the seams to obtain unstretched texture coordinates. The material parameters and texture coordinates are combined and mapped to the baseline geometric model to obtain the initial frame model. Based on the preset concave curvature threshold, curvature change threshold, and the criteria for determining the frontal visible area, the frontal visible range is first defined according to the standard display angle of the frame, eliminating visible areas such as the outer surface of the lens rim, the front of the temples, and the front of the bridge of the nose. Then, the curvature distribution characteristics of all grid vertices in the baseline geometric model are traversed, and the minimum principal curvature of each vertex is compared. Areas with values lower than the concave curvature threshold are classified as candidate areas for surface concaveness. At the same time, the curvature difference between adjacent grid vertices is calculated, and surface transition areas with differences exceeding the curvature change threshold are included in the candidates. The portion of the candidate area that belongs to the frontal visible area is eliminated, and the remaining contiguous areas, the inner groove of the lens rim that is in the visual blind spot, the bottom edge of the temples, and other areas are grouped into the seam hiding area. The concavity curvature threshold is the minimum principal curvature threshold used to filter concave areas on curved surfaces. It can be set to -0.08 to -0.05. Since hidden concave areas such as the inner groove of the lens frame and the bottom edge of the temple are concave inward, the minimum principal curvature is negative. A value of -0.06 can be set within the range of -0.08 to -0.05. This value can filter out small undulations in the mesh and modeling noise, only screening out real structural concavities and not misjudging smooth outer surfaces as hidden concavity areas. The curvature abrupt change threshold is the critical value used to filter the curvature difference between adjacent vertices at curved surface transitions. It can be set to 0.1 to 0.15. In smooth and continuous curved areas of the frame, the principal curvature changes very little between adjacent mesh vertices, and the difference is generally less than 0.1. At the junction of parts, the edge of the groove, and the transition lines of the inner and outer sides, the curvature will change abruptly, and the difference will become significantly larger. A value of 0.12 can be set within the range of 0.1 to 0.15. This value can accurately distinguish between smooth areas and structural transition areas. The criteria for determining the frontal visible area are the frontal visible range defined by the standard display angle of the frame, including the outer surface of the lens rim, the front of the temples, and the front of the bridge of the nose.
[0065] Finally, using the selected hidden seam areas as the dividing boundaries, the meshes of the frame, temples, bridge, and hinge components of the baseline geometric model are segmented along the outline of the hidden areas. Each model panel is then unfolded, and corresponding U and V values are assigned to each mesh vertex of the unfolded panel to obtain the unstretched, uncompressed two-dimensional texture coordinates of the model surface. When adjusting the baseline geometric model based on the texture coordinates and material parameters, the corresponding material parameters are matched according to the metal, plastic, and transparent material classifications of each frame component. Material information such as color, roughness, metallicity, and surface texture are combined with texture coordinates and mapped region by region onto the surface of the baseline geometric model, ensuring smooth texture transitions and no seams at the panel joints, ultimately yielding the initial frame model.
[0066] This application filters the hidden seam area by curvature distribution characteristics and places the UV seam in a visually invisible part. After unfolding, it can obtain texture coordinates without stretching. The baseline geometric model is adjusted according to the texture coordinates and material parameters to avoid obvious seams on the front and improve the texture continuity and visual integrity of the initial frame model.
[0067] In some optional implementations of this embodiment, the eyeglass frame includes a metal component and a transparent component, and the step of obtaining the initial point cloud data of the eyeglass frame includes: The metal component is scanned according to preset exposure parameters to obtain the first point cloud data; Multiple sampling points of the transparent component are obtained, the normal vector and reflection intensity of each sampling point are extracted, interference points in the sampling points are identified based on the normal vector and the reflection intensity, and the interference points are filtered out from the sampling points to obtain the second point cloud data; The initial point cloud data is generated based on the first point cloud data and the second point cloud data.
[0068] In this embodiment, the metal components can be structures such as hinges and lens rims made of metal in the frame, while the transparent components can be light-transmitting structures such as temples and nose pads made of transparent material. Besides metal and transparent components, there are also components made of other materials such as plastic. Specifically, firstly, considering the high reflectivity of the metal components, preset exposure parameters of low exposure and short exposure time are set. Low exposure captures the geometry of highlight areas, while high exposure captures details in shadow areas. Using a 3D scanner, the metal components are scanned region by region according to the preset exposure parameters, collecting the spatial coordinates and normal vector information of each vertex to obtain first point cloud data with no overexposure and uniform point cloud density. The transparent components are then uniformly sampled to obtain multiple sampling points distributed on the surface of the transparent components. The normal vector and reflection intensity values of each sampling point are calculated. Sampling points whose reflection intensity exceeds a preset reflectivity threshold or whose normal vector deviates from the curvature trend of the transparent components are identified as interference points and discarded, retaining valid sampling points to form second point cloud data. The preset reflection threshold ranges from 0.2 to 0.4, used to determine whether the sampling point exhibits signal abnormalities due to refraction or reflection. The deviation trend of the normal vector is determined by the angle between the sampling point's normal vector and the average normal vector of its neighborhood; the preset angle threshold is 15° to 30°. If the angle exceeds this threshold, it is considered that the normal vector deviates from the curved surface of the transparent component. Then, the plastic material and other components of the frame are scanned to collect the third point cloud data. Finally, the first, second, and third point cloud data are registered and stitched together according to the actual spatial relationship of the frame to obtain the initial point cloud data.
[0069] This application obtains complete point clouds of metal parts through multiple exposures, filters out invalid interference points of transparent parts, and then stitches together the point cloud data of each part. This avoids scanning defects caused by high reflectivity and transparent materials. It also adopts appropriate scanning processing methods for different materials of the frame to improve the integrity and accuracy of the initial point cloud data.
[0070] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0071] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0072] 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).
[0073] 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.
[0074] Further reference Figure 3 As a response to the above Figure 2 To implement the method shown, this application provides an embodiment of a frame modeling device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0075] like Figure 3 As shown, the eyeglass frame modeling device 300 described in this embodiment includes: a construction module 301, an adjustment module 302, a rendering module 303, and a correction module 304. Wherein: The construction module 301 is used to acquire the initial point cloud data and reference image of the eyeglass frame, and construct the reference geometric model of the eyeglass frame based on the initial point cloud data. The adjustment module 302 is used to identify the material parameters of each component of the eyeglass frame based on the reference image, obtain a set of material parameters, and adjust the reference geometric model according to the set of material parameters to obtain an initial eyeglass frame model; The rendering module 303 is used to render the initial frame model according to preset environmental parameters to obtain a rendered image of the frame, and to calculate the similarity matrix between the rendered image and the reference image. The correction module 304 is used to correct the initial frame model according to the similarity matrix to obtain the target frame model.
[0076] The eyeglass frame modeling device provided in this application acquires initial point cloud data and reference images of the eyeglass frame, and constructs a baseline geometric model of the frame based on the initial point cloud data. This allows for the complete reproduction of the overall shape and various fine structures of the frame, improving the accuracy of the geometric reproduction. Secondly, by identifying the material parameters of corresponding components in the reference image and adjusting the baseline geometric model according to these parameters, an initial eyeglass frame model is obtained. This allows the model to present an appearance similar to the real object, reducing the appearance gap between the model and the actual object. Next, the initial eyeglass frame model is rendered according to preset environmental parameters to obtain a rendered image, and the similarity matrix between the rendered image and the reference image is calculated. This clearly shows the magnitude of the difference in appearance between the model and the actual object, providing a direct reference for subsequent model adjustments. Finally, the initial eyeglass frame model is corrected based on the similarity matrix to obtain the target eyeglass frame model. This gradually eliminates any appearance deviations in the model, improves the modeling precision of the final model, and allows the 3D eyeglass frame model to reach a higher manufacturing standard.
[0077] In some optional implementations of this embodiment, the rendering module 303 is further configured to: The rendered image is divided into multiple rendered image blocks, and the reference image is divided into multiple reference image blocks, with one rendered image block corresponding to one reference image block; Calculate the similarity data between each of the rendered image blocks and each of the reference image blocks; Obtain the arrangement sequence of all the reference image blocks, and sort all the similarity data according to the arrangement sequence of all the reference image blocks to obtain the similarity matrix.
[0078] The eyeglass frame modeling device provided in this application completes the equal division of images using uniform specifications, comprehensively calculates the similarity of image blocks from the perspectives of brightness contrast and structure, integrates various data into a matrix according to the image arrangement sequence, and orderly organizes the difference information between images, providing orderly basic data for subsequent image difference determination and material adjustment.
[0079] In some optional implementations of this embodiment, the correction module 304 is further configured to: Determine whether each of the aforementioned similarity data falls within a preset similarity range; If all the similarity data are within the similarity interval, then the initial frame model is determined as the target frame model; If there is similarity data that is not in the similarity range, then identify the difference image block between the rendered image and the reference image, and correct the material parameters of the component corresponding to the difference image block to obtain the locally corrected material parameters; The material parameter set is updated according to the locally corrected material parameters to obtain the target material parameter set. The target material parameter set is used as the material parameter set, and the process of adjusting the reference geometric model according to the material parameter set is returned to obtain the initial frame model.
[0080] The eyeglass frame modeling device provided in this application determines the degree of appearance matching between the model and the real object through similarity intervals. When the matching meets the standard, the final model can be directly determined, simplifying the modeling operation. When the matching does not meet the standard, the difference areas are located and the corresponding material parameters are adjusted. The model appearance is optimized in a loop to make the visual appearance of the model more consistent with the real object, thus meeting the appearance requirements of the eyeglass frame model in different usage scenarios.
[0081] In some optional implementations of this embodiment, the correction module 304 is further configured to: Obtain the mapping relationship between the rendered image and the frame; based on the mapping relationship, locate the component corresponding to the difference image block; and read the material parameters of the component corresponding to the difference image block. Based on the similarity matrix, the gradient deviation value corresponding to the difference image patch is determined. Based on the gradient deviation value, the material parameters of the component corresponding to the difference image patch are corrected to obtain the local corrected material parameters.
[0082] The eyeglass frame modeling device provided in this application locates relevant components by matching rendered images with the eyeglass frame, calculates gradient deviation values based on a similarity matrix, classifies different difference levels, and sets corresponding adjustment step sizes. Adjustments are made based on the comparison of material parameters with standard values to soften the abruptness of rendered textures between components, resulting in a more natural and harmonious overall visual appearance of the eyeglass frame.
[0083] In some optional implementations of this embodiment, the construction module 301 is further configured to: Based on the initial point cloud data, an initial geometric model of the eyeglass frame is generated; Obtain the central symmetry plane of the initial geometric model, and based on the central symmetry plane, mirror the initial geometric model to obtain mirrored point cloud data; Based on the mirrored point cloud data and the initial point cloud data, generate the deformation deviation matrix of the eyeglass frame; The initial geometric model is corrected based on the deformation deviation matrix to obtain the reference geometric model.
[0084] The eyeglass frame modeling device provided in this application constructs an initial geometric model of the eyeglass frame using point cloud data, generates a mirror point cloud by setting a central symmetry plane, constructs a deformation deviation matrix by combining point offset information, adjusts the model mesh and surface shape according to the offset data, optimizes the smoothness of the model surface, improves the asymmetry problem of the eyeglass frame structure, and makes the overall lines of the model more coherent and regular.
[0085] In some optional implementations of this embodiment, the adjustment module 302 is further configured to: Calculate the principal curvature data corresponding to each component in the reference geometric model, and generate the curvature distribution characteristics of the reference geometric model based on multiple principal curvature data. Based on the curvature distribution characteristics, the seam hiding area of the frame is selected from the reference geometric model, and the texture coordinates of the frame are obtained based on the seam hiding area. The baseline geometric model is adjusted based on the set of material parameters and the texture coordinates to obtain the initial frame model.
[0086] The eyeglass frame modeling device provided in this application filters the hidden seam area through curvature distribution characteristics, places the UV seam in a visually invisible part, and obtains texture coordinates without stretching after unfolding. The reference geometric model is adjusted according to the texture coordinates and material parameters to avoid obvious seams on the front, thereby improving the texture continuity and visual integrity of the initial eyeglass frame model.
[0087] In some optional implementations of this embodiment, the construction module 301 is further configured to: The metal component is scanned according to preset exposure parameters to obtain the first point cloud data; Multiple sampling points of the transparent component are obtained, the normal vector and reflection intensity of each sampling point are extracted, interference points in the sampling points are identified based on the normal vector and the reflection intensity, and the interference points are filtered out from the sampling points to obtain the second point cloud data; The initial point cloud data is generated based on the first point cloud data and the second point cloud data.
[0088] The eyeglass frame modeling device provided in this application acquires complete point clouds of metal parts through multiple exposures, filters out invalid interference points of transparent parts, and then stitches together the point cloud data of each part. This can avoid scanning defects caused by high reflectivity and transparent materials, and adopts appropriate scanning processing methods for different eyeglass frame materials to improve the integrity and accuracy of the initial point cloud data.
[0089] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0090] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components 41, 42, and 43 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.
[0091] 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.
[0092] The memory 41 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 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may also include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for a frame modeling method. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
[0093] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or to process data, for example, to execute computer-readable instructions for the eyeglass frame modeling method.
[0094] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.
[0095] The computer equipment provided in this application acquires initial point cloud data and reference images of the eyeglass frame, and constructs a baseline geometric model of the frame based on the initial point cloud data. This allows for the complete reproduction of the overall shape and various fine structures of the frame, improving the accuracy of the geometric reproduction. Secondly, by identifying the material parameters of corresponding components in the reference image and adjusting the baseline geometric model accordingly, an initial frame model is obtained. This allows the model to present an appearance similar to the real object, reducing the appearance gap between the model and the actual object. Next, the initial frame model is rendered according to preset environmental parameters to obtain a rendered image, and the similarity matrix between the rendered image and the reference image is calculated. This clearly shows the magnitude of the appearance difference between the model and the actual object, providing a direct reference for subsequent model adjustments. Finally, the initial frame model is corrected based on the similarity matrix to obtain the target frame model. This gradually eliminates appearance deviations in the model, improves the modeling precision of the final model, and allows the 3D frame model to reach a higher manufacturing standard.
[0096] This application also provides another embodiment, namely, 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 frame modeling method described above.
[0097] The computer-readable storage medium provided in this application acquires initial point cloud data and reference images of the eyeglass frame, and constructs a baseline geometric model of the frame based on the initial point cloud data. This allows for the complete reproduction of the overall shape and various fine structures of the frame, improving the accuracy of the frame's geometric form. Secondly, identifying the material parameters of corresponding components in the reference image and adjusting the baseline geometric model based on these parameters yields an initial frame model. This allows the model to present an appearance similar to the real object, reducing the appearance gap between the model and the actual object. Next, the initial frame model is rendered according to preset environmental parameters to obtain a rendered image, and the similarity matrix between the rendered image and the reference image is calculated. This clearly shows the magnitude of the appearance difference between the model and the actual object, providing a direct reference for subsequent model adjustments. Finally, the initial frame model is corrected based on the similarity matrix to obtain the target frame model. This gradually eliminates appearance deviations in the model, improves the modeling precision of the final model, and allows the 3D frame model to reach a higher manufacturing standard.
[0098] 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.
[0099] 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 modeling eyeglass frames, characterized in that, Includes the following steps: Acquire the initial point cloud data and reference image of the eyeglass frame, and construct the reference geometric model of the eyeglass frame based on the initial point cloud data; The material parameters of each component of the eyeglass frame are identified based on the reference image to obtain a set of material parameters. The reference geometric model is then adjusted based on the set of material parameters to obtain an initial eyeglass frame model. Based on preset environmental parameters, the initial frame model is rendered to obtain a rendered image of the frame, and the similarity matrix between the rendered image and the reference image is calculated. The initial frame model is corrected based on the similarity matrix to obtain the target frame model.
2. The method for modeling eyeglass frames according to claim 1, characterized in that, The calculation of the similarity matrix between the rendered image and the reference image includes: The rendered image is divided into multiple rendered image blocks, and the reference image is divided into multiple reference image blocks, with one rendered image block corresponding to one reference image block; Calculate the similarity data between each of the rendered image blocks and each of the reference image blocks; Obtain the arrangement sequence of all the reference image blocks, and sort all the similarity data according to the arrangement sequence of all the reference image blocks to obtain the similarity matrix.
3. The method for modeling eyeglass frames according to claim 2, characterized in that, The step of correcting the initial frame model based on the similarity matrix to obtain the target frame model includes: Determine whether each of the aforementioned similarity data falls within a preset similarity range; If all the similarity data are within the similarity interval, then the initial frame model is determined as the target frame model; If there is similarity data that is not in the similarity range, then identify the difference image block between the rendered image and the reference image, and correct the material parameters of the component corresponding to the difference image block to obtain the locally corrected material parameters; The material parameter set is updated according to the locally modified material parameters to obtain the target material parameter set. The target material parameter set is used as the material parameter set, and the process of adjusting the reference geometric model according to the material parameter set is returned to obtain the initial frame model.
4. The method for modeling eyeglass frames according to claim 3, characterized in that, The step of correcting the material parameters of the components corresponding to the difference image blocks to obtain locally corrected material parameters includes: Obtain the mapping relationship between the rendered image and the frame; based on the mapping relationship, locate the component corresponding to the difference image block; and read the material parameters of the component corresponding to the difference image block. Based on the similarity matrix, determine the gradient deviation value corresponding to the differing image patch; Based on the gradient deviation value, the material parameters of the corresponding components of the difference image block are corrected to obtain the local corrected material parameters.
5. The method for modeling eyeglass frames according to claim 1, characterized in that, The step of constructing the reference geometric model of the eyeglass frame based on the initial point cloud data includes: Based on the initial point cloud data, an initial geometric model of the eyeglass frame is generated; Obtain the central symmetry plane of the initial geometric model, and based on the central symmetry plane, mirror the initial geometric model to obtain mirrored point cloud data; Based on the mirrored point cloud data and the initial point cloud data, generate the deformation deviation matrix of the eyeglass frame; The initial geometric model is corrected based on the deformation deviation matrix to obtain the reference geometric model.
6. The method for modeling eyeglass frames according to claim 1, characterized in that, The step of adjusting the baseline geometric model according to the set of material parameters to obtain the initial frame model includes: Calculate the principal curvature data corresponding to each component in the reference geometric model, and generate the curvature distribution characteristics of the reference geometric model based on multiple principal curvature data. Based on the curvature distribution characteristics, the seam hiding area of the frame is selected from the reference geometric model, and the texture coordinates of the frame are obtained based on the seam hiding area. The baseline geometric model is adjusted based on the set of material parameters and the texture coordinates to obtain the initial frame model.
7. The method for modeling eyeglass frames according to any one of claims 1 to 6, characterized in that, The eyeglass frame includes metal components and transparent components. Acquiring the initial point cloud data of the eyeglass frame includes: The metal component is scanned according to preset exposure parameters to obtain the first point cloud data; Multiple sampling points of the transparent component are obtained, the normal vector and reflection intensity of each sampling point are extracted, interference points in the sampling points are identified based on the normal vector and the reflection intensity, and the interference points are filtered out from the sampling points to obtain the second point cloud data; The initial point cloud data is generated based on the first point cloud data and the second point cloud data.
8. A frame modeling device, characterized in that, include: A construction module is used to acquire initial point cloud data and reference images of the eyeglass frame, and to construct a reference geometric model of the eyeglass frame based on the initial point cloud data. The adjustment module is used to identify the material parameters of each component of the eyeglass frame based on the reference image, obtain a set of material parameters, and adjust the reference geometric model according to the set of material parameters to obtain an initial eyeglass frame model; The rendering module is used to render the initial frame model according to preset environmental parameters to obtain a rendered image of the frame, and to calculate the similarity matrix between the rendered image and the reference image. The correction module is used to correct the initial frame model based on the similarity matrix to obtain the target frame model.
9. A computer device, characterized in that, It 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 frame modeling method 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 frame modeling method as described in any one of claims 1 to 7.