High-precision continuous contour acquisition method and device
The lens profile of glasses is obtained through cameras and artificial intelligence technology and spline fitting is solved, which solves the problem of accurate and low efficiency of measurement data of glasses lens profile data in the prior art, and achieves a higher accuracy and convenient measurement process.
Patent Information
- Application Number
- CN202410417465.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2024-12-20
AI Technical Summary
The measurement method of the existing glasses lens profile data is poor in accuracy and efficiency, and cannot provide a good user experience.
Using a high-precision continuous contour acquisition method, a camera is used to obtain two-dimensional images, combined with artificial intelligence technology to obtain continuous curve contours, calculate the loss function through the image mask, perform spline fitting, obtain accurate contour data, and use preset data Format output.
It improves the measurement accuracy and efficiency of glasses lens profile data, provides a better foundation for glasses customization and formulation, and promotes the target objects of various continuous curves.
Smart Images

Figure CN119164316A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a high-precision continuous contour acquisition method and device. Background Art
[0002] Digital informationization of eyeglass measurement usually refers to the use of modern scientific and technological equipment and software to improve the accuracy and efficiency of eyeglass measurement. Traditional eyeglass measurement is usually performed manually by ophthalmologists or optometrists, while digital informationized eyeglass measurement can be achieved through automated equipment and digital software.
[0003] Among them, modern automatic ophthalmometers can accurately measure various parameters of the eye, such as visual acuity, astigmatism, pupil distance, etc., through various sensors and cameras, avoiding the influence of human factors on the measurement results and improving accuracy and reliability. These measurement data can also be digitally stored and managed, which is convenient for glasses preparation and file management.
[0004] The advantage of digital informationization of glasses measurement is that it improves the accuracy, efficiency and convenience of measurement, and provides a better basis for glasses customization and preparation.
[0005] The existing technology has a low degree of digital informationization in eyeglass measurement. For example, in the traditional method of measuring the contour data of eyeglass lenses, a technician fixes a ruler at the center of the lens, and then obtains the length of the boundary points in sequence at a fixed angle around the lens contour, and uses such data as the contour data of the lens for storage and production. This measurement method has poor accuracy and efficiency, and cannot bring a good user experience. Summary of the invention
[0006] The technical problem to be solved by the present invention is to overcome the defects of the prior art in which the measurement method of eyeglass lens contour data is poor in accuracy and efficiency and cannot provide users with a good user experience, and to provide a high-precision continuous contour acquisition method and device that uses digital information to more conveniently collect and improve the accuracy, efficiency and convenience of measurement.
[0007] The present invention solves the above technical problems through the following technical solutions:
[0008] A high-precision continuous contour acquisition method, characterized in that the high-precision continuous contour acquisition method comprises:
[0009] Using a camera to acquire a two-dimensional image, wherein the two-dimensional image includes a contour of a continuous curve;
[0010] Using artificial intelligence technology to obtain the contour of the continuous curve;
[0011] Making an image mask according to the contour of the continuous curve, calculating a loss function and obtaining the edge contour of the continuous curve;
[0012] Perform spline curve fitting on the edge contour to obtain contour data;
[0013] Using the parameters of the camera to obtain actual data of the continuous curve corresponding to the contour data;
[0014] The actual data of the continuous curve is output in a preset data format.
[0015] Preferably, the continuous curve is a spectacle frame, and the high-precision continuous contour acquisition method includes:
[0016] Using the camera to obtain a two-dimensional image of the glasses user;
[0017] Use artificial intelligence technology to obtain the inner contour of the eyeglass frame in the two-dimensional image;
[0018] Make an image mask based on the inner contour, calculate the loss function and obtain the edge contour of the lens;
[0019] Perform spline curve fitting on the edge contour to obtain contour data;
[0020] Use a high-order spline curve to fit the edge contour to obtain contour data;
[0021] Using the parameters of the camera to obtain actual glasses data of the inner contour of the glasses frame corresponding to the contour data;
[0022] The actual data of the glasses is output in a preset data format.
[0023] Preferably, the method of obtaining a two-dimensional image of the eyeglass user by using a camera comprises:
[0024] Obtain a set of one or two-dimensional images;
[0025] Marking the contour points of the inner side of the eyeglass frame on the two-dimensional image in each two-dimensional image set;
[0026] The segmentation network of the artificial intelligence technology is trained using the two-dimensional image set and the lens edge contour generated by the contour points.
[0027] Preferably, marking the contour points of the inner side of the glasses frame on the two-dimensional image in each two-dimensional image set comprises:
[0028] For each two-dimensional image in the two-dimensional image set, marking at least two contour points on the inner side of the eyeglass frame on the two-dimensional image, wherein the curvature of the contour points is greater than a preset value;
[0029] For two adjacent contour points in a two-dimensional image, a marking point is added on a candidate line segment, and the curvature of the added marking point is the maximum value on the candidate line segment, and the candidate line segment is a line segment on the inner contour of the eyeglass frame between the two adjacent contour points.
[0030] Preferably, marking the contour points of the inner side of the glasses frame on the two-dimensional image in each two-dimensional image set comprises:
[0031] For each two-dimensional image in the two-dimensional image set, marking at least two contour points on the inner side of the eyeglass frame on the two-dimensional image, wherein the curvature of the contour points is greater than a preset value;
[0032] For two adjacent contour points in a two-dimensional image, a marking point is added to the candidate line segment, and the line connecting the added marking point to the two adjacent contour points is the maximum value on the candidate line segment, and the candidate line segment is the line segment on the inner contour of the eyeglass frame between the two adjacent contour points.
[0033] Preferably, marking the contour points of the inner side of the glasses frame on the two-dimensional image in each two-dimensional image set comprises:
[0034] Determine whether the distance between two target contour points on the inner contour of the glasses frame in the two-dimensional image is less than a preset distance. If not, add a marking point between the two target contour points and then execute again the step of determining whether the distance between two target contour points on the inner contour of the glasses frame in the two-dimensional image is less than a preset distance.
[0035] Preferably, the strategy for marking the contour points includes:
[0036] The accuracy of contour points takes precedence over the density of contour points; and / or,
[0037] The connecting line of the contour points intersects with the image of the obstruction on the inner contour of the glasses frame.
[0038] Preferably, the high-precision continuous contour acquisition method comprises:
[0039] Use artificial intelligence technology to obtain the inner contour of the eyeglass frame in the two-dimensional image;
[0040] After skipping the image enhancement step, the image mask is made according to the inner contour, the loss function is calculated and the lens edge contour is obtained.
[0041] Preferably, the camera includes a 3D camera and a 2D camera, the 2D camera is used to obtain a two-dimensional image of the user of the glasses, and the 3D camera is used to obtain a three-dimensional image when obtaining the two-dimensional image, and the actual data of the glasses corresponding to the contour data obtained by using the parameters of the camera includes:
[0042] Identify pupil distance in 2D images;
[0043] Obtaining the center position of the lens using the pupil distance;
[0044] Acquire the spatial coordinates of the center position in the three-dimensional image;
[0045] Using the spatial coordinates to obtain the normal direction of the center position;
[0046] The actual data of the glasses corresponding to the contour data are adjusted using the found direction.
[0047] The present invention provides a high-precision continuous contour acquisition device, which is characterized in that the high-precision continuous contour acquisition device comprises a camera and a processing module, and the high-precision continuous contour acquisition device is used to implement the high-precision continuous contour acquisition method as described above.
[0048] The positive and progressive effects of the present invention are:
[0049] The present invention can use digital information to more conveniently collect and obtain more accurate eyeglass contour data, thereby improving the accuracy, efficiency and convenience of measurement and providing a better basis for eyeglass customization and preparation. Here, the lens contour is taken as an example, which can be extended to target objects of various continuous curves. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flow chart of the high-precision continuous contour acquisition method of Example 1 of the present invention. DETAILED DESCRIPTION
[0051] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0052] Example 1
[0053] See also Figure 1 This embodiment provides a high-precision continuous contour acquisition device, which can be a high-precision 3D modeling device or a device combination consisting of an image acquisition device and a processing terminal.
[0054] In this embodiment, the high-precision continuous contour acquisition device is a high-precision 3D modeling device, including a camera and a processing module.
[0055] The processing module may be a processing chip, or a mobile phone, desktop computer, tablet computer, notebook computer, etc. with computing capabilities, or a server with computing capabilities.
[0056] The server may include an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0057] The camera is used to acquire a two-dimensional image, and the two-dimensional image includes the outline of a continuous curve.
[0058] The continuous curve in this embodiment includes curvature, and the curvature measures the rate of change of the angle between the tangent vectors of two adjacent points on the curve with respect to the arc length.
[0059] The processing module is used to obtain the contour of the continuous curve using artificial intelligence technology;
[0060] The processing module is used to make an image mask according to the contour of the continuous curve, calculate the loss function and obtain the edge contour of the continuous curve;
[0061] The processing module is used to perform spline curve fitting on the edge contour to obtain contour data;
[0062] The processing module is used to obtain actual data of the continuous curve corresponding to the contour data using the parameters of the camera;
[0063] The processing module is used to output the actual data of the continuous curve in a preset data format.
[0064] Specifically, in this embodiment, the continuous curve is a glasses frame.
[0065] The camera is used to obtain a two-dimensional image of the eyeglass user;
[0066] The processing module is used to obtain the inner contour of the glasses frame in the two-dimensional image using artificial intelligence technology;
[0067] The processing module is used to make an image mask according to the inner contour, calculate the loss function and obtain the edge contour of the lens;
[0068] The processing module is used to perform spline curve fitting on the edge contour to obtain contour data;
[0069] The processing module is used to use a high-order spline curve to perform spline curve fitting on the edge contour to obtain contour data;
[0070] The processing module is used to obtain actual data of the glasses of the inner contour of the glasses frame corresponding to the contour data by using the parameters of the camera;
[0071] The processing module is used to output the actual data of the glasses in a preset data format.
[0072] Specifically, the processing module is used to obtain a one- or two-dimensional image set;
[0073] The processing module is used to mark the contour points of the inner side of the glasses frame on the two-dimensional image in each two-dimensional image set;
[0074] The processing module is used to train the segmentation network of the artificial intelligence technology using the two-dimensional image set and the lens edge contour generated by the contour points.
[0075] Select 2, 4 or n points with the largest curvature on the edge of the glasses to connect as initial contour points (if there are none, uniform sampling is sufficient).
[0076] Then in the edit mode, add points where the curvature is the largest in the candidate segments of the glasses edge between the points (note: the marking should leave the areas blocked by obstacles), and adjust the contour points (a simple criterion is the point farthest from the secant line, that is, the point closest to the secant line and the edge with the two end points)
[0077] Strategies for marking the contour points include:
[0078] The newly added edge segments are added to the candidates, and the steps of adding contour points are iteratively repeated until each secant line is "close enough" to the corresponding edge of the glasses (can be denser).
[0079] The priority of degree is greater than density, and the density can be selected appropriately if the shape is simple.
[0080] In this embodiment:
[0081] For training network: The training segmentation network uses specially optimized detection and segmentation networks, which reduces the pixel loss caused by network convolution and makes the edge accuracy higher.
[0082] For recognition, segmentation and traditional image processing algorithms: the results obtained by AI are masked, the edge contours are obtained using traditional algorithms, and certain filtering and interpolation processing is performed.
[0083] For spline curve fitting: Using high-order spline curves for fitting can obtain more refined edge contours. In addition to improving the robustness of the network results (avoiding edge burrs), it can also be treated as raw data because it is a curve that can be interpolated infinitely, improving the performance.
[0084] For using a robust graphics algorithm: after obtaining the original edge contour data, calculate any edge contour format, and calculate the intersection using graphic logic operations, which can optimize and avoid the problems of mathematical methods or edge slicing methods. Finally, get the edge contour file in any file format for other use.
[0085] Specifically, the embodiment provides a method of adding contour points:
[0086] For each two-dimensional image in the two-dimensional image set, the processing module is used to mark at least two contour points on the inner side of the eyeglass frame on the two-dimensional image, and the curvature of the contour points is greater than a preset value;
[0087] For two adjacent contour points in a two-dimensional image, the processing module is used to add a marking point on a candidate line segment, and the curvature of the added marking point is the maximum value on the candidate line segment, and the candidate line segment is a line segment on the inner contour of the eyeglass frame between the two adjacent contour points.
[0088] Specifically, the embodiment also provides a method for adding contour points:
[0089] For each two-dimensional image in the two-dimensional image set, the processing module is used to mark at least two contour points on the inner side of the eyeglass frame on the two-dimensional image, and the curvature of the contour points is greater than a preset value;
[0090] For two adjacent contour points in a two-dimensional image, the processing module is used to add a marking point on a candidate line segment, and the line connecting the added marking point to the two adjacent contour points is the maximum value on the candidate line segment, and the candidate line segment is a line segment on the inner contour of the eyeglass frame between the two adjacent contour points.
[0091] Specifically, the processing module is used to determine whether the distance between two target contour points on the inner contour of the glasses frame in the two-dimensional image is less than a preset distance. If not, a marking point is added between the two target contour points and the step of determining whether the distance between the two target contour points on the inner contour of the glasses frame in the two-dimensional image is less than a preset distance is executed again.
[0092] The processing module is also used for:
[0093] Use artificial intelligence technology to obtain the inner contour of the eyeglass frame in the two-dimensional image;
[0094] After skipping the image enhancement step, the image mask is made according to the inner contour, the loss function is calculated and the lens edge contour is obtained.
[0095] Furthermore, the camera includes a 3D camera and a 2D camera, the 2D camera is used to obtain a two-dimensional image of the glasses user, and the 3D camera is used to obtain a three-dimensional image when obtaining the two-dimensional image, and the processing module is used to:
[0096] Identify pupil distance in 2D images;
[0097] Obtaining the center position of the lens using the pupil distance;
[0098] Acquire the spatial coordinates of the center position in the three-dimensional image;
[0099] Using the spatial coordinates to obtain the normal direction of the center position;
[0100] The actual data of the glasses corresponding to the contour data are adjusted using the found direction.
[0101] Using the above-mentioned high-precision continuous contour acquisition device, this embodiment also provides a high-precision continuous contour acquisition method, including:
[0102] Using a camera to acquire a two-dimensional image, wherein the two-dimensional image includes a contour of a continuous curve;
[0103] Using artificial intelligence technology to obtain the contour of the continuous curve;
[0104] Making an image mask according to the contour of the continuous curve, calculating a loss function and obtaining the edge contour of the continuous curve;
[0105] Perform spline curve fitting on the edge contour to obtain contour data;
[0106] Using the parameters of the camera to obtain actual data of the continuous curve corresponding to the contour data;
[0107] The actual data of the continuous curve is output in a preset data format.
[0108] Specifically, see Figure 1 , the high-precision continuous contour acquisition method comprises: Step 100: Obtain a one- or two-dimensional image set.
[0110] Step 101: Mark the contour points of the inner side of the glasses frame on the two-dimensional image in each two-dimensional image set.
[0111] Step 102: training a segmentation network of artificial intelligence technology using the two-dimensional image set and the lens edge contour generated by the contour points.
[0112] The two-dimensional image is used as input, and the edge contour of the lens is used as the result to train the segmentation network using artificial intelligence technology.
[0113] Step 103: Use a camera to obtain a two-dimensional image of the eyeglass user.
[0114] Step 104: Use artificial intelligence technology to obtain the inner contour of the glasses frame in the two-dimensional image.
[0115] Step 105: Make an image mask according to the inner contour, calculate the loss function and obtain the edge contour of the lens.
[0116] Step 106, performing spline curve fitting on the edge contour to obtain contour data;
[0117] Step 107: Use a high-order spline curve to perform spline curve fitting on the edge contour to obtain contour data.
[0118] Step 108: using the parameters of the camera to obtain actual glasses data of the inner contour of the glasses frame corresponding to the contour data.
[0119] Step 109: output the actual data of the glasses in a preset data format.
[0120] Step 101 specifically includes:
[0121] For each two-dimensional image in the two-dimensional image set, marking at least two contour points on the inner side of the eyeglass frame on the two-dimensional image, wherein the curvature of the contour points is greater than a preset value;
[0122] For two adjacent contour points in a two-dimensional image, a marking point is added on a candidate line segment, and the curvature of the added marking point is the maximum value on the candidate line segment, and the candidate line segment is a line segment on the inner contour of the eyeglass frame between the two adjacent contour points.
[0123] In other implementations, step 101 specifically includes:
[0124] For each two-dimensional image in the two-dimensional image set, marking at least two contour points on the inner side of the eyeglass frame on the two-dimensional image, wherein the curvature of the contour points is greater than a preset value;
[0125] For two adjacent contour points in a two-dimensional image, a marking point is added to the candidate line segment, and the line connecting the added marking point to the two adjacent contour points is the maximum value on the candidate line segment, and the candidate line segment is the line segment on the inner contour of the eyeglass frame between the two adjacent contour points.
[0126] Step 101 specifically also includes:
[0127] Determine whether the distance between two target contour points on the inner contour of the glasses frame in the two-dimensional image is less than a preset distance. If not, add a marking point between the two target contour points and then execute again the step of determining whether the distance between two target contour points on the inner contour of the glasses frame in the two-dimensional image is less than a preset distance.
[0128] The strategy for marking the contour points includes:
[0129] The accuracy of contour points takes precedence over the density of contour points;
[0130] The connecting line of the contour points intersects with the image of the obstruction on the inner contour of the glasses frame.
[0131] Step 104 specifically includes:
[0132] Use artificial intelligence technology to obtain the inner contour of the eyeglass frame in the two-dimensional image;
[0133] After skipping the image enhancement step, the image mask is made according to the inner contour, the loss function is calculated and the lens edge contour is obtained.
[0134] The camera includes a 3D camera and a 2D camera. The 2D camera is used to obtain a two-dimensional image of the user of the glasses. When obtaining the two-dimensional image, the 3D camera is used to obtain a three-dimensional image. The step 108 includes:
[0135] Identify pupil distance in 2D images;
[0136] Obtaining the center position of the lens using the pupil distance;
[0137] Acquire the spatial coordinates of the center position in the three-dimensional image;
[0138] Using the spatial coordinates to obtain the normal direction of the center position;
[0139] The actual data of the glasses corresponding to the contour data are adjusted using the found direction.
[0140] In the specification and claims of the present application, the terms "comprises" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, product or apparatus comprising a series of method steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products or apparatuses.
[0141] Although the specific embodiments of the present invention are described above, those skilled in the art should understand that these are only examples, and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A high-precision continuous contour acquisition method, characterized in that: The high-precision continuous contour acquisition method comprises: Using a camera to acquire a two-dimensional image, wherein the two-dimensional image includes a contour of a continuous curve; Using artificial intelligence technology to obtain the contour of the continuous curve; Making an image mask according to the contour of the continuous curve, calculating a loss function and obtaining the edge contour of the continuous curve; Perform spline curve fitting on the edge contour to obtain contour data; Using the parameters of the camera to obtain actual data of the continuous curve corresponding to the contour data; The actual data of the continuous curve is output in a preset data format.
2. The high-precision continuous contour acquisition method according to claim 1, characterized in that: The continuous curve is a spectacle frame, and the high-precision continuous contour acquisition method includes: Using the camera to obtain a two-dimensional image of the glasses user; Use artificial intelligence technology to obtain the inner contour of the eyeglass frame in the two-dimensional image; Make an image mask based on the inner contour, calculate the loss function and obtain the edge contour of the lens; Use a high-order spline curve to fit the edge contour to obtain contour data; Using the parameters of the camera to obtain actual glasses data of the inner contour of the glasses frame corresponding to the contour data; The actual data of the glasses is output in a preset data format.
3. The high-precision continuous contour acquisition method according to claim 2, characterized in that: The method of using a camera to obtain a two-dimensional image of the eyeglass user includes: Obtain a set of one or two-dimensional images; Marking the contour points of the inner side of the eyeglass frame on the two-dimensional image in each two-dimensional image set; The segmentation network of the artificial intelligence technology is trained using the two-dimensional image set and the lens edge contour generated by the contour points.
4. The high-precision continuous contour acquisition method according to claim 3, characterized in that: The step of marking the contour points of the inner side of the glasses frame on the two-dimensional image in each two-dimensional image set comprises: For each two-dimensional image in the two-dimensional image set, marking at least two contour points on the inner side of the eyeglass frame on the two-dimensional image, wherein the curvature of the contour points is greater than a preset value; For two adjacent contour points in a two-dimensional image, a marking point is added on a candidate line segment, and the curvature of the added marking point is the maximum value on the candidate line segment, and the candidate line segment is a line segment on the inner contour of the eyeglass frame between the two adjacent contour points.
5. The high-precision continuous contour acquisition method according to claim 3, characterized in that: The step of marking the contour points of the inner side of the glasses frame on the two-dimensional image in each two-dimensional image set comprises: For each two-dimensional image in the two-dimensional image set, marking at least two contour points on the inner side of the eyeglass frame on the two-dimensional image, wherein the curvature of the contour points is greater than a preset value; For two adjacent contour points in a two-dimensional image, a marking point is added to the candidate line segment, and the line connecting the added marking point to the two adjacent contour points is the maximum value on the candidate line segment, and the candidate line segment is the line segment on the inner contour of the eyeglass frame between the two adjacent contour points.
6. The high-precision continuous contour acquisition method according to claim 4 or 5, characterized in that: The step of marking the contour points of the inner side of the glasses frame on the two-dimensional image in each two-dimensional image set comprises: Determine whether the distance between two target contour points on the inner contour of the glasses frame in the two-dimensional image is less than a preset distance. If not, add a marking point between the two target contour points and then execute again the step of determining whether the distance between two target contour points on the inner contour of the glasses frame in the two-dimensional image is less than a preset distance.
7. The high-precision continuous contour acquisition method according to claim 4 or 5, characterized in that: Strategies for marking the contour points include: The accuracy of contour points takes precedence over the density of contour points; and / or, The connecting line of the contour points intersects with the image of the obstruction on the inner contour of the glasses frame.
8. The high-precision continuous contour acquisition method according to claim 2, characterized in that: The high-precision continuous contour acquisition method comprises: Use artificial intelligence technology to obtain the inner contour of the eyeglass frame in the two-dimensional image; After skipping the image enhancement step, the image mask is made according to the inner contour, the loss function is calculated and the lens edge contour is obtained.
9. The high-precision continuous contour acquisition method according to claim 2, characterized in that: The camera includes a 3D camera and a 2D camera, the 2D camera is used to obtain a two-dimensional image of the user of the glasses, and the 3D camera is used to obtain a three-dimensional image when obtaining the two-dimensional image. The actual data of the glasses corresponding to the contour data obtained by using the parameters of the camera includes: Identify pupil distance in 2D images; Obtaining the center position of the lens using the pupil distance; Acquire the spatial coordinates of the center position in the three-dimensional image; Using the spatial coordinates to obtain the normal direction of the center position; The actual data of the glasses corresponding to the contour data are adjusted using the found direction.
10. A high-precision continuous contour acquisition device, characterized in that: The high-precision continuous contour acquisition device includes a camera and a processing module, and the high-precision continuous contour acquisition device is used to implement the high-precision continuous contour acquisition method as described in any one of claims 1 to 9.
