A method and system for evaluating a motion eyewear dimming film based on visual detection
By obtaining positioning maps and unified lens coordinates during the evaluation of the light-adjusting film on sports glasses, the problem of unstable visual information caused by clamping deviation and changes in viewing angle was solved, thus achieving the accuracy and objectivity of the evaluation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN PENGYIFA PRECISION MOLD
- Filing Date
- 2026-04-08
- Publication Date
- 2026-07-03
AI Technical Summary
In the evaluation of dimming films for sports glasses, existing technologies suffer from unstable visual information due to clamping deviations and changes in viewing angles, affecting the objectivity and accuracy of the evaluation results.
By acquiring the positioning diagrams of the fixture reference point and the eyeglass to be examined, the clamping offset is determined, and the images are converted to a unified lens coordinate system. The positional changes of candidate abnormal areas are compared, and stability characteristics are marked to ensure the accuracy of the evaluation results.
It effectively eliminates visual information fluctuations caused by clamping deviations and changes in observation angles, improves the objectivity and accuracy of evaluation results, and ensures that visual information accurately reflects the true state of the film.
Smart Images

Figure CN122335784A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sports eyewear manufacturing technology, and more specifically, to a method and system for evaluating the dimming film of sports eyewear based on visual inspection. Background Technology
[0002] In the field of sports eyewear manufacturing, the performance and appearance quality evaluation of the lens dimming film is a crucial step before the finished product leaves the factory, directly affecting the visual experience and quality assessment. Current technology typically involves static visual inspection of sports eyewear after the dimming film has been coated, cured, assembled, and cleaned at the final inspection station. This station generally uses standard fixtures to fix the frame and lenses in predetermined positions, and uses preset standard lighting conditions to maintain the film under inspection in a relatively constant observation posture. Some stations are also equipped with cameras and image acquisition devices to capture and record images of the lens surface, but the final judgment is usually based on the operator's observation of the images or the appearance as seen by the naked eye.
[0003] In this type of inspection, the operator loads the eyeglasses to be inspected into the fixture and checks the appearance of the lens's optical film under normal, oblique, and peripheral viewing angles. The inspection typically includes checking for consistent color depth, uniform color tone across areas, and the presence of visible defects such as whitening, fogging, abnormal reflection, spots, streaks, bubbles, impurities, excess adhesive at the edges, or irregular boundaries. For products with high consistency requirements, it is also necessary to compare the visual performance of the left and right lenses to ensure they are similar. Current technology uses visual observation results directly as the basis for acceptance or rework determination under these fixed workstation, lighting, and observation conditions.
[0004] However, the premise for the aforementioned existing technology to be effective is that the product under test is stably reset to the preset testing position, so that the observed appearance can accurately reflect the state of the dimming film itself. In actual production, due to factors such as frame size tolerances, slight misalignment of the clamping position, subtle changes in the reset posture, or slight warping of the lens edges, the relationship between the eyeglass under test and the fixed observation axis may deviate. In this case, after repeated clamping or changes in the observation angle, the same product may exhibit slight shifts in the color rendering range, inconsistent brightness and darkness distribution, shifts in the position of local reflections, and a magnified difference in appearance between the left and right lenses.
[0005] In this situation, the acquired images often contain both the true state information of the dimming film and non-essential changes such as brightness shifts and reflection shifts caused by attitude changes. Existing technologies lack mechanisms to compensate for, distinguish, or verify such observational disturbances, and still rely directly on single appearance results to make final inspection judgments. This can easily lead to misjudging changes in observation conditions as changes in the film's state, resulting in visual appearance representations that are insufficient to stably meet the evaluation requirements of the film's true state, thus affecting the objectivity and reproducibility of the inspection results.
[0006] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention
[0007] The purpose of this application is to provide a method and system for evaluating the dimming film of sports glasses based on visual inspection. By correcting the clamping offset and unifying the image coordinates, the method effectively eliminates the fluctuation of visual information caused by clamping deviation and changes in viewing angle, ensuring that the visual information accurately reflects the true state of the film, thereby improving the objectivity and accuracy of the evaluation results.
[0008] This application provides a method for evaluating the dimming film of sports glasses based on visual inspection, the technical solution of which is as follows: Obtain a positioning diagram that includes the fixture reference area and the eyeglass to be examined; Based on the positioning diagram, determine the clamping offset of the eyeglass to be examined relative to the preset standard observation relationship; When it is determined that the clamping offset meets the preset correction conditions, the main frontal view of the eyeglass to be examined and at least one auxiliary view are obtained. Based on the clamping offset, the main front view and auxiliary view are converted to the preset unified lens coordinates respectively; In a unified lens coordinate system, candidate anomaly regions are compared between the main image and the auxiliary image to determine the positional changes of candidate anomaly regions between different images. When the location change state is determined to meet the preset stability conditions, the candidate abnormal region is marked as a valid feature; The evaluation results of the dimming film of the eyeglass under test are determined based on the effective characteristics.
[0009] By correcting the clamping offset and unifying the image coordinates, this solution effectively eliminates visual information fluctuations caused by clamping deviations and changes in observation angles, thereby improving the objectivity and accuracy of the evaluation results.
[0010] Furthermore, this application also proposes that the step of determining the clamping offset of the eyeglass to be examined relative to a preset standard observation relationship, based on the positioning diagram, includes: Identify the fixture reference point, bridge position, and lens boundary in the positioning diagram; Register the fixture reference part, the bridge position and the lens boundary with the corresponding positions in the standard observation relationship; Based on the registration results, determine the translational deviation within the image, the angular deviation within the plane, and the projection distortion. The clamping offset is determined based on the translation deviation within the image, the rotation deviation within the plane, and the projection deformation.
[0011] The above method identifies key features and performs registration, which can accurately quantify the clamping offset and provide a reliable basis for subsequent image correction.
[0012] Furthermore, this application also proposes that the step of determining whether the clamping offset meets the preset correction conditions includes: The clamping offset score is calculated based on the translation deviation within the image, the rotation angle deviation within the plane, and the projection distortion, as well as the corresponding allowable correction range. The completeness of boundary recognition is determined based on the matching results between the lens boundary and the corresponding lens boundary in the standard observation relationship. The reprojection error is determined based on the residual after the lens boundary is registered to the standard position; When the clamping offset score is not greater than the first threshold, the boundary recognition integrity is not lower than the second threshold, and the reprojection error is not greater than the third threshold, the clamping offset is determined to meet the preset correction conditions. When the clamping offset score is greater than the first threshold, the boundary recognition integrity is lower than the second threshold, or the reprojection error is greater than the third threshold, the current clamping relationship is output as not meeting the evaluation conditions.
[0013] The above scheme comprehensively evaluates the clamping offset using multi-dimensional indicators, ensuring the accuracy and reliability of the correction conditions and avoiding invalid evaluations.
[0014] Furthermore, this application also proposes a step of converting the orthogonal main image and auxiliary image to a preset unified lens coordinate system based on the clamping offset, including: Extract the boundary control points of the left and right lenses in the main and auxiliary images respectively; Using the lens boundary control points corresponding to the standard observation relationship as target points, establish a mapping relationship between the current image and the unified lens coordinates; Based on the mapping relationship, the left and right lenses in the main and auxiliary images are mapped to the corresponding unified lens coordinate regions respectively; Also includes: Perform a mirror flip on one of the lenses converted to a unified lens coordinate system; Align one side of the mirrored lens with the corresponding area of the other side in a unified lens coordinate system.
[0015] By establishing a precise mapping relationship and aligning the left and right lenses, this scheme enables a unified comparison between different images and the left and right lenses, thereby improving the consistency of the evaluation.
[0016] Furthermore, this application also proposes that the steps for determining whether the position change state satisfies a preset stability condition include: Determine the region masks of candidate anomaly regions in the main image and auxiliary image; Based on the region mask, determine the occurrence ratio and overlap ratio of candidate anomaly regions in different images; The location drift is determined based on the region center position of the candidate anomaly region in different images; When the ratio is not lower than the first set value, the overlap ratio is not lower than the second set value, and the position drift is not higher than the third set value, it is determined that the position change state meets the preset stability conditions. When the ratio is lower than the first set value, the overlap ratio is lower than the second set value, or the position drift is higher than the third set value, the candidate abnormal region is marked as an unstable region.
[0017] The above scheme uses multiple indicators to comprehensively judge the stability of candidate abnormal regions, effectively distinguishes between real defects and occasional visual noise, and improves the accuracy of defect identification.
[0018] Furthermore, this application also proposes a step for determining the evaluation result of the dimming film of the eyeglass under examination based on effective features, including: According to the preset division of the lens surface area, the coverage rate of valid evidence corresponding to the valid features in each lens surface area is calculated. When the effective evidence coverage of any lens surface area is lower than the corresponding predetermined requirement, the current assessment is terminated and a prompt for supplementary sampling or re-clamping is output. When the effective evidence coverage of each lens surface area is not lower than the corresponding predetermined requirement, the evaluation result is determined based on the color distribution and position distribution of the effective features.
[0019] The above scheme uses regional coverage to determine the adequacy of the assessment and determines the final assessment result based on the distribution of effective features, thus ensuring the comprehensiveness and reliability of the assessment.
[0020] Furthermore, this application also proposes that, after converting the emphyseal main image and auxiliary image to a unified lens coordinate system, it further includes: Acquire grayscale reference block information on the fixture and illumination field correction map obtained in advance based on empty fixture calibration; Based on the grayscale reference block information, exposure and color corrections are performed on the converted front view main image and auxiliary image; Based on the illumination field correction diagram, the brightness and color of the corrected main and auxiliary front view diagrams are normalized.
[0021] The above-described scheme, by introducing grayscale reference blocks and illumination field correction maps, further corrects the exposure, color, and brightness of the image, thereby improving image quality and the accuracy of evaluation.
[0022] Furthermore, this application also proposes a step for extracting candidate anomaly regions in unified lens coordinates, including: In the preset color space, calculate the color difference between the current color at each position and the preset reference color, and when the color difference exceeds the allowable threshold at the corresponding position, determine the candidate point of color anomaly; Calculate the mean and standard deviation of color values within a local window, and identify candidate regions for uniformity anomalies when the mean deviates from a preset baseline mean or the standard deviation exceeds a statistical threshold; Calculate the contrast gradient of the local area, and determine the contrast decrease index based on the current contrast gradient and the preset benchmark gradient. When the contrast decrease index is higher than the preset threshold, determine the candidate area of fogging abnormality. Search for the current edge position along the preset standard boundary direction, and determine the edge anomaly candidate region when the edge offset or edge gradient meets the anomaly condition; The candidate regions for color anomalies, uniformity anomalies, fogging anomalies, and edge anomalies are merged to obtain the candidate anomaly regions.
[0023] Through the above approach, this method comprehensively identifies different types of potential defects by using various visual feature extraction methods, thereby improving the detection rate of candidate abnormal regions.
[0024] Furthermore, this application also proposes that the step of determining the evaluation result of the dimming film of the eyeglass under examination based on the effective features further includes: Compare the deviation directions of the main image and auxiliary image at the same position in the same lens coordinate system relative to the preset reference value point by point; When the same location consistently shows the same deviation in multiple images, mark that location as a pixel-level stable point and mark the remaining locations as unstable points. Generate a pixel-level stable map based on pixel-level stable points; When calculating the uniformity of different regions of the same lens or comparing the consistency of corresponding regions of the left and right lenses, only pixel-level stable points in the pixel-level stable map are used for calculation, and positions marked as unstable points are excluded.
[0025] By introducing pixel-level stabilizing points, this approach further eliminates the impact of image noise and uncertainties on the evaluation results, thereby improving the robustness of the evaluation.
[0026] Furthermore, this application also proposes that, after determining the evaluation result of the dimming film of the eyeglass under examination based on the effective features, it further includes: When the severity or area of the defect corresponding to the assessment result is within the preset critical range, a re-inspection instruction is output, and the eyeglass to be inspected is prompted to be re-clamped. Obtain the new positioning image, new front view main image, and new auxiliary image after re-clamping. Determine the clamping offset after re-clamping based on the new positioning image. When the clamping offset after re-clamping meets the preset correction conditions, redetermine the valid features for re-inspection based on the new front view main image and new auxiliary image. Compare the positions of the effective features from the re-examination and the effective features from the initial assessment in a unified lens coordinate system to determine the overlap ratio. When the overlap ratio is higher than the preset re-inspection and confirmation threshold, the corresponding abnormality is confirmed as a dimming film defect; When the overlap ratio is not higher than the re-inspection confirmation threshold, a re-inspection prompt will be output.
[0027] The above approach introduces a re-inspection mechanism, which further verifies the authenticity of the defect through multiple clamping and comparison, reducing the false judgment rate.
[0028] Furthermore, this application also proposes that, before extracting candidate anomaly regions in unified lens coordinates, the following steps are also included: Based on the residual distribution of each lens boundary control point mapped to the unified lens coordinates in the main and auxiliary front view, the local mapping error of multiple local areas in the unified lens coordinates is determined. When the local mapping error of any local region exceeds the fourth threshold, the local region is marked as a region where the mapping error exceeds the limit. When extracting candidate anomaly regions and determining the positional change status of candidate anomaly regions, candidate points or candidate regions that fall into the mapping error exceeding the limit are excluded. When determining the evaluation results of the dimming film of the eyepiece under inspection based on the effective features, a supplementary sampling prompt is output for the area where the mapping error exceeds the limit.
[0029] By assessing local mapping errors, this approach identifies and eliminates inaccurately mapped areas, avoiding misjudgments caused by mapping errors and providing supplementary sampling prompts, thereby improving the reliability of the assessment.
[0030] Furthermore, this application also proposes a step of outputting a prompt for re-sampling or re-clamping when the effective evidence coverage of any lens surface area is lower than the corresponding predetermined requirement, including: Based on the location distribution of candidate anomaly regions that do not meet the stability condition in the unified lens coordinates and the corresponding location change status, the target supplementary sampling angle is determined from multiple preset supplementary sampling angles. Obtain the replenishment image from the target replenishment perspective; The supplementary images are converted to a unified lens coordinate system, and the positional changes of candidate anomaly regions are redefined in the unified lens coordinate system. The effective features and effective evidence coverage are updated based on the candidate anomaly regions that meet the stability conditions after redetering. If the updated valid evidence coverage is still lower than the corresponding predetermined requirement, a re-clamping prompt will be output.
[0031] Through the above approach, this solution provides an intelligent supplementary acquisition mechanism that specifically acquires missing information, reduces unnecessary re-clamping, and improves evaluation efficiency.
[0032] Furthermore, this application also proposes a visual detection-based evaluation system for dimming films on sports glasses, comprising: The first module is used to obtain a positioning diagram that includes the reference part of the fixture and the eyeglass to be examined; The second module is used to determine the clamping offset of the eyeglass to be examined relative to the preset standard observation relationship based on the positioning diagram; The third module is used to obtain the frontal main image and at least one auxiliary image of the eyeglass to be examined when it is determined that the clamping offset meets the preset correction conditions. The fourth module is used to convert the main front view and auxiliary view to a preset unified lens coordinate system based on the clamping offset. The fifth module is used to compare candidate abnormal regions in the main image and auxiliary image in a unified lens coordinate system, and to determine the positional change status of the candidate abnormal regions between different images. The sixth module is used to mark candidate abnormal regions as valid features when the determined position change state meets the preset stability conditions; The seventh module is used to determine the evaluation results of the dimming film of the eyeglass under examination based on the effective features.
[0033] Through the above scheme, this system, with its modular design, achieves automated and efficient execution of the aforementioned evaluation methods, thereby improving the detection efficiency and accuracy on the production line.
[0034] As can be seen from the above, the sports glasses dimming film evaluation method and system provided in this application, based on visual inspection, obtains a positioning image, determines and corrects the clamping offset, converts the image to a unified lens coordinate system, compares candidate abnormal regions in different images and determines their stability, and finally marks effective features and determines the evaluation result. This effectively solves the problem of unstable visual information caused by clamping deviation and changes in observation conditions in the prior art, ensuring the objectivity and accuracy of the evaluation result. It has the advantages of effectively eliminating visual information fluctuations caused by clamping deviation and changes in observation angle by correcting the clamping offset and unifying the image coordinates, ensuring that the visual information accurately reflects the true state of the film, thereby improving the objectivity and accuracy of the evaluation result. Attached Figure Description
[0035] Figure 1 A flowchart of a method for evaluating the dimming film of sports glasses based on visual inspection, provided in this application.
[0036] Figure 2 This is a schematic diagram of a visual inspection-based evaluation system for sports glasses dimming film provided in this application.
[0037] In the diagram: 1. Module 1; 2. Module 2; 3. Module 3; 4. Module 4; 5. Module 5; 6. Module 6; 7. Module 7. Detailed Implementation
[0038] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. The components of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0039] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0040] In the manufacturing process of sports glasses, the performance and appearance quality assessment of the lens dimming film is a crucial step before the finished product leaves the factory, and its results are directly related to the final visual experience and market compliance of the product. Current assessment technologies are typically deployed at fixed stations before finished products leave the factory for static inspection. After a pair of sports glasses completes a series of processes such as coating, curing, assembly, and surface cleaning of the lens dimming film, the entire product is sent to the final inspection station for final appearance confirmation.
[0041] In such a scenario, the final inspection station is typically located in a testing space with relatively stable lighting and temperature. A standard fixture is set up in front of the workbench, designed to precisely fix the frames and lenses of the sports glasses in a uniform position. The purpose is to ensure that the dimming film under inspection is always in a relatively constant viewing posture. Above or to the side of the station, uniform standard lighting devices are installed, such as diffuse white light sources, ring lights, or inspection lights with pre-set angles according to factory inspection specifications. The intensity, direction of illumination, and viewing distance of these lighting devices are usually strictly preset to ensure that different batches of products can undergo visual inspection under exactly the same conditions.
[0042] However, this inspection method, which relies on the precise positioning of the fixture and the stable alignment of the frontal observation axis, is based on a fundamental assumption: that each product to be inspected can be accurately reset to the preset ideal inspection position. Only when this assumption is true can the appearance characteristics obtained through visual inspection be considered to directly reflect the true state of the dimming film.
[0043] In actual production operations, this ideal assumption is often challenged. The product to be inspected may deviate from the fixed observation axis due to the dimensional tolerance of the frame itself, slight positional eccentricity caused by the operator when holding the glasses, subtle changes in posture when the product is reset, or even slight warping of the lens edge due to stress or heat treatment.
[0044] When this deviation occurs, the previously considered stable and reliable testing environment begins to become unstable. In this scenario, even the same product, after being repeatedly placed in the fixture, or even just after changing the viewing angle, may exhibit slight shifts in the color rendering range, inconsistencies in the distribution of light and dark areas between two observations, shifts in the position of localized reflections, and abnormally magnified visual differences between the left and right lenses. At this point, the operator's first perception is not of a clear, locatable defect itself, but rather that the current appearance can no longer be directly used as a stable and reliable final inspection characteristic as before.
[0045] The instantaneous image information acquired by visual inspection undergoes non-essential changes due to fluctuations in observation conditions. This leads to a contradiction between the observed appearance and the true state required for evaluation, resulting in insufficient information carrying capacity. Existing technologies mainly rely on static visual capture at fixed workstations, lacking an effective mechanism to compensate for or identify visual information fluctuations caused by individual product differences or minor clamping deviations. This makes it uncertain whether the acquired visible information is sufficient to support the final evaluation, ultimately affecting the objectivity and reproducibility of the inspection results.
[0046] To address this technical problem, this application provides a vision-based method for evaluating the dimming film of sports glasses. The core idea of this method is to insert a dedicated visual verification and correction process between the traditional clamping completion and appearance evaluation. First, the actual observation relationship after clamping is confirmed. Then, the subsequently acquired images are converted to a standard observation relationship pre-set at the workstation. Finally, only the appearance information that can still exist stably under this standard relationship is used for the final evaluation.
[0047] Specifically, refer to Figure 1 This application proposes a method for evaluating the dimming film of sports glasses based on visual detection, the method comprising: S110. Obtain a positioning diagram that includes the fixture reference part and the eyeglass to be inspected; S120. Based on the positioning diagram, determine the clamping offset of the eyeglass to be examined relative to the preset standard observation relationship; S130. When it is determined that the clamping offset meets the preset correction conditions, obtain the frontal main image of the eyeglass to be examined and at least one auxiliary image. S140. Based on the clamping offset, convert the main front view and auxiliary view to the preset unified lens coordinates respectively; S150. In a unified lens coordinate system, compare the candidate abnormal regions in the main image and the auxiliary image to determine the positional change status of the candidate abnormal regions between different images. S160. When the location change state meets the preset stability conditions, the candidate abnormal region is marked as a valid feature. S170. Determine the evaluation results of the dimming film of the eyepiece under examination based on the effective characteristics.
[0048] This method is applied to a static inspection process at a fixed workstation before finished products leave the factory. The entire process involves finished sports glasses that have completed all preceding processes, including dimming film coating, curing, assembly, and surface cleaning. This solution adds three key processing steps: clamping relationship verification, standard coordinate conversion, and stability evidence screening, after the operator loads the product into the fixture and before evaluating the dimming film based on the acquired images.
[0049] The final inspection station retains the original fixtures, standard lighting equipment, image acquisition terminal, and display and recording terminal. Based on this, some adaptive modifications have been made to the fixtures, namely, adding image-recognizable reference parts. In a preferred embodiment, these reference parts include four high-contrast positioning marks and two grayscale reference blocks. The four positioning marks are respectively arranged in the upper left, upper right, lower left, and lower right areas of the fixture, and their design ensures that these marks remain clearly visible in subsequent positioning images after the frame is installed in the fixture. The two grayscale reference blocks are set to standard medium gray and bright gray, respectively, and their function is to provide a stable reference for subsequent exposure and color correction each time an image is acquired.
[0050] The image acquisition section includes at least one main frontal camera for acquiring the main frontal view. To achieve subsequent stability screening, at least one auxiliary image is also required. This can be achieved by adding a fixed oblique auxiliary camera, with the viewing angle between the auxiliary camera and the main frontal camera preferably set between 8 and 15 degrees. If the on-site installation conditions do not facilitate the installation of a second camera, another method can be used: the same camera is positioned at a fixed station, and a robotic arm or rotary table is controlled to continuously acquire the frontal view and the auxiliary image at a known deflection angle. However, this method may slightly reduce the cycle time of online detection.
[0051] The process is typically executed by an industrial computer, which pre-stores a model library, standard observation relationship data, threshold tables for various judgments, and historical inspection records. The display and recording terminal is responsible for issuing instructions to the operators, such as prompting them to re-clamp, re-acquire images, or re-inspect, or displaying the final judgment result, and writing the data, including evidence images and evaluation results, into the factory's quality management system.
[0052] Before the official online testing begins, a standard observation relationship database needs to be established for each model of sports glasses. The database creation process is as follows: First, select 10 to 20 qualified samples of the same model that have been confirmed to be defect-free. Following the standard operating procedures of the workstation, place these samples sequentially into the fixture. At this point, the lighting parameters, camera parameters, and observation distance are all fixed, and during subsequent online inspection, the camera's automatic exposure, automatic white balance, and automatic focus functions are not allowed to drift freely to ensure a consistent inspection environment.
[0053] For each sample, firstly, a positioning image including fixture markings, the complete frame outline, and the left and right lenses is acquired. Then, a frontal main image and an auxiliary image are acquired. These acquired images are analyzed to extract the following key information: the coordinates of the center points of the four positioning marks on the fixture; the center position of the lens bridge; the complete outer outline of the frame; the precise boundaries of the left and right lenses; and a series of control points distributed along the boundaries of the left and right lenses. These control points are preferably selected evenly along the boundaries of each lens, with 16 or 24 points, and their number and location must ensure that they at least cover the upper edge, lower edge, inner edge, outer edge of the lens, and all areas with significant transitions and bends.
[0054] During database construction, the data from multiple qualified samples are statistically processed, for example, using median synthesis, to obtain more representative standard observation relationships for each model. This standard observation relationship database should include at least the following: the standard positions of the fixture markings in the camera image; the standard positions of the lens bridge center and the lens frame outline; the standard positions of the control points of the left and right lens boundaries; the unified coordinate system of the lens surface corresponding to the front view and auxiliary view respectively; and the region division results for each lens.
[0055] The standard observation relationship refers to a multidimensional reference dataset pre-stored in the database, which includes the spatial coordinates of the fixture reference mark under ideal imaging conditions, the geometric contour parameters of the lens frame under standard clamping pose, and the theoretical projection templates of the lens edge under normal and oblique viewing angles. This dataset provides an absolute geometric reference for subsequent registration and offset calculation.
[0056] For zone division, each lens can be divided into a central zone, a transition zone, an edge ring zone, and a frame adjacent zone. This division helps in subsequent targeted evaluation: the central zone is mainly used to observe the overall color rendering effect and light transmission performance; the transition zone is used to evaluate the uniformity of color and brightness; the edge ring zone is used to check whether the edge transition is smooth and whether there is any glue overflow; and the frame adjacent zone is used to determine whether the boundary is neat and whether there are any local abnormalities.
[0057] While building the database, it's also necessary to establish appearance benchmarks. Specifically, this involves mapping the front views and auxiliary images of all qualified samples to a unified lens coordinate system using coordinate conversion. Then, the average color value, color fluctuation range, local texture range, and edge transition range for each preset region are statistically analyzed. For the color space, the Lab color space can be used because it's more suitable for judging color depth and color difference compared to directly using RGB values. For each pixel (u,v) in the unified lens coordinate system, the benchmark colors L0(u,v), a0(u,v), and b0(u,v) of the qualified sample are recorded. For each region, the average color value, standard deviation, and allowable deviation range are recorded. For edge ring regions, the position and gradient distribution of the standard edge also need to be recorded. This data will be used to subsequently determine whether there is whitening at the lens edge, color abrupt changes, or irregular boundaries.
[0058] Furthermore, during the database construction phase, it is necessary to set the allowable correction range for clamping relationships for each model. This range should at least include the allowable translation deviation values Tx and Ty within the image, the allowable angular deviation value Tθ within the plane, and the projection distortion threshold Tk caused by forward and backward tilting. These thresholds should be determined statistically from the repeated clamping test data of the database construction samples. The usual practice is to repeatedly clamp the same qualified sample 5 to 10 times, calculate the distribution of offset generated during each clamping, and then take the upper limit of the distribution with a certain safety margin as the correctable correction range for that model.
[0059] Before each production shift begins, or after replacing critical components such as light sources or cameras, the workstation needs to perform an empty fixture calibration and a grayscale reference calibration. The purpose of the empty fixture calibration is to obtain the illumination field correction maps Fmain(x,y) and Faux(x,y) corresponding to the main image acquisition channel and auxiliary image acquisition channel under the current lighting environment. These correction maps record the spatial non-uniformity of the illumination field. The grayscale reference calibration is to confirm whether the current illuminance and color response are still within the permissible range. If the current reading of the grayscale reference block deviates significantly from the baseline value during library creation, the formal inspection process will not proceed. Instead, the operator will be prompted to preheat the light source, clean the reference block, or recalibrate the color. This is to ensure that any subsequent calculations of color difference and uniformity anomalies are not caused by light drift or changes in camera response.
[0060] Through the above series of preparatory work, the method proposed in this application can effectively truncate the problem transmission relationship that directly transforms minute clamping offsets into appearance changes, and further into drift in final inspection conclusions.
[0061] First, the positioning map is used to quantify whether the current clamping state has returned to the preset standard observation relationship, and the image is directly intercepted when the offset exceeds the correctable range. This avoids the problem of continuing to make hard judgments when the clamping has already deviated and the image has changed, thus blocking images that do not meet the premise of stable observation from entering the evaluation process.
[0062] Secondly, by converting both the main and auxiliary images to the same lens surface coordinate system, it is ensured that subsequent comparisons are performed within the same surface area. The slight shifts in color rendering position and inconsistencies in brightness distribution caused by minute pose deviations are largely eliminated after conversion to a unified lens coordinate system, thus re-establishing a reliable basis for comparison between the same areas.
[0063] Furthermore, by judging the consistency of multiple views, phenomena such as reflections, bright spots, and brightness drift that move with changes in the observation relationship are eliminated, retaining only image evidence that is fixed on the lens surface and can consistently point to the state of the dimming film itself. This ensures that the final conclusion is no longer based on unprocessed instantaneous appearance, but on valid evidence obtained after confirming the clamping relationship, unifying coordinates, and screening for stability.
[0064] Specifically, when determining the clamping offset of the eyeglass to be examined relative to the preset standard observation relationship based on the positioning diagram, the steps include: Identify the fixture reference location, lens bridge position, and lens boundary in the positioning diagram; register the fixture reference location, lens bridge position, and lens boundary with the corresponding positions in the standard observation relationship; determine the in-image translation deviation, in-plane rotation deviation, and projection distortion based on the registration results; determine the clamping offset based on the in-image translation deviation, in-plane rotation deviation, and projection distortion.
[0065] The operator first scans the product number and model information, then retrieves the corresponding standard observation relationship, region template, and threshold table from the database. Next, the operator places the sports glasses into the clamp and secures them. At this point, the camera is triggered to capture a positioning image.
[0066] The positioning map is preprocessed by using the calibrated illumination field correction map and the grayscale reference block information on the fixture to perform illumination field correction and grayscale correction on the positioning map, so as to ensure that the positioning maps collected at different times are all on a uniform brightness basis.
[0067] In the preprocessed positioning map, the center points of the four positioning marks on the fixture are identified, and the outline of the frame, the center position of the bridge, and the boundaries of the left and right lenses are extracted. The positioning marks can be accurately identified using algorithms such as threshold segmentation and circle center fitting; the frame outline and lens boundaries can be obtained through edge detection, contour tracking, and subsequent arc or spline curve fitting.
[0068] The clamping marks, bridge center, and lens boundary control points identified in the current positioning map are matched with their corresponding points stored in the standard observation relation database. Through this registration process, the geometric transformation parameters describing the current clamping state relative to the standard observation relation can be solved.
[0069] Based on the transformation parameters obtained from registration, the specific offset is determined. These transformation parameters can be represented as a two-dimensional projection transformation matrix H. For easier online assessment, this transformation matrix H can be decomposed into more intuitive physical quantities: translational deviations Δx and Δy within the image, angular deviations Δθ within the plane, and a comprehensive projection distortion Kp. This projection distortion Kp characterizes the projection changes caused by the glasses' forward / backward tilt, left / right skewing, or slight warping of the lenses themselves. In engineering implementation, it is sufficient to quantify how much the current image has deviated from the standard viewing relationship.
[0070] Furthermore, when determining that the clamping offset meets the preset correction conditions, the steps include: The clamping offset score is calculated based on the translational deviation, angular deviation, and projection distortion within the image, as well as the corresponding allowable correction range. The boundary recognition integrity is determined based on the matching result between the lens boundary and the corresponding lens boundary in the standard observation relationship. The reprojection error is determined based on the residual after the lens boundary is registered to the standard position. When the clamping offset score is not greater than the first threshold, the boundary recognition integrity is not lower than the second threshold, and the reprojection error is not greater than the third threshold, the clamping offset is determined to meet the preset correction conditions. When the clamping offset score is greater than the first threshold, the boundary recognition integrity is lower than the second threshold, or the reprojection error is greater than the third threshold, the current clamping relationship is output as not meeting the evaluation conditions.
[0071] Specifically, in the positioning map processing, in addition to calculating the offset, it is also necessary to determine whether the current clamping relationship meets the conditions for continuing the evaluation based on these offsets and the error of the boundary fitting.
[0072] During online assessment, a weighted scoring formula can be used to calculate the clamping offset score, Dpose. For example, Dpose = w1×|Δx| / Tx + w2×|Δy| / Ty + w3×|Δθ| / Tθ + w4×Kp / Tk. Here, Δx is the lateral translation deviation within the image relative to the standard viewing relationship of the current eyeglass; Δy is the longitudinal translation deviation within the image relative to the standard viewing relationship of the current eyeglass; Δθ is the in-plane angular deviation of the current eyeglass relative to the standard viewing relationship of the current eyeglass; Kp is the projection distortion of the current eyeglass relative to the standard viewing relationship, used to characterize the projection changes caused by forward / backward tilt, left / right skew, or slight lens warping; Tx is the upper limit of allowable values corresponding to Δx; Ty is the upper limit of allowable values corresponding to Δy; Tθ is the upper limit of allowable values corresponding to Δθ; Tk is the upper limit of allowable values corresponding to Kp; and w1 to w4 are the weights of each item, satisfying w1+w2+w3+w4=1. If the calculated Dpose value is greater than 1, it means that the current clamping offset has exceeded the range that the system can stably correct. The clamping offset score is a comprehensive quantitative index, which is obtained by weighted summation of translational deviation, rotational deviation and projection deformation. This score reflects the degree to which the current clamping state deviates from the standard observation relationship and is used to determine whether geometric correction is required by the algorithm or whether unqualified clamping actions should be directly intercepted.
[0073] Besides the clamping offset score (Dpose), two other metrics need to be considered: boundary recognition integrity (Cedge) and reprojection error (Er). Boundary recognition integrity (Cedge) is defined as the ratio of the effective boundary length of the currently identified lens to the boundary length that should exist in the standard template. Reprojection error (Er) is defined as the average residual between the currently identified boundary control points, after being transformed to the standard position using calculated transformation parameters, and the corresponding points in the standard position. If Cedge is below a preset threshold, or Er is above a preset threshold, it indicates that the acquired positioning map itself cannot stably represent the actual position and shape of the lens.
[0074] In one specific implementation, after acquiring a positioning map including the fixture reference area and the eyeglass to be examined, four high-contrast positioning marks and the center of the eyeglass bridge are identified in the positioning map. By comparing the current pixel coordinates of these feature points with the theoretical coordinates stored in the standard observation relationship, a transformation matrix describing the current pose deviation is derived. This transformation matrix is specifically decomposed into horizontal translation, vertical translation, and planar rotation angle. In one application scenario, if the eyeglass to be examined experiences a slight forward or backward tilt due to fixture wear, the projection distortion will increase significantly. A clamping offset score is calculated based on preset weighting coefficients. When the score is between 0.8 and 1.0, it is determined that the correction condition is met, and subsequent processes will use this offset to perform geometric compensation on the image. If the score exceeds 1.0, the display terminal will immediately issue a red warning, prompting the operator to check the fixture status or reposition the eyeglass, thereby ensuring the validity of the test data at the source.
[0075] After the positioning map is processed, if the clamping offset score (Dpose) exceeds the limit, the boundary recognition integrity (Cedge) is too low, or the reprojection error (Er) is too large, the processing unit will directly output the conclusion that the current clamping relationship does not meet the evaluation conditions. At this time, the display terminal will indicate the direction and type of offset, such as indicating that the outer side of the left lens is too high, the entire pair of glasses is rotated clockwise, or the boundary recognition of the right lens is incomplete. In this case, the subsequent dimming film qualification judgment will not proceed, and the current result will not be recorded as a film abnormality, but only as a clamping abnormality, prompting the operator to reposition or re-clamp the glasses.
[0076] Similarly, if the geometric relationship is deemed satisfactory, but image quality issues such as blurriness, overexposure, underexposure, or partial occlusion are detected in the positioning image, the processing unit will output a conclusion that the current image does not meet the evaluation criteria and prompt for re-image acquisition. In this case, the dimming film assessment will not be performed. Only when both the geometric relationship and image quality simultaneously meet the preset requirements will the subsequent acquisition of the main and auxiliary images be triggered. To minimize the impact of slight product movement between acquisitions, the acquisition of the main and auxiliary images is preferably completed quickly within the same trigger window.
[0077] Furthermore, after obtaining qualified emphyseal master image and auxiliary image, it is necessary to convert the emphyseal master image and auxiliary image to a preset unified lens coordinate system according to the clamping offset. The steps include: The boundary control points of the left and right lenses are extracted in the main and auxiliary images. Using the corresponding lens boundary control points in the standard viewing relationship as target points, a mapping relationship between the current image and unified lens coordinates is established. Based on this mapping relationship, the left and right lenses in the main and auxiliary images are mapped to their corresponding unified lens coordinate regions. Furthermore, the process includes mirroring one of the lenses converted to unified lens coordinates and aligning the mirrored lens with the corresponding region of the other lens in the unified lens coordinates.
[0078] Because sports glasses lenses typically have complex curved surfaces, simply using a rectangular cropping method cannot guarantee that the same pixel location in the image accurately corresponds to the same surface area on the lens. Therefore, a nonlinear mapping method based on boundary control points is used for coordinate transformation.
[0079] First, using the clamping relationship obtained from the positioning map as initial values, the positions of the lens boundary control points are re-established in the main and auxiliary frontal views. Then, using the control points stored in the standard observation relation database as target points, a mapping table from the current image coordinates to standard lens coordinates is established. Algorithms such as piecewise affine interpolation or thin-plate spline interpolation can be used to map the curved lens surface in the current image onto a planar, unified coordinate system. The unified lens coordinate system is a normalized two-dimensional coordinate system that unfolds the three-dimensional curved lens surface onto a plane through a nonlinear mapping function. In this coordinate system, each coordinate point uniquely corresponds to a physical position on the lens surface, ensuring that pixel information from different camera viewpoints can be aligned and compared on the same physical reference.
[0080] After conversion, each lens is transformed into a standard coordinate graph of a fixed size, such as a 512×512 pixel image. To facilitate subsequent comparison of the consistency between the left and right lenses, the right lens is usually mirrored after the conversion. After this process, corresponding areas of the left and right lenses under the same coordinate system, such as the nasal side area of the left and right glasses, can be directly compared and correspond one-to-one.
[0081] In a preferred embodiment, after converting the main front view image and the auxiliary image to a unified lens coordinate system, the method further includes obtaining grayscale reference block information on the fixture and an illumination field correction map pre-calibrated based on an empty fixture; performing exposure correction and color correction on the converted main front view image and auxiliary image based on the grayscale reference block information; and performing brightness normalization and color normalization on the corrected main front view image and auxiliary image based on the illumination field correction map.
[0082] Specifically, after the coordinate transformation is completed, the main image and auxiliary image need to be normalized in terms of brightness and color using the grayscale reference block on the fixture and the illumination field correction map obtained during pre-shift calibration. The normalized images are then converted to the Lab color space, ultimately yielding standardized color maps Lk(u,v), ak(u,v), and bk(u,v) for each view and each lens. This series of processes ensures that subsequent analysis is based on stable, consistent color data that is strongly correlated with physical properties.
[0083] In a unified lens coordinate system, candidate anomaly regions need to be compared between the main image and the auxiliary image to determine the positional changes of these regions across different images. The steps for determining whether the positional changes satisfy a preset stability condition include: Determine the region mask of the candidate anomaly region in the main image and auxiliary image; based on the region mask, determine the occurrence ratio and overlap ratio of the candidate anomaly region in different images; based on the region center position of the candidate anomaly region in different images, determine the position drift amount; when the occurrence ratio is not lower than a first set value, the overlap ratio is not lower than a second set value, and the position drift amount is not higher than a third set value, determine that the position change state meets the preset stability condition; when the occurrence ratio is lower than the first set value, the overlap ratio is lower than the second set value, or the position drift amount is higher than the third set value, mark the candidate anomaly region as an unstable region.
[0084] Having already converted the images from different views to a unified lens coordinate system, the next core task is to determine whether the candidate anomalous regions observed in the images are genuine anomalies fixed on the lens surface, or merely surface phenomena caused by changes in the observation axis, reflections, and minor pose variations. The stability condition is a set of logical criteria used to distinguish between physical defects and optical interference. It is measured by calculating the proportion of candidate anomalous regions appearing across multiple images, their overlap ratio, and the amount of positional drift. When anomaly features maintain a fixed position and consistent shape across multiple viewpoints, they are deemed to meet the stability condition, thus eliminating false reflections or environmental noise that move with changing viewpoints.
[0085] For any candidate region r, the processing unit extracts the mask and a series of features of the corresponding region from the main image and all auxiliary images, forming a region feature group Fk(r). This region feature should at least include: whether the region appears in the current view, the area of the region, the center position of the region, the average color difference within the region, the average brightness deviation, the haze index, and the edge offset, etc.
[0086] Then, based on these characteristics, three key stability indicators are calculated. The first indicator is the occurrence ratio Pr. If a candidate region appears at the same lens coordinate position in n views out of a total of K views, and the direction of its color deviation, such as being brighter or darker, remains consistent, then its occurrence ratio can be defined as Pr = n / K.
[0087] The second metric is the overlap ratio (OR), which calculates the cross-union ratio (CUI) of the masks for the same candidate region in different views and then takes the average. This metric is a good indicator of whether the region consistently falls on the same surface location. For example, if a bright spot always slides on the lens surface in different views, then the CUI of the mask in different views will be very low.
[0088] The third metric is the positional drift Mr. Assuming the center point coordinates of the same candidate region in various views are ck, and the equivalent diameter of the region is dr, then the positional drift can be defined as Mr = max(|ci-cj|) / dr, which is the ratio of the maximum distance between all pairwise center points to the region diameter. The larger the value of Mr, the more obvious the movement of the region with the change of viewing angle, and its nature is closer to reflection or other observational disturbances.
[0089] During online evaluation, if a candidate region simultaneously meets the following three conditions: its appearance ratio Pr is not lower than a preset value, its overlap ratio Or is not lower than a preset value, and its positional drift Mr is not higher than a preset value, then this region will be identified as a stable region and enter the subsequent evaluation process as valid evidence. Conversely, if a candidate region only appears in a single view, or undergoes significant movement between different views, or its brightness direction reverses back and forth, then it will be identified as an unstable region and added to the exclusion list, and will not be directly used as evidence of defects in the dimming film.
[0090] As a specific implementation method, the coordinate transformation process employs a nonlinear mapping algorithm based on thin-plate spline interpolation. The process first extracts twenty-four control points from the lens edge in the main frontal view and the auxiliary oblique view. Using the corresponding control points in the standard viewing relationship as targets, a mapping function is established from the original image pixel coordinates to the unified lens coordinates. This mapping function projects the curved lens surface onto a 512x512 pixel normalized plane. Under the unified coordinate system, the comparison module performs overlap analysis on candidate abnormal regions in the main and auxiliary images. For example, when detecting sports glasses with a high-reflectivity coating, a bright spot may appear in the main image. If the bright spot's corresponding unified coordinate position in the auxiliary image shifts significantly, resulting in an overlap ratio of less than 30%, the bright spot is determined to be unstable information caused by ambient light reflection. If the region remains within the same coordinate range in images from different viewing angles, and the positional drift is less than one-tenth of the region's diameter, the region is determined to be a physical defect within the dimming film and is marked as a valid feature.
[0091] When determining the evaluation results of the dimming film of the eyeglass under examination based on effective characteristics, the steps include: According to the preset division of the lens surface area, the effective evidence coverage rate corresponding to the effective features in each lens surface area is calculated; when the effective evidence coverage rate of any lens surface area is lower than the corresponding predetermined requirement, the current evaluation is stopped and a prompt for supplementary sampling or re-clamping is output; when the effective evidence coverage rate of each lens surface area is not lower than the corresponding predetermined requirement, the evaluation result is determined according to the color distribution and position distribution of the effective features.
[0092] Once stable and unstable regions are distinguished, a stable appearance data set is generated. This data consists of a processed valid color map under unified coordinates, valid region statistics, and a valid anomaly list. The valid color map is obtained by weighted fusion of stable points from multiple views. The fusion weights can be determined based on the sharpness, reprojection error, and overall image quality of each view. If a coordinate point is determined to be stable in multiple views, its weighted average is taken; if a point has only one stable view, the value from that view is retained; if a point is unstable in all views, it is marked as an invalid point.
[0093] Simultaneously, for each preset lens region, such as the central region, transition region, and edge ring region, its effective evidence coverage (Cov) is calculated individually. This coverage is defined as: Cov = stable effective pixel area / total area of the region. Subsequent quality evaluation processes are only allowed to continue when the effective evidence coverage of a region meets the preset minimum requirement for that region. This is to prevent the processing unit from rigidly assigning a pass or fail conclusion when there is insufficient evidence in a certain area due to reflection, occlusion, or poor boundary recognition. The effective evidence coverage is used to quantify whether the currently acquired image information is sufficient to support a reliable quality conclusion, avoiding the forced output of evaluation results in the presence of large areas of reflection, occlusion, or missing information.
[0094] In one specific implementation, the step of extracting candidate anomaly regions in unified lens coordinates includes: In a preset color space, the color difference between the current color and the preset reference color at each position is calculated. When the color difference exceeds the allowable threshold for the corresponding position, candidate color anomalies are identified. The mean and standard deviation of color values within a local window are calculated. When the mean deviates from the preset reference mean or the standard deviation exceeds the statistical threshold, candidate uniformity anomalies are identified. The contrast gradient of the local region is calculated, and the contrast decrease index is determined based on the current contrast gradient and the preset reference gradient. When the contrast decrease index exceeds the preset threshold, candidate haze anomalies are identified. The current edge position is searched along the preset standard boundary direction. When the edge offset or edge gradient meets the anomaly condition, candidate edge anomalies are identified. The candidate color anomalies, candidate uniformity anomalies, candidate haze anomalies, and candidate edge anomalies are merged to obtain candidate anomaly regions.
[0095] Specifically, candidate anomalies are first extracted in parallel using multiple algorithms on a unified coordinate map of each view, and then these anomalies are merged into a set of candidate regions. These candidate anomalies mainly include four categories: color intensity anomalies, region uniformity anomalies, fogging or stripe anomalies, and edge transition and boundary anomalies.
[0096] The detection of color depth abnormalities mainly uses color difference calculation. For each pixel in the unified coordinate system, calculate the color difference between its current color and the reference color obtained during library construction. For example, ΔE(u,v) = √[(L-L0)2 + (a-a0)2 + (b-b0)2], where (u,v) represents the pixel position in the unified lens coordinate system; L, a, and b represent the lightness component, red-green axis chromaticity component, and yellow-blue axis chromaticity component of the current color value of the current lens at the pixel position in the Lab color space, respectively; L0, a0, and b0 represent the reference lightness component, reference red-green axis chromaticity component, and reference yellow-blue axis chromaticity component of the reference color value obtained statistically from qualified samples of the same model at the pixel position during the library construction phase, respectively; ΔE(u,v) represents the color difference value of the current color at the pixel position relative to the reference color, used to characterize the degree of color deviation at that position; if the calculated ΔE(u,v) value exceeds the allowed threshold TΔE(u,v) for that position, then that point is marked as a candidate point of color anomaly. For products that primarily feature gray dimming films, the deviation of the L value can also be monitored simultaneously, as these products are more sensitive to changes in brightness.
[0097] The detection of regional uniformity anomalies employs a local window statistical method. For example, a 7×7 or 9×9 window is used as a unit, sliding across the image, and the mean and standard deviation of the L value or composite color depth value within the window are calculated. If the mean of the window differs significantly from the baseline mean of its region, or if the standard deviation within the window is significantly higher than the statistical value of a qualified sample, then the window is marked as a candidate region for uniformity anomaly.
[0098] Hazing, whitening, and stripe-like anomalies are identified using methods such as local contrast reduction and directional texture enhancement. For each local window, its local gradient mean Gk is calculated and compared with the baseline gradient G0 obtained during database construction. A hazing index can be defined, for example, Haze = 1 - Gk / G0. When the Haze index consistently exceeds a certain threshold, it indicates a decrease in local contrast in that area, potentially indicating hazing or whitening. Stripe-like anomalies can be identified through directional gradient statistics or by detecting the length of linear connected regions.
[0099] Edge transition and boundary anomaly detection are performed within a predefined edge loop region and frame adjacency region. The actual edge position in the current image is searched point-by-point along the direction of the standard boundary to obtain the edge offset dedge(s). If this offset exceeds the allowable value on a continuous boundary segment, or if the edge gradient suddenly weakens or the boundary becomes blurred, then that boundary segment is marked as a candidate region for edge anomalies. In this way, problems such as edge glue overflow, irregular boundaries, edge whitening, and localized membrane defects can be effectively identified.
[0100] The candidate points or candidate windows detected by different algorithms are then merged using morphological methods to form the final set of candidate abnormal regions r1, r2, r3, and so on. Each candidate region is recorded with detailed information such as its location, area, lens it belongs to, region it belongs to, average chromatic aberration, local contrast variation, and edge attributes.
[0101] In a more preferred embodiment, the step of determining the evaluation result of the dimming film of the eyeglass under examination based on the effective features further includes: The deviation direction of the main image and auxiliary image relative to the preset reference value at the same position in the unified lens coordinate system is compared point by point. When the same position continuously shows the same deviation in multiple images, the position is marked as a pixel-level stable point, and the remaining positions are marked as unstable points. A pixel-level stable map is generated based on the pixel-level stable points. When calculating the uniformity of different regions of the same lens or comparing the consistency of corresponding regions of the left and right lenses, only the pixel-level stable points in the pixel-level stable map are used for calculation, and the positions marked as unstable points are excluded.
[0102] To ensure greater stability in subsequent regional statistical results, a pixel-level stability map S(u,v) is generated. Specifically, each pixel in the unified coordinate system is analyzed to determine whether it consistently exhibits a deviation in the same direction across multiple views. For example, if a point is brighter than the baseline value in both the main and auxiliary views, its deviation is considered to be in the same direction. Points consistently exhibiting the same deviation are marked as stable points; while points that fluctuate in brightness or shift in position with changes in view are marked as unstable points. In subsequent calculations of uniformity and differences between left and right lenses, only pixels marked as stable points are used, thus proactively avoiding interference from unstable points. In this way, problems such as brightness drift, reflection position shifts, and amplified differences in visual appearance between left and right lenses caused by minor clamping offsets are prevented from directly impacting the final evaluation results.
[0103] As a specific implementation method, the evaluation results are determined based on statistics of different functional areas on the lens surface, dividing the lens into a central viewing area, a peripheral transition area, and an edge fitting area. For each area, the distribution density of effective features and the degree of color deviation are statistically analyzed.
[0104] If the effective evidence coverage of the central viewing area is only 50% due to strong local reflections, falling below the preset requirement of 80%, the evaluation process will automatically stop and trigger a re-sampling mechanism. Specifically, based on the distribution pattern of the unstable area in a unified coordinate system, an optimal viewing angle that avoids the current reflection path is calculated. The auxiliary camera acquires a new re-sampling image from this target's re-sampling perspective and converts it back to the unified coordinate system. By fusing the stable information from the re-sampling image, the effective evidence coverage of the central viewing area increases to over 90%. At this point, the evaluation algorithm recalculates the color uniformity index of the area and, combined with a consistency comparison of the left and right lenses, outputs a final pass / fail report. This dynamic re-sampling method ensures that a complete and reliable film quality evaluation can still be obtained under complex lighting and shadow interference.
[0105] In a further embodiment, after determining the evaluation result of the dimming film of the eyeglass under examination based on the effective features, the method further includes: When the severity or area of the defect corresponding to the assessment result is within a preset critical range, a re-inspection instruction is output, prompting the eyeglasses to be inspected to be re-clamped; a new positioning image, a new emphyseal main image, and a new auxiliary image are obtained after re-clamping, and the clamping offset after re-clamping is determined based on the new positioning image. When it is determined that the clamping offset after re-clamping meets the preset correction conditions, the effective features for re-inspection are re-determined based on the new emphyseal main image and the new auxiliary image; the overlap between the effective features for re-inspection and the effective features in the initial assessment in the unified lens coordinate system is compared to determine the overlap ratio; when the overlap ratio is higher than the preset re-inspection confirmation threshold, the corresponding abnormality is confirmed as a dimming film defect; when the overlap ratio is not higher than the re-inspection confirmation threshold, a verification prompt is output.
[0106] When the evaluation value is very close to the pass / fail threshold, a re-inspection branch will be initiated. A gray area can be set; for example, when the evaluation value falls within 10 percentage points above or below the threshold, a final judgment is not given directly. Instead, the operator is required to re-clamp the glasses and repeat the complete positioning verification, unified coordinate conversion, stable evidence screening, and quality evaluation process. If the same stable anomaly appears at the same location on the unified coordinate system in both evaluations, and the overlap ratio of the two anomaly areas is higher than the preset re-inspection threshold, then the anomaly is confirmed as a problem with the dimming film itself. If the results of the two evaluations are significantly inconsistent, the processing unit will not directly classify the first suspicious phenomenon as a defect, but will instead consider the stable evidence obtained from both evaluations. Figure 1 The images are then submitted for manual review. This manual review no longer relies solely on visual inspection of a single original image. Instead, it involves examining evidence images that have undergone clamping relationship verification, coordinate unification, and differentiation between stable and unstable information. This significantly improves the accuracy and efficiency of the review.
[0107] In a preferred embodiment, before extracting candidate anomalous regions in unified lens coordinates, the method further includes: Based on the residual distribution after mapping the control points of each lens boundary in the main and auxiliary images to the unified lens coordinates, the local mapping errors of multiple local regions in the unified lens coordinates are determined. When the local mapping error of any local region is greater than the fourth threshold, the local region is marked as a mapping error exceeding the limit. When extracting candidate abnormal regions and determining the positional change status of candidate abnormal regions, candidate points or candidate regions falling into the mapping error exceeding the limit are excluded. When determining the evaluation result of the dimming film of the eyepiece under test based on the effective features, the supplementary sampling prompt corresponding to the mapping error exceeding the limit is output.
[0108] This means that before extracting candidate anomaly regions, the quality of the coordinate transformation itself is evaluated. By analyzing the residual distribution of each lens boundary control point after being mapped to a unified lens coordinate system, the local mapping error of different local regions within the unified lens coordinate system can be determined. If the mapping error of a certain local region exceeds a preset threshold, that region will be marked as a region with excessive mapping error. During subsequent extraction of candidate anomalies and determination of their positional changes, all candidate points or regions falling into this region with excessive mapping error will be excluded to avoid misjudgments due to inaccurate geometric transformation. Simultaneously, when outputting the final evaluation results, corresponding supplementary sampling prompts will be provided for these regions with excessive mapping error, informing them that these regions could not be effectively evaluated due to unreliable data.
[0109] In another preferred embodiment, the step of outputting a prompt for re-sampling or re-clamping when the effective evidence coverage of any lens surface area is lower than the corresponding predetermined requirement includes: Based on the location distribution and corresponding positional change status of candidate anomaly regions that do not meet the stability conditions in the unified lens coordinate system, a target supplementary acquisition view is determined from multiple preset supplementary acquisition viewpoints; supplementary acquisition images under the target supplementary acquisition viewpoint are obtained; the supplementary acquisition images are converted to the unified lens coordinate system, and the positional change status of candidate anomaly regions is re-determined in the unified lens coordinate system; the effective features and effective evidence coverage are updated based on the candidate anomaly regions that meet the stability conditions after re-determination; when the updated effective evidence coverage is still lower than the corresponding predetermined requirements, a re-clamping prompt is output.
[0110] When coverage in a certain area is insufficient, a supplementary sampling branch is initiated. The priority order for supplementary sampling is as follows: first, attempt to sample one or more auxiliary images; if coverage is still insufficient after supplementary sampling, then prompt the operator to remount the image. This is because some unstable areas may simply be due to excessive reflection at a specific viewing angle; taking an additional auxiliary image may provide sufficient evidence, without necessarily requiring the operator to remove their glasses and re-view the image. This supplementary sampling strategy can automatically determine an optimal target supplementary sampling angle from multiple preset angles based on the location and changing state of the unstable area, thus more efficiently addressing the problem of insufficient evidence.
[0111] Secondly, this application also proposes a visual detection-based evaluation system for sports glasses dimming films, used to perform any of the steps in the above methods, including: The first module is used to obtain a positioning diagram that includes the reference part of the fixture and the eyeglass to be examined; The second module is used to determine the clamping offset of the eyeglass to be examined relative to the preset standard observation relationship based on the positioning diagram. The third module is used to obtain the frontal main image and at least one auxiliary image of the eyeglass to be examined when it is determined that the clamping offset meets the preset correction conditions. The fourth module is used to convert the frontal main image and the auxiliary image into a preset unified lens coordinate system according to the clamping offset. The fifth module is used to compare the candidate abnormal regions in the frontal main image and the auxiliary image in the unified lens coordinate system, and determine the positional change status of the candidate abnormal regions between different images. The sixth module is used to mark the candidate abnormal region as a valid feature when it is determined that the position change state meets the preset stability condition; The seventh module is used to determine the evaluation result of the dimming film of the eyeglass under test based on the effective features.
[0112] By acquiring positioning images, determining and correcting clamping offsets, converting images to unified lens coordinates, comparing candidate abnormal regions in different images and determining their stability, and finally marking effective features and determining evaluation results, this method effectively solves the problem of unstable visual information caused by clamping deviations and changes in observation conditions in existing technologies. It ensures the objectivity and accuracy of evaluation results and has the advantages of effectively eliminating visual information fluctuations caused by clamping deviations and changes in observation angles by correcting clamping offsets and unifying image coordinates, ensuring that visual information accurately reflects the true state of the film, thereby improving the objectivity and accuracy of evaluation results.
[0113] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for evaluating a photochromic film for sports eyewear based on visual inspection, the method comprising: include: Obtain a positioning diagram that includes the fixture reference area and the eyeglass to be examined; Based on the positioning diagram, determine the clamping offset of the eyeglass to be examined relative to the preset standard observation relationship; When it is determined that the clamping offset meets the preset correction conditions, the frontal main image and at least one auxiliary image of the eyeglass to be examined are obtained. Based on the clamping offset, the frontal main image and the auxiliary image are respectively converted to a preset unified lens coordinate system; In the unified lens coordinate system, the candidate abnormal regions in the main frontal image and the auxiliary image are compared to determine the positional change status of the candidate abnormal regions between different images. When it is determined that the position change state meets the preset stability condition, the candidate abnormal region is marked as a valid feature; The evaluation result of the dimming film of the eyeglass under test is determined based on the effective features.
2. The method of claim 1, wherein the method further comprises: The step of determining the clamping offset of the eyeglass to be examined relative to the preset standard observation relationship based on the positioning diagram includes: Identify the fixture reference location, the bridge position, and the lens boundary in the positioning diagram; Register the fixture reference part, the lens bridge position and the lens boundary with the corresponding positions in the standard observation relationship; Based on the registration results, determine the translational deviation within the image, the angular deviation within the plane, and the projection distortion. The clamping offset is determined based on the translation deviation within the image, the rotation deviation within the plane, and the projection deformation.
3. The method of claim 2, wherein the method further comprises: The steps for determining that the clamping offset meets the preset correction conditions include: The clamping offset score is calculated based on the translation deviation within the image, the rotation angle deviation within the plane, and the projection deformation, as well as the corresponding allowable correction range. The boundary recognition completeness is determined based on the matching result between the lens boundary and the corresponding lens boundary in the standard observation relationship; The reprojection error is determined based on the residual after the lens boundary is registered to the standard position; When the clamping offset score is not greater than the first threshold, the boundary recognition integrity is not lower than the second threshold, and the reprojection error is not greater than the third threshold, it is determined that the clamping offset meets the preset correction conditions. When the clamping offset score is greater than the first threshold, the boundary recognition integrity is lower than the second threshold, or the reprojection error is greater than the third threshold, the current clamping relationship is output as not meeting the evaluation conditions.
4. The method of claim 1, wherein the method further comprises: The step of converting the main front view and the auxiliary view to a preset unified lens coordinate system based on the clamping offset includes: Boundary control points of the left and right lenses are extracted from the main front view and the auxiliary view, respectively. Using the lens boundary control points corresponding to the standard observation relationship as target points, establish a mapping relationship between the current image and the unified lens coordinates; According to the mapping relationship, the left and right lenses in the main front view and the auxiliary view are respectively mapped to the corresponding unified lens coordinate region; Also includes: Perform a mirror flip on one of the lenses converted to the unified lens coordinates; The mirrored lens is aligned with the corresponding area of the other lens in the unified lens coordinate system.
5. The method of claim 1, wherein the method further comprises: The steps for determining that the position change state satisfies the preset stability conditions include: Determine the region mask of the candidate anomaly region in the main front view and the auxiliary view; Based on the region mask, determine the occurrence ratio and overlap ratio of the candidate abnormal regions in different images; The positional drift is determined based on the region center position of the candidate anomaly region in different images; When the occurrence ratio is not lower than a first preset value, the overlap ratio is not lower than a second preset value, and the position drift is not higher than a third preset value, it is determined that the position change state meets the preset stability conditions. When the occurrence ratio is lower than a first set value, the overlap ratio is lower than a second set value, or the position drift is higher than a third set value, the candidate abnormal region is marked as an unstable region.
6. The method for evaluating the dimming film of sports glasses based on visual detection according to claim 1, characterized in that, The step of determining the evaluation result of the dimming film of the eyeglass under test based on the effective features includes: According to the preset division of the lens surface area, the coverage rate of valid evidence corresponding to the effective features in each lens surface area is statistically analyzed; When the effective evidence coverage of any lens surface area is lower than the corresponding predetermined requirement, the current evaluation is terminated and a prompt for re-sampling or re-clamping is output. When the coverage of the effective evidence in each lens surface area is not lower than the corresponding predetermined requirement, the evaluation result is determined based on the color distribution and position distribution of the effective features.
7. The method for evaluating the dimming film of sports glasses based on visual detection according to claim 4, characterized in that, After converting the main frontal image and the auxiliary image to the unified lens coordinate system, the method further includes: Acquire grayscale reference block information on the fixture and illumination field correction map obtained in advance based on empty fixture calibration; Based on the grayscale reference block information, exposure correction and color correction are performed on the converted front view main image and the auxiliary image; Based on the illumination field correction diagram, the brightness and color of the corrected main front view and the auxiliary diagram are normalized.
8. The method for evaluating the dimming film of sports glasses based on visual detection according to claim 7, characterized in that, The steps for extracting the candidate anomaly region in the unified lens coordinates include: In a preset color space, the color difference between the current color at each position and the preset reference color is calculated, and when the color difference exceeds the allowable threshold at the corresponding position, a candidate point for color anomaly is determined. Calculate the mean and standard deviation of color values within a local window, and determine candidate regions for uniformity anomalies when the mean deviates from a preset baseline mean or the standard deviation exceeds a statistical threshold; Calculate the contrast gradient of a local area, and determine the contrast decrease index based on the current contrast gradient and the preset benchmark gradient. When the contrast decrease index is higher than a preset threshold, determine the candidate area for fogging abnormality. Search for the current edge position along the preset standard boundary direction, and determine the edge anomaly candidate region when the edge offset or edge gradient meets the anomaly condition; The candidate color anomaly point, the candidate uniformity anomaly region, the candidate fogging anomaly region, and the candidate edge anomaly region are merged to obtain the candidate anomaly region.
9. The method for evaluating the dimming film of sports glasses based on visual detection according to claim 6, characterized in that, The step of determining the evaluation result of the dimming film of the eyeglass under test based on the effective features further includes: The deviation directions of the main front view image and the auxiliary image relative to a preset reference value at the same position on the unified lens coordinate system are compared point by point. When the same location consistently shows the same deviation in multiple images, mark that location as a pixel-level stable point and mark the remaining locations as unstable points. Generate a pixel-level stable map based on the pixel-level stable points; When calculating the uniformity of different regions of the same lens or comparing the consistency of corresponding regions of the left and right lenses, only the pixel-level stable points in the pixel-level stable map are used for calculation, and positions marked as unstable points are excluded.
10. A visual inspection-based evaluation system for sports glasses dimming films, used to perform the method according to any one of claims 1 to 9, characterized in that, include: The first module is used to obtain a positioning diagram that includes the reference part of the fixture and the eyeglass to be examined; The second module is used to determine the clamping offset of the eyeglass to be examined relative to the preset standard observation relationship based on the positioning diagram. The third module is used to obtain the frontal main image and at least one auxiliary image of the eyeglass to be examined when it is determined that the clamping offset meets the preset correction conditions. The fourth module is used to convert the frontal main image and the auxiliary image into a preset unified lens coordinate system according to the clamping offset. The fifth module is used to compare the candidate abnormal regions in the frontal main image and the auxiliary image in the unified lens coordinate system, and determine the positional change status of the candidate abnormal regions between different images. The sixth module is used to mark the candidate abnormal region as a valid feature when it is determined that the position change state meets the preset stability condition; The seventh module is used to determine the evaluation result of the dimming film of the eyeglass under test based on the effective features.