CN114972395B - Self-adaptive sampling-based solar lens contour processing method and device - Google Patents

Self-adaptive sampling-based solar lens contour processing method and device Download PDF

Info

Publication number
CN114972395B
CN114972395B CN202210598700.XA CN202210598700A CN114972395B CN 114972395 B CN114972395 B CN 114972395B CN 202210598700 A CN202210598700 A CN 202210598700A CN 114972395 B CN114972395 B CN 114972395B
Authority
CN
China
Prior art keywords
discrete
point
sampling
curvature
points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210598700.XA
Other languages
Chinese (zh)
Other versions
CN114972395A (en
Inventor
范贤光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dazhi Jingchang Xiamen Technology Co ltd
Original Assignee
Dazhi Jingchang Xiamen Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dazhi Jingchang Xiamen Technology Co ltd filed Critical Dazhi Jingchang Xiamen Technology Co ltd
Priority to CN202210598700.XA priority Critical patent/CN114972395B/en
Publication of CN114972395A publication Critical patent/CN114972395A/en
Application granted granted Critical
Publication of CN114972395B publication Critical patent/CN114972395B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20004Adaptive image processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Complex Calculations (AREA)

Abstract

A solar lens contour processing method and device based on self-adaptive sampling relates to the technical field of lens contour processing and is used for solving the problem that an existing lens contour processing method cannot effectively sample a closed lens contour curve. Preprocessing a closed dense discrete point set, and reordering the closed dense discrete point set according to the original contour sequence by taking the position with the maximum discrete curvature as the starting point of discrete data; secondly, searching feature points of the lens contour, and taking the number of the feature points as the number of initial sampling points of subsequent iteration; then establishing a characteristic function based on curvature and arc length weighting, and uniformly sampling to obtain sampling points; and finally, B spline interpolation is carried out on the sampling points, and a B spline interpolation curve is obtained. The invention can greatly reduce the original scanning data and simultaneously smooth the contour curve, and improve the processing efficiency and speed. The invention is suitable for processing the spectacle lenses.

Description

Self-adaptive sampling-based solar lens contour processing method and device
Technical Field
The invention relates to the technical field of lens contour processing, in particular to a solar lens contour processing method and device based on self-adaptive sampling.
Background
Sunglasses are commonly used articles in life of people, and have the main function of isolating ultraviolet rays so as to protect eyes, and play an important role in life and work of people. The traditional solar lens processing generally uses a template type semi-automatic grinding machine, the outline shape of the lens processed by the lens processing machine strictly follows the outline shape of the template, and the traditional solar lens processing machine has obvious defects of single modeling form, poor outline matching precision, low processing efficiency and the like.
In recent years, with the development of numerical control technology, numerical control processing equipment for lens contours gradually emerges at home and abroad, and the numerical control processing equipment is matched with special design software and algorithms, so that the defect of a template type semi-automatic grinding machine is overcome, and a place is occupied in the field of lens contour processing. However, the technology needs to be further improved because of late starting in China. In order to meet the higher requirements of consumers on the processing quality and the larger number of sunglasses, some domestic sunglass manufacturers introduce high-end equipment from abroad, but the high price, unfriendly foreign language environment, complex operation and difficulty in transnational maintenance of the high-end equipment make the high-end equipment only be used by large enterprises, and medium and small enterprises still use medium and low-end equipment, so that the numerical control processing equipment for lens profiles is not effectively popularized in China.
At present, in contour processing, sampling methods generally include uniform arc length sampling (USL), uniform arc length and curvature square (usl+c2), uniform arc length and curvature weighting (usl+c), interpolation methods include bi-arc interpolation, spline curve interpolation, B-spline interpolation, and the like, and these algorithms have advantages, disadvantages and application ranges, but a common disadvantage is that the methods do not consider the characteristic of closing a contour curve of a solar lens, and it is difficult to perform appropriate sampling on a closed curve and interpolation on the closed curve.
Disclosure of Invention
In view of the above problems, the present invention provides a method and a device for processing a solar lens profile based on adaptive sampling, which are used for solving the problem that the existing lens profile processing method cannot effectively sample a closed lens profile curve.
According to an aspect of the present invention, there is provided a solar lens contour processing method based on adaptive sampling, the method comprising the steps of:
step one, acquiring original lens contour point data, and acquiring a discrete point set comprising a plurality of discrete points of a lens contour;
Step two, sampling in a plurality of discrete points by adopting an interpolation method in a mode of combining arc length and curvature weighting, and obtaining lens contour point data after sampling; the method comprises the following specific steps:
Step two, taking a point corresponding to the maximum curvature value on a curve formed by a plurality of discrete points as a starting point, and sequentially placing the discrete points before the starting point to the tail end of the discrete point set to obtain an ordered discrete point set;
step two, calculating the number of feature points of the ordered discrete point set to determine the initial sampling number;
Step two, establishing a characteristic function based on curvature and arc length weighting according to the ordered discrete point set;
Sampling by adopting an interpolation method according to the characteristic function and the initial sampling number to obtain an interpolation curve;
step five, calculating the error precision of the interpolation curve;
And step two, when the error precision is larger than the preset error precision, increasing the initial sampling number, and performing the iterative loop to step four to step five until the error precision is smaller than or equal to the preset error precision, stopping the iterative loop, and obtaining a final interpolation curve.
Further, in the second step, a method of determining an arc by 3 points is adopted, the adjacent 3 discrete points form an approximate arc, the curvature of the discrete points is solved, the sitting mark of the ith discrete point is set as Q i, and the corresponding curvature radius is marked as r i:
The curvature k i of the discrete point is:
Further, the characteristic point determining process in the second step is as follows: if the curvature of any one discrete point and the adjacent points thereof meets the following conditions: k i>ki-1 and k i>ki+1, or to satisfy: k i<ki-1 and k i<ki+1, then the discrete point is a feature point; where k i denotes the curvature of the i-th discrete point, k i-1 denotes the curvature of the i-1 st discrete point, and k i+1 denotes the curvature of the i+1-th discrete point.
Further, the interpolation method in the second step is a B spline interpolation method; the characteristic function in the second and third steps is established as follows:
wherein t i represents the ith discrete point, M represents the number of all discrete points in the ordered discrete point set, and omega 1 represents the weight; l () represents the discrete point arc length; σ () represents a function built up by integration with discrete curvature,
In the method, in the process of the invention,Representing the curvature of the i-th discrete point.
Further, a k-order B-spline interpolation curve equation obtained by adopting the B-spline interpolation method in the second and fourth steps is as follows:
wherein n represents the number of control points; p i represents a B-spline control point; n i,k (u) represents the basis function of the B-spline, u represents the node vector, u ε [0,1].
Further, in the second five steps, the root mean square error is calculated as the error of the interpolation curve, and the calculation formula is as follows:
Where C (t i) represents the original set of discrete points before non-sampling and P (t i) represents the B-spline discrete point sequence interpolated after sampling.
According to another aspect of the present invention, there is provided a solar lens contour processing apparatus based on adaptive sampling, the apparatus comprising:
The original contour point acquisition module is used for acquiring original lens contour point data and acquiring a discrete point set containing a plurality of discrete points of the lens contour;
The sampling contour point acquisition module is used for sampling in a plurality of discrete points by adopting an interpolation method in a mode of combining arc length and curvature weighting to acquire lens contour point data after sampling; the interpolation method is a B spline interpolation method; the method specifically comprises the following steps:
The profile point ordering sub-module is used for taking a point corresponding to the maximum curvature value on a curve formed by a plurality of discrete points as a starting point, and sequentially placing the discrete points before the starting point to the tail end of the discrete point set to obtain an ordered discrete point set;
The characteristic point calculation sub-module is used for calculating the number of the characteristic points of the ordered discrete point set so as to determine the initial sampling number;
The interpolation sampling sub-module is used for establishing a characteristic function based on curvature and arc length weighting according to the ordered discrete point set; sampling by adopting an interpolation method according to the characteristic function and the initial sampling number to obtain an interpolation curve;
And the error calculation sub-module is used for calculating the error precision of the interpolation curve, and increasing the initial sampling number in the characteristic point calculation sub-module when the error precision is larger than the preset error precision so as to resample the interpolation sampling sub-module, and recalculating the error precision of the interpolation curve according to the interpolation curve output by the interpolation sampling sub-module until the error precision is smaller than or equal to the preset error precision, and stopping calculation.
Further, a method of determining an arc by 3 points is adopted in the sampling contour point acquisition module, the adjacent 3 discrete points form an approximate arc, the curvature of the discrete points is solved, the sitting mark of the ith discrete point is set as Q i, and the corresponding curvature radius is recorded as r i:
The curvature k i of the discrete point is:
Further, the process of determining the feature points in the feature point calculation submodule is as follows: if the curvature of any one discrete point and the adjacent points thereof meets the following conditions: k i>ki-1 and k i>ki+1, or to satisfy: k i<ki-1 and k i<ki+1, then the discrete point is a feature point; where k i denotes the curvature of the i-th discrete point, k i-1 denotes the curvature of the i-1 st discrete point, and k i+1 denotes the curvature of the i+1-th discrete point.
Further, the feature function in the interpolation sampling submodule is established as follows:
wherein t i represents the ith discrete point, M represents the number of all discrete points in the ordered discrete point set, and omega 1 represents the weight; l () represents the discrete point arc length; σ () represents a function built up by integration with discrete curvature,
In the method, in the process of the invention,Representing the curvature of the i-th discrete point;
The obtained k-order B spline interpolation curve equation is as follows:
wherein n represents the number of control points; p i represents a B-spline control point; n i,k (u) represents the basis function of the B-spline, u represents the node vector, u ε [0,1].
The beneficial technical effects of the invention are as follows:
Preprocessing a closed dense discrete point set, and reordering the closed characteristic of the lens contour according to the original contour sequence by taking the position with the maximum discrete curvature as the starting point of discrete data; secondly, searching feature points of the lens contour, taking the number of the feature points as the number of initial sampling points of subsequent iteration, and avoiding the randomness of the iteration; then establishing a characteristic function based on curvature and arc length weighting, and uniformly sampling according to the defined characteristic function to obtain sampling points; and finally, B spline interpolation is carried out on the sampling points, and the number of the sampling points is iteratively increased according to the root mean square error as an accuracy judgment standard until the accuracy meets the requirement to obtain a B spline interpolation curve. Experimental results show that the method can greatly reduce original scanning data and simultaneously smooth the contour curve aiming at the characteristic of closing the contour curve of the lens, and improves the processing efficiency and speed; for closed dense discrete points, fewer sampling points can be obtained under the same error and smaller errors can be obtained under the same sampling point, and the method is suitable for spectacle lens processing.
Drawings
The invention may be better understood by reference to the following description taken in conjunction with the accompanying drawings, which are included to provide a further illustration of the preferred embodiments of the invention and to explain the principles and advantages of the invention, together with the detailed description below.
Fig. 1 is a flowchart of a method for processing a solar lens contour based on adaptive sampling according to an embodiment of the present invention.
FIG. 2 is a graph of a sample interpolation effect using a curvature minimum as a starting point in an embodiment of the present invention; wherein, (a) represents an overall interpolation effect map; (b) shows a local interpolation effect map.
FIG. 3 is a graph of the effect of sampling interpolation using the point of maximum curvature as the starting point in an embodiment of the present invention; wherein, (a) represents an overall interpolation effect map; (b) shows a local interpolation effect map.
FIG. 4 is a lens profile of data source 1 and data source 2 in an embodiment of the invention; wherein (a) corresponds to data source 1; (b) corresponds to data source 2.
FIG. 5 is a graph comparing interpolation results for the method of the present invention and the other two methods with the same iteration accuracy; wherein (a) corresponds to the USL method; (b) corresponding usl+c method; (c) corresponds to the process of the invention.
FIG. 6 is a graph showing the comparison of interpolation effects for the same number of samples for the method of the present invention and for two other methods; wherein (a) is an overall comparison of the three methods; (b) And (C) and (d) are partial enlarged views of interpolation effects by adopting a USL method, a USL+C method and the method of the invention in sequence.
FIG. 7 is a view of a lens processing object; wherein, (a) is a real image of the lens before processing, and (b) is a real image of the lens after processing.
Fig. 8 is a view showing the installation effect of the lens after cutting and being put into the frame.
Fig. 9 shows the stress of the frame to the lens under the stress detector.
Fig. 10 is a schematic structural diagram of a solar lens contour processing device based on adaptive sampling according to an embodiment of the invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, exemplary embodiments or examples of the present invention will be described below with reference to the accompanying drawings. It is apparent that the described embodiments or examples are only implementations or examples of a part of the invention, not all. All other embodiments or examples, which may be made by one of ordinary skill in the art without undue burden, are intended to be within the scope of the present invention based on the embodiments or examples herein.
The self-adaptive sampling refers to a process of reasonably selecting points according to dense data points of the inner side contour of the mirror frame obtained by previous scanning, and the purpose of the self-adaptive sampling strategy is to obtain sampling points with less data and high precision.
The embodiment of the invention provides a solar lens contour processing method based on self-adaptive sampling, which comprises the following steps:
step one, acquiring original lens contour point data, and acquiring a discrete point set comprising a plurality of discrete points of a lens contour;
Step two, sampling in a plurality of discrete points by adopting an interpolation method in a mode of combining arc length and curvature weighting, and obtaining lens contour point data after sampling; the method comprises the following specific steps:
step two, taking a point corresponding to the curvature maximum value on a curve formed by a plurality of discrete points as a starting point, and sequentially placing the discrete points before the starting point at the tail end of a discrete point set to obtain an ordered discrete point set;
step two, calculating the number of feature points of the ordered discrete point set to determine the initial sampling number;
Step two, establishing a characteristic function based on curvature and arc length weighting according to the ordered discrete point set;
sampling by adopting an interpolation method according to the characteristic function and the initial sampling number to obtain an interpolation curve;
step five, calculating the error precision of the interpolation curve;
and step two, when the error precision is larger than the preset error precision, increasing the initial sampling number, and performing the iterative loop to step four to step five until the error precision is smaller than or equal to the preset error precision, stopping the iterative loop, and obtaining a final interpolation curve.
In this embodiment, optionally, in the second step, a method of determining an arc by using 3 points is adopted, adjacent 3 discrete points are formed into an approximate arc, the curvature of the discrete points is solved, the sitting mark of the i-th discrete point is set to be Q i, and the corresponding curvature radius is recorded as r i:
The curvature k i of the discrete point is:
In this embodiment, optionally, the determining the feature point in the second step includes: if the curvature of any one discrete point and the adjacent points thereof meets the following conditions: k i>ki-1 and k i>ki+1, or to satisfy: k i<ki-1 and k i<ki+1, then the discrete point is a feature point; where k i denotes the curvature of the i-th discrete point, k i-1 denotes the curvature of the i-1 st discrete point, and k i+1 denotes the curvature of the i+1-th discrete point.
In this embodiment, optionally, the interpolation method in the second step is a B-spline interpolation method; the feature function in the second and third steps is established as follows:
wherein t i represents the ith discrete point, M represents the number of all discrete points in the ordered discrete point set, and omega 1 represents the weight; l () represents the discrete point arc length; σ () represents a function built up by integration with discrete curvature,
In the method, in the process of the invention,Representing the curvature of the i-th discrete point.
In this embodiment, optionally, the k-order B-spline interpolation curve equation obtained by using the B-spline interpolation method in the second and fourth steps is:
wherein n represents the number of control points; p i represents a B-spline control point; n i,k (u) represents the basis function of the B-spline, u represents the node vector, u ε [0,1].
In this embodiment, optionally, in the second five steps, the root mean square error is calculated as the error of the interpolation curve, and the calculation formula is as follows:
Where C (t i) represents the original set of discrete points before non-sampling and P (t i) represents the B-spline discrete point sequence interpolated after sampling.
Another embodiment of the present invention provides a method for processing a contour of a solar lens based on adaptive sampling, as shown in fig. 1, the method includes the following steps:
step one, aiming at the characteristic of lens contour closure, taking the position with the maximum discrete curvature as the starting point of discrete data, and reordering according to the original contour sequence;
According to the embodiment of the invention, aiming at closed dense discrete point data of an eyeglass lens contour, the existing algorithm only aims at sampling of non-closed-loop discrete points, usually takes a starting point and an ending point of a curve as characteristic points of the curve, but the lens contour data is closed, and any point on the curve can be taken as the starting point, so that a method for determining the starting point of the curve is required to be provided, and all the discrete data are reordered to obtain an ordered discrete point set with the optimal interpolation effect.
The shape characteristics of the curve are typically determined by curvature and arc length, and a suitable sampling strategy should be such that the samples are dense where the shape characteristics are significant and sparse where the shape characteristics are not significant. And for the starting point of the curve, the starting point must be used as one of the subsequent sampling points, so that the probability of selecting the sampling point at the sampling dense position is larger than the probability of selecting the sampling point at the sampling sparse position, namely, the starting point is selected at the position where the characteristic of the shape of the curve is more obvious.
According to the analysis, the curvature maximum point is used as a starting point of the whole discrete point set, and the discrete points before the curvature maximum point are sequentially placed at the tail end of the original discrete set, so that a new ordered discrete point set is formed.
Searching feature points of the lens contour, and taking the number of the feature points as the number of initial sampling points of subsequent iteration to avoid the problem of iteration randomness;
According to the embodiment of the invention, since the number N of the sampling points cannot be determined, the conventional algorithm usually takes root mean square error (Root Mean Square Error, RMSE) and maximum absolute error (Maximum Absolute Error, MAE) as judging standards, namely, a smaller sampling number N is given at the beginning, and the value of N is continuously increased until the error meets the standards, but the problem brought by the method is that the quality of the setting of the initial sampling point number N directly influences the quality of the subsequent interpolation efficiency and effect, and the randomness of the whole system is large due to human intervention.
Aiming at the problems, the invention provides the method for determining the initial sampling number N by the number of the characteristic points of the curve, so that the randomness of interpolation is avoided. The characteristic points of the curve are usually change points of continuous steps of the curve, the curvature extreme points are used as the characteristic points of the curve to be calculated, and the characteristic points are determined by calculating the curvature of each discrete point, and if the curvature of any point Q i and the curvature of the adjacent points meet one of the following conditions:
(1) k i>ki-1 and k i>ki+1;
(2) k i<ki-1 and k i<ki+1;
Q i can be marked as the characteristic point of the discrete point, the calculated number of the characteristic points represents the number of curve characteristic changes, and the calculated number of the characteristic points is used as the initial sampling number uniformly sampled according to the characteristic function, so that randomness caused by artificial giving of the initial sampling number can be avoided, the iteration times can be reduced to the greatest extent, and the most suitable uniform sampling number can be found by considering the global property of the curve shape.
Step three, establishing a characteristic function based on curvature and arc length weighting, and uniformly sampling according to the defined characteristic function to obtain sampling points;
According to the embodiment of the invention, a characteristic function K (t) is constructed by combining arc length and curvature weighting to perform uniform point collection, and the characteristic function is defined as follows:
K(ti+1)-K(ti)=1/N (3)
Wherein, the curvature is used for integrating and constructing a function, and after a weight omega 1 is allocated to the function, the function and the arc length are defined as a characteristic function K (t); the sigma (t) is calculated according to the discretized data point as shown in the formula (2). The calculation of the discrete curvature adopts a local estimation method, namely a method of determining an arc by adopting 3 points, wherein adjacent 3 discrete points form an approximate arc to solve the curvature of each original discrete point, a coordinate system is established by taking the circumscribed rectangular center of a discrete point curve as an origin, the number of original data points is set as n, the ith discrete point is marked as Q i, the corresponding curvature radius is marked as r i (i=1, 2, the number of the points is equal to n-2), and the solution formula of the curvature k i of the discrete point is as follows:
Wherein, |q i+1-Qi|、|Qi-1-Qi|、|Qi+1-Qi-1 | represents the distance between two points, respectively;
As can be seen from the formula (1), the feature function-based sampling method focuses on the description of curvature and arc length on the curve features, if the number of sampling points at this time is assumed to be N in advance, the same feature quantity can be obtained between each sampling point according to the formula (3), so as to achieve the purpose of self-adaptive sampling according to the feature quantity.
Step four, B spline interpolation is carried out on sampling points, and the number of the sampling points is iteratively increased according to the root mean square error as an accuracy judgment standard until the accuracy meets the requirement for obtaining a B spline interpolation curve;
According to the embodiment of the invention, after sampling point data is obtained, B spline interpolation is needed to be adopted for sampling points, wherein a k-order B spline curve equation is as follows:
The data points in the given space of P i in the formula (6) are used as the control points of the spline; n i,k (u) is the basis function of the B-spline; according to the recurrence definition proposed by DeBoor-Cox 【1】, the basis functions of the spline are defined as follows:
Wherein: 0/0=0; k is the power of the B spline; i refers to the control point number; u i is a node vector, a set of non-decreasing parameters. When the control vertex P i is known and the node vector is determined, the point with the parameter u on the curve can be defined according to the above recursive formula (7), so as to define the k times of B-spline curve.
Further experiments prove the technical effect of the invention.
Firstly, for the first step of the embodiment of the present invention, the maximum discrete curvature is used as the starting point of the discrete data, and the verification of reordering according to the original contour sequence is as follows: according to the feature function, 21 sampling points are acquired, different interpolation contrasts are carried out on a certain lens contour point set by taking a position with the minimum curvature as a starting point and a position with the maximum curvature as a starting point, as shown in fig. 2 and 3, root Mean Square Error (RMSE) and Maximum Absolute Error (MAE) are adopted as accuracy judgment standards, and the smaller the values of the RMSE and the MAE, the better the interpolation effect is represented.
Fig. 2 (a) is a curve interpolated from the starting point at the maximum of curvature, with RMSE of 0.0177 and mae of 0.4826, and fig. 3 (a) is a curve interpolated from the starting point at the minimum of curvature, with RMSE of 0.0210 and mae of 0.7948. From the above comparison, the interpolation effect with the curvature maximum value as the starting point is more effective. Fig. 2 (b) and 3 (b) are partial enlargements of interpolation effects in different orders, and comparison of the same areas can be seen that interpolation effects with the maximum curvature as the starting point are better.
Then, for verification of the number of feature points as the number of initial sampling points of the subsequent iteration in the second step in the embodiment of the present invention, the verification is that: the data source 1 and the data source 2 are respectively used for carrying out iterative sampling according to the artificial given sampling number and the step two given sampling number according to the embodiment of the invention under the same iterative requirement; wherein the raw curve data for data source 1 and data source 2 is shown in fig. 4. As shown in table 1, it can be seen from table 1 that if the number of initial samples given by the person is too small, the iteration time will be increased, and if the number of initial samples given by the person is too large, the final number of samples will be increased; the method of the embodiment of the invention obtains reasonable sampling number through the integral characteristic of the curve, can improve the stability of the system, improve the iteration speed and reduce the sampling number.
Table 1 comparison table of iterative effects of different initial sample point numbers under the same iterative requirement
Finally, respectively comparing a certain lens contour point set with the method of the invention by adopting two classical methods of uniform arc length sampling (USL) and uniform arc length and curvature weighting (USL+C), and observing a comparison result; table 2 shows the comparison between the number of sampling points, the running time and the number of iterations for the three methods with the same iteration accuracy.
FIG. 5 shows the different interpolation effects of the three methods with the same iteration accuracy, where FIG. 5 (a) is a fitting effect of sampling using the USL method, with 36 sampling points; FIG. 5 (b) is a graph of the fit effect using the USL+C method sampling, with 28 sampling points; fig. 5 (c) shows the fitting effect of sampling by the method of the present invention, with only 23 sampling points. As can be seen from the comparison between the table 2 and the fig. 5, the method of the invention can make the number of sampling points smaller and the iteration times smaller under the same precision.
Table 2 comparison table of different methods with the same precision
Table 3 shows the comparison of RMSE and MAE calculated by the three methods for the same number of samples. Fig. 6 shows the different interpolation effects of the three methods at the same number of sampling points. Fig. 6 (a) is an overall comparison of different methods, and fig. 6 (b), fig. 6 (C) and fig. 6 (d) are partial amplification of interpolation effects by using the USL method, the usl+c method and the method according to the present invention, and as can be seen from the comparison of the same region, the method according to the present invention has higher interpolation accuracy under the same number of sampling points.
TABLE 3 comparison Table of different methods for the same number of sample points
The inspection standard for eyeglass lens processing is that the lenses are not obviously swayed and stressed uniformly after being mounted on the corresponding eyeglass frames. Fig. 7 (a) is a diagram of a lens before processing, and fig. 7 (b) is a diagram of a lens after processing; fig. 8 is a view showing the mounting effect of the lens after cutting and then putting into the frame, wherein the left frame is not mounted with the lens and the right frame is mounted with the lens. As can be seen, lenses manufactured according to the methods of the present invention can be accurately mounted into a frame. Figure 9 shows the stress of the frame on the lens under the stress detector. As can be seen from fig. 9, the periphery of the lens is in a semicircular uniform line shape, which represents that the lens processed according to the method of the present invention is uniformly stressed after being mounted in the lens frame, and meets the processing standard.
It should be noted that the method of the present invention is not limited to the contour processing of the sunglasses lens, and is also applicable to the contour processing of other spectacle lenses.
Another embodiment of the present invention provides a device for processing a contour of a solar lens based on adaptive sampling, as shown in fig. 10, the device includes:
The original contour point acquisition module 10 is used for acquiring original lens contour point data and acquiring a discrete point set comprising a plurality of discrete points of the lens contour; for example, a lens contour scanner is utilized to collect a plurality of contour points of the lens;
The sampling contour point obtaining module 20 is configured to sample in a plurality of discrete points by adopting an interpolation method in a manner of combining arc length and curvature weighting, so as to obtain lens contour point data after sampling; the interpolation method is a B spline interpolation method; the method specifically comprises the following steps:
the profile point ordering sub-module 210 is configured to take a point corresponding to a curvature maximum value on a curve formed by a plurality of discrete points as a starting point, and sequentially place the discrete points before the starting point at the end of the discrete point set to obtain an ordered discrete point set;
A feature point calculation submodule 220, configured to calculate the number of feature points of the ordered discrete point set to determine an initial sampling number;
An interpolation sampling sub-module 230 for establishing a curvature and arc length weighting based feature function according to the ordered set of discrete points; sampling by adopting an interpolation method according to the characteristic function and the initial sampling number to obtain an interpolation curve;
And the error calculation sub-module 240 is configured to calculate an error precision of the interpolation curve, and when the error precision is greater than a preset error precision, increase the number of initial samples in the feature point calculation sub-module, so that the interpolation sampling sub-module resamples, and recalculate the error precision according to the interpolation curve output by the interpolation sampling sub-module until the error precision is less than or equal to the preset error precision, and stop calculating.
In this embodiment, optionally, a method of determining an arc by using 3 points is adopted in the sampling contour point obtaining module 20, the adjacent 3 discrete points form an approximate arc, the curvature of the discrete points is solved, the sitting mark of the i-th discrete point is set as Q i, and the corresponding curvature radius is recorded as r i:
The curvature k i of the discrete point is:
In this embodiment, optionally, the process of determining the feature points in the feature point calculation submodule 220 is: if the curvature of any one discrete point and the adjacent points thereof meets the following conditions: k i>ki-1 and k i>ki+1, or to satisfy: k i<ki-1 and k i<ki+1, then the discrete point is a feature point; where k i denotes the curvature of the i-th discrete point, k i-1 denotes the curvature of the i-1 st discrete point, and k i+1 denotes the curvature of the i+1-th discrete point.
In this embodiment, optionally, the feature function in the interpolation sampling submodule 230 is established as follows:
wherein t i represents the ith discrete point, M represents the number of all discrete points in the ordered discrete point set, and omega 1 represents the weight; l () represents the discrete point arc length; σ () represents a function built up by integration with discrete curvature,
In the method, in the process of the invention,Representing the curvature of the i-th discrete point;
The obtained k-order B spline interpolation curve equation is as follows:
wherein n represents the number of control points; p i represents a B-spline control point; n i,k (u) represents the basis function of the B-spline, u represents the node vector, u ε [0,1].
The function of the adaptive sampling-based solar lens contour processing device in this embodiment may be described by the adaptive sampling-based solar lens contour processing method, so that details of this embodiment are not described, and reference may be made to the above method embodiments, which are not described herein.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the above description, will appreciate that other embodiments are contemplated within the scope of the invention as described herein. The disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is defined by the appended claims.
The documents cited in the present invention are:
[1]C.de Boor,A Practical Guide to Splines[M].Springer,New York,Heidelberg,1978.

Claims (8)

1. The solar lens contour processing method based on the adaptive sampling is characterized by comprising the following steps of:
step one, acquiring original lens contour point data, and acquiring a discrete point set comprising a plurality of discrete points of a lens contour;
Step two, sampling in a plurality of discrete points by adopting a B spline interpolation method in a mode of combining arc length and curvature weighting, and obtaining lens contour point data after sampling; the method comprises the following specific steps:
Step two, taking a point corresponding to the maximum curvature value on a curve formed by a plurality of discrete points as a starting point, and sequentially placing the discrete points before the starting point to the tail end of the discrete point set to obtain an ordered discrete point set;
step two, calculating the number of feature points of the ordered discrete point set to determine the initial sampling number;
step two, establishing a characteristic function based on curvature and arc length weighting according to the ordered discrete point set; the feature function is established as follows:
Wherein t i represents the i-th discrete point; m represents the number of all discrete points in the ordered discrete point set; omega 1 represents the weight; l () represents the discrete point arc length; σ () represents a function built up by integration with discrete curvature,
In the method, in the process of the invention,Representing the curvature of the i-th discrete point;
Sampling by adopting an interpolation method according to the characteristic function and the initial sampling number to obtain an interpolation curve;
step five, calculating the error precision of the interpolation curve;
And step two, when the error precision is larger than the preset error precision, increasing the initial sampling number, and performing the iterative loop to step four to step five until the error precision is smaller than or equal to the preset error precision, stopping the iterative loop, and obtaining a final interpolation curve.
2. The adaptive sampling-based sun lens contour processing method according to claim 1, wherein in the second step, a method of determining an arc at 3 points is adopted, the adjacent 3 discrete points are formed into an approximate arc, the curvature of the discrete points is solved, the sitting mark of the i-th discrete point is set as Q i, and the corresponding curvature radius is recorded as r i:
The curvature k i of the discrete point is:
3. The adaptive sampling-based sun lens contour processing method according to claim 1 or 2, wherein the step two is characterized in that the characteristic point determining process comprises the following steps: if the curvature of any one discrete point and the adjacent points thereof meets the following conditions: k i>ki-1 and k i>ki+1, or to satisfy: k i<ki-1 and k i<ki+1, then the discrete point is a feature point; where k i denotes the curvature of the i-th discrete point, k i-1 denotes the curvature of the i-1 st discrete point, and k i+1 denotes the curvature of the i+1-th discrete point.
4. The adaptive sampling-based solar lens contour processing method as claimed in claim 3, wherein the k-order B-spline interpolation curve equation obtained by adopting the B-spline interpolation method in the second and fourth steps is:
wherein n represents the number of control points; p i represents a B-spline control point; n i,k (u) represents the basis function of the B-spline, u represents the node vector, u ε [0,1].
5. The adaptive sampling-based sun lens contour processing method according to claim 4, wherein the root mean square error is calculated as an interpolation curve error in the second five steps, and the calculation formula is as follows:
Where C (t i) represents the original set of discrete points before non-sampling and P (t i) represents the B-spline discrete point sequence interpolated after sampling.
6. A solar lens contour processing device based on adaptive sampling, comprising:
The original contour point acquisition module is used for acquiring original lens contour point data and acquiring a discrete point set containing a plurality of discrete points of the lens contour;
The sampling contour point acquisition module is used for sampling in a plurality of discrete points by adopting an interpolation method in a mode of combining arc length and curvature weighting to acquire lens contour point data after sampling; the interpolation method is a B spline interpolation method; the method specifically comprises the following steps:
The profile point ordering sub-module is used for taking a point corresponding to the maximum curvature value on a curve formed by a plurality of discrete points as a starting point, and sequentially placing the discrete points before the starting point to the tail end of the discrete point set to obtain an ordered discrete point set;
The characteristic point calculation sub-module is used for calculating the number of the characteristic points of the ordered discrete point set so as to determine the initial sampling number;
The interpolation sampling sub-module is used for establishing a characteristic function based on curvature and arc length weighting according to the ordered discrete point set; sampling by adopting an interpolation method according to the characteristic function and the initial sampling number to obtain an interpolation curve; the feature function is established as follows:
Wherein t i represents the ith independent variable, M represents the number of all discrete points in the ordered discrete point set, and omega 1 represents the weight; l () represents the discrete point arc length; σ () represents a function built up by integration with discrete curvature,
In the method, in the process of the invention,Representing the curvature of the t i th discrete point;
The obtained k-order B spline interpolation curve equation is as follows:
Wherein n represents the number of control points; p i represents a B-spline control point; n i,k (u) represents the basis function of the B-spline, u represents the node vector, u ε [0,1];
And the error calculation sub-module is used for calculating the error precision of the interpolation curve, and increasing the initial sampling number in the characteristic point calculation sub-module when the error precision is larger than the preset error precision so as to resample the interpolation sampling sub-module, and recalculating the error precision of the interpolation curve according to the interpolation curve output by the interpolation sampling sub-module until the error precision is smaller than or equal to the preset error precision, and stopping calculation.
7. The adaptive sampling-based sun lens contour processing device according to claim 6, wherein the sampling contour point obtaining module adopts a method of determining an arc by 3 points, wherein adjacent 3 discrete points form an approximate arc, the curvature of the discrete points is solved, the sitting mark of the ith discrete point is set as Q i, and the corresponding curvature radius is recorded as r i:
The curvature k i of the discrete point is:
8. The adaptive sampling-based sun lens contour processing device according to claim 6 or 7, wherein the process of determining the feature points in the feature point calculation submodule is as follows: if the curvature of any one discrete point and the adjacent points thereof meets the following conditions: k i>ki-1 and k i>ki+1, or to satisfy: k i<ki-1 and k i<ki+1, then the discrete point is a feature point; where k i denotes the curvature of the i-th discrete point, k i-1 denotes the curvature of the i-1 st discrete point, and k i+1 denotes the curvature of the i+1-th discrete point.
CN202210598700.XA 2022-05-30 2022-05-30 Self-adaptive sampling-based solar lens contour processing method and device Active CN114972395B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210598700.XA CN114972395B (en) 2022-05-30 2022-05-30 Self-adaptive sampling-based solar lens contour processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210598700.XA CN114972395B (en) 2022-05-30 2022-05-30 Self-adaptive sampling-based solar lens contour processing method and device

Publications (2)

Publication Number Publication Date
CN114972395A CN114972395A (en) 2022-08-30
CN114972395B true CN114972395B (en) 2024-07-09

Family

ID=82958677

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210598700.XA Active CN114972395B (en) 2022-05-30 2022-05-30 Self-adaptive sampling-based solar lens contour processing method and device

Country Status (1)

Country Link
CN (1) CN114972395B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105425725A (en) * 2015-12-09 2016-03-23 华中科技大学 Curve fitting method for discrete cutter path
CN111145228A (en) * 2019-12-23 2020-05-12 西安电子科技大学 Heterogeneous image registration method based on local contour point and shape feature fusion

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7158677B2 (en) * 2002-08-20 2007-01-02 National Instruments Corporation Matching of discrete curves under affine transforms
JP4934789B2 (en) * 2006-01-23 2012-05-16 国立大学法人横浜国立大学 Interpolation processing method and interpolation processing apparatus
US9552532B2 (en) * 2013-04-01 2017-01-24 Aselsan Elektronik Sanayi Ve Ticaret Anonim Sirketi System and method for describing image outlines
CN114491865B (en) * 2022-02-08 2024-02-20 合肥工业大学 Self-adaptive discrete method for workpiece surface profile

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105425725A (en) * 2015-12-09 2016-03-23 华中科技大学 Curve fitting method for discrete cutter path
CN111145228A (en) * 2019-12-23 2020-05-12 西安电子科技大学 Heterogeneous image registration method based on local contour point and shape feature fusion

Also Published As

Publication number Publication date
CN114972395A (en) 2022-08-30

Similar Documents

Publication Publication Date Title
CN109800795A (en) A kind of fruit and vegetable recognition method and system
CN110262250A (en) A kind of B-spline curves approximating method and system based on particle swarm algorithm
CN109003234A (en) For the fuzzy core calculation method of motion blur image restoration
CN113808180B (en) Heterologous image registration method, system and device
CN117786325B (en) Ambient temperature wisdom early warning system of heavy-calibre thing networking water gauge
CN116992779B (en) Simulation method and system of photovoltaic energy storage system based on digital twin model
CN112561807B (en) End-to-end radial distortion correction method based on convolutional neural network
CN117095008A (en) Intelligent detection method for defects of steel bar pipe of clock
CN110909778A (en) Image semantic feature matching method based on geometric consistency
CN109410158A (en) A kind of Multi-focal-point image fusion method based on convolutional neural networks
CN114972395B (en) Self-adaptive sampling-based solar lens contour processing method and device
CN111260776A (en) Three-dimensional shape reconstruction method for adaptive normal analysis
CN117994154B (en) Intelligent image denoising method based on sensor
CN111179333A (en) Defocus fuzzy kernel estimation method based on binocular stereo vision
CN117911252A (en) Method and system for removing illumination in image based on deep learning
CN108388909A (en) A kind of complex-curved adaptively sampled method
CN110309727B (en) Building identification model establishing method, building identification method and building identification device
CN110120009B (en) Background blurring implementation method based on salient object detection and depth estimation algorithm
CN116416161A (en) Image restoration method for improving generation of countermeasure network
CN115410218A (en) Household pattern recognition and modeling method based on artificial intelligence image recognition
CN112446345B (en) Low-quality three-dimensional face recognition method, system, equipment and storage medium
CN115035304A (en) Image description generation method and system based on course learning
CN110060258B (en) Retina SD-OCT image segmentation method and device based on Gaussian mixture model clustering
CN110163273B (en) RANSAC algorithm-based image matching method with genetic factors
CN109978962B (en) Low-contrast indicating value image intelligent identification method for darkroom illuminometer calibration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant