A method of measuring the edge profile dimensions of a spectacle frame
By using pixel equivalent calibration and image processing technology, combined with high-order curve fitting, a fast and accurate measurement of the inner edge contour of the eyeglass frame is achieved, solving the problems of slow measurement speed and insufficient accuracy of the eyeglass frame contour in the existing technology. It is suitable for online eyeglass frame selection and remote eyeglass fitting.
Patent Information
- Application Number
- CN202210480812.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-05
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2042-05-05
AI Technical Summary
In existing technologies, the method for measuring the outline of eyeglass frames relies on machine scanning, which is slow and cannot meet the needs of online selection and remote eyeglass fitting in the Internet era. In addition, domestic edging machines lag behind foreign products in terms of accuracy and quality, and have high design complexity.
The method employs pixel equivalent calibration, image information acquisition, acquisition of horizontal and vertical dimensions of the frame, acquisition of frame groove dimensions, and information supplementation. The frame image is acquired by a CCD area array camera, and image preprocessing and edge detection are performed. The inner edge contour of the frame is restored by high-order curve fitting.
It achieves efficient and accurate measurement of the inner edge contour of the eyeglass frame, with fast measurement speed, meeting the needs of remote eyeglass fitting in the Internet era, and is also suitable for improving the precision of domestic eyeglass frame production.
Smart Images

Figure CN114792335B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of measurement, in particular to a method for measuring the inner edge profile size of a spectacle frame. BACKGROUND
[0002] Spectacles are a necessity in the lives of a considerable part of the population in the current society, and with the improvement of living standards and the emphasis of the public on eye health, higher requirements for the traditional eyewear industry are proposed, such as rapid and accurate matching, personalization, and intelligent lens fitting. Therefore, it is of great significance to quickly and accurately obtain the profile size information of the spectacle frame to be fitted, so as to facilitate the transmission to the lens edging module to complete the rapid lens fitting.
[0003] The previous lens fitting mode in China still largely relies on machine scanning templates and transmitting them to the edging system for processing, and the lens fitting process is very traditional. The more advanced full-automatic lens fitting equipment mainly comes from some foreign manufacturers, such as the well-known French Essilor (ESSILOR), Japanese Nidek (NIDEK), and Japanese Topcon (TOPCON) companies. The full-automatic edging machines produced by them, which integrate the functions of frame profile scanning and lens edging, have been widely used and have realized truly mold-free manufacturing, but the price is high, making it difficult for most optical stores to promote the use.
[0004] At present, the edging machines produced in China have a great gap in quality and precision compared with foreign products, and this contact type measurement method needs to scan the spectacle frame to be fitted in real time to obtain the frame profile size data, which is slow in scanning speed and does not meet the consumer demand for online frame selection and remote lens fitting in the current Internet era. In addition, this method involves multiple motion mechanisms, which requires high precision in mechanical processing, and the data transmission module involved is complex, greatly increasing the design difficulty. SUMMARY
[0005] In view of the deficiencies of the prior art, the present application provides a method for measuring the inner edge profile size of a spectacle frame, which solves the problems raised in the background art.
[0006] To achieve the above purpose, the present application is implemented by the following technical scheme, a method for measuring the inner edge profile size of a spectacle frame, comprising the following steps:
[0007] S1, pixel equivalent calibration;
[0008] S2, image information acquisition;
[0009] S3, horizontal and vertical size acquisition of the frame;
[0010] S4, frame slot size acquisition;
[0011] S5, information supplement.
[0012] Further, the method comprises the following specific steps:
[0013] S1, pixel equivalent calibration
[0014] A standard part with known contour size information is taken as a reference object, an image with the reference object is collected as a reference image, pixel coordinates of the reference object in the image coordinate system are obtained, and a proportional relationship between the actual size of the reference object and the number of pixels is determined according to the physical size of the reference object and the pixel coordinates of the reference object in the reference image;
[0015] S2, image information acquisition
[0016] The eyeglass frame to be measured is placed on the object table, and an image of the eyeglass frame to be measured is collected, and then the edge point information of the eyeglass frame image is obtained after image preprocessing;
[0017] S3, horizontal size and vertical size acquisition
[0018] According to the edge information of the eyeglass frame image obtained in S1 and S2, a parameter is set to screen the inner edge contour of the eyeglass frame, a rectangular frame tangent to the inner contour of the eyeglass frame is taken as the basis for determining the size measurement of the eyeglass frame, a minimum rotating circumscribed rectangle operation is performed on the contour, and the horizontal size and vertical size information of the inner edge contour of the eyeglass frame are obtained by using the proportional relationship between the actual size and the number of pixels obtained in S1;
[0019] S4, frame slot size acquisition
[0020] According to the step S3, another parameter can be set to screen the outer edge contour of the eyeglass frame, and the corresponding upper and lower boundary points of the inner edge contour of the eyeglass frame and the outer edge contour of the eyeglass frame are found, and then the frame slot width size information of the eyeglass frame is obtained by using the proportional relationship between the actual size and the number of pixels obtained in S1;
[0021] S5, information supplement
[0022] The inner edge contour information of the eyeglass frame in the image of the eyeglass frame to be measured is extracted, the outer edge contour information of the eyeglass frame in the image of the eyeglass frame to be measured is taken as the edge contour that can be trusted for the missing contour part such as the nose pad, the missing inner contour edge pixel information is supplemented according to the obtained frame slot width, and the missing part contour is fitted with a high-order curve, and finally the inner edge contour of the eyeglass frame is restored;
[0023] Further, the standard part in the S1 pixel equivalent calibration process can be a standard gauge block or a standard two-dimensional graph, and the proportional relationship between the actual size of the reference object and the number of pixels is k = d pixel / d, wherein k is a pixel ratio of a given measurement unit, in pxiel / mm, representing a conversion relationship between a pixel size and an actual physical size of a measurement system, d is an actual size of the reference object, and d pixel is a size of the standard part in pixels under the measurement system.
[0024] Further, after collecting the image of the to-be-measured spectacle frame in the S2 image information acquisition process, the image needs to be pre-processed, that is, the collected image of the to-be-measured spectacle frame is converted into a gray-scale image and denoised. The collected image of the to-be-measured spectacle frame is processed to generate a gray-scale image, and then the gray-scale image is smoothed based on a Gaussian filter, that is, a template (or convolution, mask) is set to scan each pixel in the image, and the weighted average gray-scale value of the pixels in the neighborhood determined by the template is used to replace the value of the center pixel point of the template, so as to remove the image noise points.
[0025] Further, after the S2 image information is converted into a gray-scale image and denoised, an edge detection method based on a Canny edge detection operator is used to extract the edge contour information of the spectacle frame. The Canny edge detection operator includes the following steps: in the acquisition process, the high-frequency noise superimposed in the to-be-measured image is filtered out by performing weighted averaging according to the parameter rules generated by the Gaussian formula based on the gray-scale values of the to-be-filtered pixel points and their domain points through Gaussian filtering; the gradient strength and direction of each pixel point in the image are calculated by using a gradient operator, and most non-edge points are removed by applying a non-maximum suppression operation to the image edge based on the obtained gradient amplitude and gradient direction; a double-threshold detection is applied, the edge pixels with a gradient value higher than a high threshold value are marked as strong edge pixels, the edge pixels with a gradient value less than the high threshold value and greater than a low threshold value are marked as weak edge pixels, and the edge pixels with a gradient value less than the low threshold value are suppressed, and finally the detection of all edge information of the to-be-measured spectacle frame image is completed by suppressing the isolated weak edges.
[0026] Further, after the S2 image information is extracted, morphological processing is performed, that is, the morphological algorithm is used to remove the interfering fine texture in the edge information of the to-be-measured spectacle frame image, that is, a suitable kernel parameter is set, and a closed operation of expansion followed by corrosion is performed on the to-be-measured spectacle frame edge image to exclude small black hole regions in the to-be-measured spectacle frame edge image, and the dark regions between the highlight regions are highlighted, so that the inner edge contour and the outer edge contour of the to-be-measured frame are clear.
[0027] Further, the horizontal size and vertical size information of the inner edge contour of the spectacle frame in the S3 frame horizontal size and vertical size acquisition process are obtained based on the length pixel number and width pixel number of the minimum tangent rotating circumscribed rectangle containing the inner edge contour of the spectacle frame and the pixel ratio k of pixel equivalent calibration.
[0028] Further, the frame groove width size information in the S4 frame groove size acquisition process is obtained based on the pixel proportion k conversion of the arithmetic mean of the upper and lower extreme point pixel coordinates of the inner edge profile of the glasses frame and the pixel equivalent calibration.
[0029] Further, the restoration of the inner edge profile of the glasses frame in the S5 information supplement process is based on the assumption that the frame groove width of each part of the frame is consistent, the inner edge profile of the glasses frame is restored by adjusting the template kernel size in the morphological processing process, screening appropriate parameters to maximize the restoration of the profile information of the blocked part under the premise of not affecting the profile detection, and for the missing part of the frame profile information, the pixel information is supplemented from the reliable edge profile of the outer profile to the missing inner profile direction edge according to the measured frame groove width pixel number, and the missing part of the profile is fitted by a high-order curve to complete the restoration of the inner edge profile of the glasses frame.
[0030] The present application provides a frame inner edge profile size measurement method, which has the following beneficial effects: the frame inner edge profile size measurement method uses a face array CCD camera to collect the image of the glasses frame to be measured, and the image acquisition result is subjected to image processing, so that the frame inner edge profile size is measured efficiently and accurately, and the measurement method is different from the traditional contact type measurement, has the advantage of fast measurement speed, not only measures the horizontal size and width size information of the glasses frame, but also supplements the frame groove and the missing inner profile information, fits the missing part of the profile by a high-order curve, and finally restores the inner edge profile of the glasses frame, which meets the consumer demand for online selection and remote fitting of glasses in the current Internet era. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 It is a flowchart of the frame inner edge profile size measurement method of the present application;
[0032] Figure 2 It is a diagram of the smallest circumscribed rotating rectangle tangent to the frame inner edge profile;
[0033] Figure 3 It is a diagram of the upper and lower boundary points corresponding to the frame inner edge profile and the frame outer edge profile;
[0034] Figure 4 It is a diagram of the blocked area A of the frame inner edge profile image;
[0035] Figure 5 It is a diagram of the restoration process of the missing frame inner profile edge. DETAILED DESCRIPTION
[0036] A frame inner edge profile size measurement method, referring to Figure 1 The method comprises the following steps:
[0037] S1, pixel equivalent calibration;
[0038] S2, image information acquisition;
[0039] S3, horizontal and vertical dimensions of the frame are obtained;
[0040] S4, frame slot size is obtained;
[0041] S5, information supplement.
[0042] A frame inner edge contour size measurement method comprises the following specific steps:
[0043] S1, pixel equivalent calibration
[0044] A standard part with known contour size information is taken as a reference object, an image with the reference object is collected as a reference image, pixel coordinates of the reference object in the image coordinate system are obtained, and a proportional relationship between the actual size of the reference object and the number of pixels is determined according to the physical size of the reference object and the pixel coordinates of the reference object in the reference image;
[0045] In the process of S1, the standard part can be a standard gauge block or a standard two-dimensional figure. A 30mm*35mm two-dimensional rectangular figure is used as the standard part. The proportional relationship between the actual size of the reference object and the number of pixels is k=d / d. In the formula, k is the pixel proportion of a given measurement unit, with the unit of pxiel / mm, which represents the conversion relationship between the pixel size and the actual physical size of the measurement system. d is the actual size of the reference object, and d is the size of the standard part in pixels under the measurement system. After conversion, the pixel proportion coefficient k of the pixel equivalent calibration is 8.77025pxiel / mm. pixel pixel
[0046] S2, image information acquisition
[0047] The eyeglass frame to be measured is placed on the object table, and the image of the eyeglass frame to be measured is collected. Then, after image preprocessing, the edge point information of the eyeglass frame image is obtained.
[0048] After acquiring the image of the eyeglass frame to be tested during the S2 image information acquisition process, the image needs to be preprocessed. This involves converting the acquired image of the eyeglass frame to grayscale to generate a grayscale image. Then, the grayscale image is smoothed using a Gaussian filter. Specifically, a template (or convolution, mask) is set up to scan each pixel in the image, and the value of the center pixel of the template is replaced by the weighted average grayscale value of the pixels in the neighborhood determined by the template, thereby removing image noise. Subsequently, all contour edges of the eyeglass frame image under test are extracted based on the Canny edge detection operator. The Canny edge detection operator is implemented by the following steps: Gaussian filtering is used to filter out high-frequency noise superimposed in the image by performing a weighted average based on the gray values of the pixel to be filtered and its neighborhood points according to the parameter rules generated by the Gaussian formula; a gradient operator is used to calculate the gradient intensity and direction of each pixel in the image, and non-maximum suppression is applied to the image edges based on the obtained gradient magnitude and gradient direction to remove most non-edge points; dual threshold detection is applied to mark edge pixels with gradient values higher than the high threshold as strong edge pixels, and edge pixels with gradient values lower than the high threshold but higher than the low threshold as weak edge pixels, and edge pixels with gradient values lower than the low threshold are suppressed. By suppressing isolated weak edges, the detection of all edge information of the eyeglass frame image under test is finally completed. Based on morphological algorithms, the finer textures that cause interference in the edge information of the eyeglass frame image under test are removed. Specifically, appropriate kernel parameters are set, and a dilation-erosion closing operation is performed on the edge image of the eyeglass frame under test to eliminate small black hole regions in the edge image of the eyeglass frame under test. The dark regions between the bright regions are highlighted to make the inner and outer edge contours of the eyeglass frame under test clear.
[0049] S3. Obtaining the horizontal and vertical dimensions of the eyeglass frame
[0050] Based on the edge information of the eyeglass frame image obtained in S1 and S2 above, parameters are set to filter the inner edge contour of the eyeglass frame. Using the frame measurement system, a rectangular frame tangent to the inner contour of the frame is used as the basis for determining the eyeglass frame size measurement. Figure 2 As shown, the minimum rotation bounding rectangle operation is performed on the contour, and the horizontal and vertical dimensions of the inner edge contour of the eyeglass frame are calculated using the ratio of the actual size to the number of pixels obtained in S1.
[0051] In the process of acquiring the horizontal and vertical dimensions of the S3 eyeglass frame, the horizontal dimension of the inner edge contour of the eyeglass frame is calculated by converting the distance between the two vertical sides of the circumscribed rectangle in the box method measurement system, and the vertical dimension is calculated by converting the distance between the two horizontal sides of the circumscribed rectangle in the box method measurement system. The horizontal and vertical dimension information is obtained by converting the length and width of the smallest tangent rotating circumscribed rectangle containing the inner edge contour of the eyeglass frame into the pixel ratio k of the pixel equivalent calibration.
[0052] S4. Obtaining the dimensions of the mirror frame groove
[0053] Based on step S3 above, another parameter can be set to filter the outer edge contour of the eyeglass frame, such as... Figure 3 As shown, by finding the corresponding upper and lower boundary points of the inner edge contour and the outer edge contour of the eyeglass frame, the width dimension information of the eyeglass frame groove can be calculated using the ratio of the actual size to the number of pixels obtained in step S1.
[0054] In the process of obtaining the frame groove size of S4, the width size information of the frame groove is obtained by converting the arithmetic mean of the upper and lower extreme pixel coordinates of the inner edge contour of the eyeglass frame and the pixel ratio k calibrated by the pixel equivalent.
[0055] S5, Information Supplement
[0056] Extract the inner edge contour information of the eyeglass frame from the image of the eyeglass frame to be tested, such as... Figure 4 As shown, for the inner edge contour region A that is obscured by nose pads, the reliable edge contour Contours1 of the outer edge contour information of the eyeglass frame in the image of the eyeglass frame to be tested is taken. The pixel information of the missing inner contour edge contour Contours2 is supplemented according to the obtained frame groove width, and the missing part of the contour is fitted with a high-order curve to finally restore the inner edge contour of the eyeglass frame.
[0057] The restoration of the inner edge contour of the eyeglass frame during S5 information supplementation is based on the assumption that the width of the frame grooves in all parts of the frame is consistent. By adjusting the template kernel size and selecting appropriate parameters during morphological processing, the restoration of the occluded contour information is maximized without affecting contour detection. The process is as follows: Figure 5 As shown, for the missing frame contour information, based on the measured frame groove width in pixels, pixel information is supplemented from the reliable outer contour Contours1 towards the missing inner contour. Then, a high-order curve fitting is performed on the missing contour Contours2 to restore the inner edge contour of the eyeglass frame. Experiments show that using a 5th-order curve fitting can obtain better restoration results.
[0058] In summary, the method for measuring the inner edge contour dimensions of a picture frame includes the following specific steps:
[0059] S1, pixel equivalent calibration: taking a standard part with known contour size information as a reference object, collecting an image with the reference object as a reference image, obtaining the pixel coordinates of the reference object in the image coordinate system in the reference image, and determining the proportional relationship between the actual size of the reference object and the number of pixels according to the physical size of the reference object and the pixel coordinates of the reference object in the reference image, the standard part can be a standard gauge block or a standard two-dimensional figure, and the proportional relationship between the actual size of the reference object and the number of pixels is: k = d pixel / d, in the formula, k is the pixel ratio of a given measurement unit, with the unit of pxiel / mm, which reflects the conversion relationship between the pixel size of the measurement system and the actual physical size, d is the actual size of the reference object, d pixel is the size of the standard part in pixels under the measurement system;
[0060] S2, image information acquisition: placing the to-be-measured spectacle frame on the object table and collecting the image of the to-be-measured spectacle frame, after collecting the image of the to-be-measured spectacle frame, the image needs to be preprocessed, that is, the collected image of the to-be-measured spectacle frame is converted into a gray-scale image, and then the gray-scale image is smoothed based on a Gaussian filter, that is, a template (or convolution, mask) is used to scan each pixel in the image, and the weighted average gray-scale value of the pixels in the neighborhood determined by the template is used to replace the value of the center pixel point of the template, so as to remove the image noise. Subsequently, all contour edges of the to-be-measured spectacle frame image are extracted based on a Canny edge detection operator, and the Canny edge detection operator is implemented, including the following steps: through Gaussian filtering, the gray-scale values of the pixel points and their domain points to be filtered are weighted and averaged according to the parameter rules generated by the Gaussian formula, and the superimposed high-frequency noise in the to-be-measured image is filtered out; the gradient strength and direction of each pixel point in the image are calculated by using a gradient operator, and most of the non-edge points are removed by applying a non-maximum suppression operation to the image edge based on the gradient amplitude and gradient direction obtained; a double-threshold detection is applied, the edge pixels with a gradient value higher than a high threshold value are marked as strong edge pixels, the edge pixels with a gradient value less than the high threshold value and greater than a low threshold value are marked as weak edge pixels, and the edge pixels with a gradient value less than the low threshold value are suppressed, and finally the detection of all edge information of the to-be-measured spectacle frame image is completed through the suppression of isolated weak edges. The interfering fine texture in the edge information of the to-be-measured spectacle frame image is removed based on a morphological algorithm, that is, appropriate kernel parameters are set, and a closed operation of expansion and then corrosion is performed on the to-be-measured spectacle frame edge image, small black hole regions in the to-be-measured spectacle frame edge image are excluded, and the dark regions between the high-light regions are highlighted, so that the inner edge contour and the outer edge contour of the to-be-measured frame are clear;
[0061] S3, horizontal and vertical dimensions of the frame are obtained: according to the edge information of the frame image obtained in S1 and S2, a parameter is set to screen the inner edge contour of the frame, and a minimum rotating rectangle operation is performed on the contour. The length and width of the inner edge contour of the frame are obtained by converting the actual size and pixel number obtained in S1 according to the proportional relationship between the two, and the length and width of the inner edge contour of the frame are obtained by converting the length and width of the minimum rotating rectangle containing the inner edge contour of the frame according to the proportional relationship between the length and width of the minimum rotating rectangle containing the inner edge contour of the frame and the pixel ratio k of the quantitative unit.
[0062] S4, frame slot size is obtained: according to the parameter set in S3, the outer edge contour of the frame is screened, and the corresponding upper and lower boundary points of the inner edge contour of the frame and the outer edge contour of the frame are found. Then, the width of the frame slot of the frame is obtained by converting the actual size and pixel number obtained in S1 according to the proportional relationship between the two, and the width of the frame slot of the frame is obtained by converting the length and width of the minimum rotating rectangle containing the inner edge contour of the frame according to the proportional relationship between the length and width of the minimum rotating rectangle containing the inner edge contour of the frame and the pixel ratio k of the quantitative unit.
[0063] S5, information supplement: the inner edge contour information of the frame in the image to be measured is extracted, and the edge contour of the outer edge contour of the frame in the image to be measured is taken as the reliable edge contour for the missing contour part such as the nose pad. The missing inner contour edge pixel information is supplemented according to the width of the frame slot, and the missing part of the contour is fitted with a high-order curve, so as to restore the inner edge contour of the frame.
Claims
1. A method of measuring the dimensions of the inner edge profile of a spectacle frame, characterized in that, The method comprises the following steps: S1, pixel equivalent calibration; S2, image information acquisition; S3, horizontal and vertical size acquisition of the frame; S4, frame slot size acquisition; S5, information supplement; The method comprises the following specific steps: S1, pixel equivalent calibration A standard part with known contour size information is taken as a reference object, an image with the reference object is collected as a reference image, pixel coordinates of the reference object in the image coordinate system are obtained, and a proportional relationship between the actual size of the reference object and the number of pixels is determined according to the physical size of the reference object and the pixel coordinates of the reference object in the reference image; S2, image information acquisition The to-be-measured spectacle frame is placed on a stage, and an image of the to-be-measured spectacle frame is collected, then the image is preprocessed, and edge point information of the spectacle frame image is obtained; S3, horizontal and vertical size acquisition of the frame According to the edge information of the spectacle frame image obtained in S1 and S2, a parameter is set to screen the inner edge contour of the spectacle frame, a rectangular frame tangent to the inner contour of the spectacle frame is taken as the basis for determining the size measurement of the spectacle frame, a minimum tangent rotating circumscribed rectangle operation is performed on the contour, and the horizontal and vertical size information of the inner contour of the spectacle frame is obtained by using the proportional relationship between the actual size and the number of pixels obtained in S1; S4, frame slot size acquisition According to the parameter set in S3, another parameter is set to screen the outer edge contour of the spectacle frame, the corresponding upper and lower boundary points of the inner edge contour of the spectacle frame and the outer edge contour of the spectacle frame are found, and then the width size information of the frame slot of the spectacle frame is obtained by using the proportional relationship between the actual size and the number of pixels obtained in S1; S5, information supplement The inner edge contour information of the to-be-measured spectacle frame in the image is extracted, the edge contour information of the outer edge contour of the to-be-measured spectacle frame in the image is taken as the reliable edge contour for the missing contour part of the nose pad, the missing inner contour edge pixel information is supplemented according to the width of the frame slot, and the missing part contour is fitted by a high-order curve, and finally the inner edge contour of the spectacle frame is restored; The standard part in the S1 pixel equivalent calibration process can be a standard gauge or a standard two-dimensional pattern, and the proportional relationship between the actual size of the reference and the number of pixels is: k=d pixel / d, in the formula, k is the pixel ratio of a given measurement unit, with the unit of pxiel / mm, which reflects the conversion relationship between the pixel size of the measurement system and the actual physical size, d pixel is the actual size of the reference, and d In the image information acquisition process S2, after the image of the to-be-measured spectacle frame is collected, the image needs to be preprocessed, that is, the collected image of the to-be-measured spectacle frame is converted into a gray image and denoised, the collected image of the to-be-measured spectacle frame is processed to generate a gray image, and then the gray image is smoothed based on a Gaussian filter, that is, a template or convolution, mask scanning is performed on each pixel in the image, the weighted average gray value of the pixels in the neighborhood determined by the template is used to replace the value of the center pixel point of the template, so as to remove the image noise. After the image of the to-be-tested spectacle frame is collected in the S2 image information acquisition process, the image needs to be preprocessed, that is, the edge contour of the gray image of the spectacle frame after denoising is extracted, and this step is realized based on a Canny edge detection operator and includes the following steps: through Gaussian filtering, the gray values of a pixel point to be filtered and its domain points are weighted and averaged according to the parameter rules generated by a Gaussian formula, the high-frequency noise superimposed in the to-be-tested image is filtered out, a gradient operator is used to calculate the gradient strength and direction of each pixel point in the image, a non-maximum suppression operation is applied to the image edge based on the gradient amplitude and gradient direction obtained, most of the non-edge points are removed, and a double-threshold detection is applied, the edge pixels with a gradient value higher than a high threshold value are marked as strong edge pixels, the edge pixels with a gradient value less than the high threshold value and greater than a low threshold value are marked as weak edge pixels, and the edge pixels with a gradient value less than the low threshold value are suppressed, and finally the detection of all edge information of the to-be-tested spectacle frame image is completed through the suppression of isolated weak edges. After the image of the to-be-tested spectacle frame is collected in the S2 image information acquisition process, the image needs to be preprocessed, that is, the edge contour of the gray image of the spectacle frame after denoising is extracted, and this step is realized based on a Canny edge detection operator and includes the following steps: through Gaussian filtering, the gray values of a pixel point to be filtered and its domain points are weighted and averaged according to the parameter rules generated by a Gaussian formula, the high-frequency noise superimposed in the to-be-tested image is filtered out, a gradient operator is used to calculate the gradient strength and direction of each pixel point in the image, a non-maximum suppression operation is applied to the image edge based on the gradient amplitude and gradient direction obtained, most of the non-edge points are removed, and a double-threshold detection is applied, the edge pixels with a gradient value higher than a high threshold value are marked as strong edge pixels, the edge pixels with a gradient value less than the high threshold value and greater than a low threshold value are marked as weak edge pixels, and the edge pixels with a gradient value less than the low threshold value are suppressed, and finally the detection of all edge information of the to-be-tested spectacle frame image is completed through the suppression of isolated weak edges. In the S3 spectacle frame horizontal and vertical size acquisition process, the horizontal and vertical size information of the inner edge contour of the spectacle frame is obtained based on the length pixel number and width pixel number of the minimum tangent rotating circumscribed rectangle containing the inner edge contour of the spectacle frame and the pixel proportion k of the quantitative degree unit. In the S4 spectacle frame groove size acquisition process, the spectacle frame groove width size information is obtained based on the pixel coordinate arithmetic mean value of the inner edge contour of the spectacle frame and the upper and lower extreme points of the inner edge contour of the spectacle frame and the pixel proportion coefficient k of the pixel equivalent calibration. In the S5 information supplement process, the restoration of the inner edge contour of the spectacle frame is based on the assumption that the groove width of each part of the spectacle frame is consistent, the inner kernel size is adjusted in the morphological processing process, appropriate parameters are screened to maximize the restoration of the profile information of the blocked part under the premise of not affecting the profile detection, for the missing part of the spectacle frame profile information, the pixel information is supplemented from the reliable edge contour of the outer contour to the missing inner contour direction edge according to the measured groove width pixel number of the spectacle frame, and the missing part of the profile is fitted with a high-order curve to complete the restoration of the inner edge contour of the spectacle frame.
Citation Information
Patent Citations
Method for detecting geometrical parameters of spectacle frame
CN103217108A