Method for thickness detection and non-contact optical scanning system

By identifying and correcting candidate anomalies on the diamond surface, the problem of thickness measurement deviation caused by surface contamination was solved, achieving high-precision and high-efficiency diamond thickness detection.

CN122170782BActive Publication Date: 2026-07-14海克斯康制造智能技术(青岛)有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
海克斯康制造智能技术(青岛)有限公司
Filing Date
2026-05-11
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing non-contact optical scanning systems can cause calculation errors when measuring diamond thickness due to surface contamination such as fingerprints or tiny dust particles, affecting the accuracy of the cut grade.

Method used

By identifying candidate outliers and performing a correction process, including region segmentation, local neighborhood attribute feature extraction, and global statistical feature value correction, combined with an adaptive threshold segmentation algorithm and multiple filtering mechanisms, false point interference is eliminated and the true growth texture is preserved.

Benefits of technology

It effectively resists environmental noise fluctuations, improves the efficiency of high-precision measurement, ensures the accuracy and consistency of diamond thickness measurement, and is suitable for large-scale automated production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122170782B_ABST
    Figure CN122170782B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of optical measurement, in particular to a thickness detection method and a non-contact optical scanning system, which comprises the following steps: acquiring a two-dimensional representation image of a sample to be measured; determining an effective detection area; planning a detection path; acquiring original thickness data of a plurality of feature sampling points along the detection path; identifying candidate abnormal points in the feature sampling points, the candidate abnormal points being feature sampling points with spatial variation rates exceeding a set threshold; after the candidate abnormal points are identified, a first correction process can be performed, which comprises the following steps: performing regional segmentation on the two-dimensional representation image to generate an attribute mask for distinguishing different physical attribute regions; extracting local neighborhood attribute features of positions corresponding to the candidate abnormal points in the attribute mask; correcting the attributes of the candidate abnormal points; and screening the original thickness data of the plurality of feature sampling points based on the corrected attributes to generate the thickness of the sample to be measured. The application can exhibit extremely high efficiency in high-precision measurement and large-scale automated production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of measurement technology, and in particular to a thickness detection method and a non-contact optical scanning system. Background Technology

[0002] In jewelry appraisal and diamond cut evaluation, the thickness of a diamond is one of the core parameters, as it directly determines the diamond's optical and visual effects.

[0003] Existing technologies typically employ non-contact optical scanning systems to measure diamond thickness: during measurement, the diamond is placed on a rotating platform, and a high-resolution camera combined with structured light technology captures thousands of shadow points of the diamond during rotation, automatically creating a 3D model of the diamond, accurately measuring the thickness of the crown angle, pavilion angle, total depth ratio, and girdle, and directly generating standard cutting data.

[0004] Although non-contact optical scanning systems are now widespread, in actual measurements, optical scanning requires extremely high surface cleanliness. If there are fingerprints, oil stains, or tiny dust particles on the diamond surface, they will be identified as part of the diamond's thickness, thus causing deviations in the calculated cut grade. Summary of the Invention

[0005] In view of the above problems, the first aspect of this application designs and provides a thickness detection method.

[0006] A thickness detection method for diamond sample detection includes the following steps: acquiring a two-dimensional characterization image of the sample to be tested using an optical imaging unit; determining an effective detection area of ​​a displacement detection unit based on the two-dimensional characterization image; planning a detection path within the effective detection area; acquiring raw thickness data of multiple feature sampling points along the detection path using the displacement detection unit; identifying candidate anomalies among the feature sampling points, wherein the candidate anomalies are feature sampling points whose spatial change rate exceeds a set threshold; after identifying the candidate anomalies, a first correction process can be executed, the first correction process including: performing region segmentation on the two-dimensional characterization image to generate an attribute mask for distinguishing regions with different physical attributes; extracting local neighborhood attribute features of the candidate anomalies at the corresponding positions in the attribute mask; correcting the attributes of the candidate anomalies based on the local neighborhood attribute features; and filtering the raw thickness data of multiple feature sampling points based on the corrected attributes to generate the thickness of the sample to be tested.

[0007] Furthermore, after identifying candidate anomalies, a second correction process can be executed, which includes: calculating global statistical feature values ​​of the original thickness data of multiple feature sampling points; calculating the degree of deviation between the candidate anomaly and the global statistical feature values; correcting the attributes of the candidate anomaly based on the degree of deviation; and filtering the original thickness data of multiple feature sampling points based on the corrected attributes to generate the thickness of the sample to be tested.

[0008] Furthermore, the second correction process and the first correction process can be executed sequentially in a preset order or one of them can be executed at a time.

[0009] Furthermore, after acquiring the original thickness data of multiple feature sampling points along the detection path using the displacement detection unit, the method further includes the following steps: performing statistical distribution analysis on the original thickness data of multiple feature sampling points to extract multiple quantile feature values ​​reflecting the central tendency and dispersion of the original thickness data; calculating the statistical deviation based on the quantile feature values, and constructing a dynamic discrimination interval for identifying outlier feature sampling points based on the statistical deviation; calling preset industrial standard lower limit values ​​and processing specification upper limit values ​​to correct the boundary values ​​of the dynamic discrimination interval and determine the effective thickness threshold range; traversing the original thickness data of multiple feature sampling points and using the effective thickness threshold range to filter out feature sampling points within the effective thickness threshold range.

[0010] Furthermore, the first correction process includes: acquiring a two-dimensional representation image of the sample to be tested; calling an adaptive threshold segmentation algorithm to dynamically determine a discrimination threshold based on the local neighborhood gray-scale mean of each pixel in the two-dimensional representation image of the sample to be tested, so as to extract the light-transmitting and non-light-transmitting regions in the two-dimensional representation image of the sample to be tested; generating a binarized mask; establishing a mapping relationship between feature sampling points and the coordinates of the two-dimensional representation image of the sample to be tested; traversing candidate anomalies and determining whether the candidate anomalies belong to the light-transmitting region; if the candidate anomaly does not belong to the light-transmitting region, then correcting the attributes of the candidate anomaly and deleting the corresponding candidate anomaly from the original thickness data of multiple feature sampling points.

[0011] Furthermore, the second correction process includes: calculating the global median of the original thickness data of multiple feature sampling points; calculating the deviation between the thickness data of two adjacent candidate outliers and the global median; correcting the attributes of candidate outliers that are farther from the global median; and deleting the corresponding candidate outliers from the original thickness data of multiple feature sampling points.

[0012] Furthermore, the second correction process also includes: for candidate outliers that are closer to the global median, searching whether there is at least one adjacent feature sampling point in their spatial neighborhood; if there is no adjacent feature sampling point, then setting it as an isolated feature sampling point; correcting the attributes of the isolated feature sampling point, and deleting the corresponding candidate outlier from the original thickness data of multiple feature sampling points.

[0013] Furthermore, when identifying candidate anomalies among the feature sampling points, the following steps are included: for any pair of adjacent feature sampling points, calculate the absolute difference between the original thickness data of the two points; compare the absolute difference with a preset smoothing determination threshold; if the absolute difference is higher than the smoothing determination threshold, then determine that the spatial change rate of the adjacent feature sampling points exceeds the set threshold, and the adjacent feature sampling points are candidate anomalies.

[0014] Furthermore, in the first correction process, after establishing the mapping relationship between the feature sampling points and the coordinates of the two-dimensional representation image of the sample to be tested, the candidate anomalies are traversed to see if they belong to the preset edge region. If the candidate anomaly belongs to the preset edge region, the attributes of the candidate anomaly are corrected so that the corresponding candidate anomalies can be deleted from the original thickness data of multiple feature sampling points by filtering the attributes.

[0015] A second aspect of this application provides a non-contact optical scanning system for detecting the thickness of a diamond sample, comprising: a processing unit, including: an acquisition unit configured to acquire a two-dimensional characterization image of the sample to be tested using an optical imaging unit; a determination unit configured to determine an effective detection area of ​​a displacement detection unit based on the two-dimensional characterization image; a planning unit configured to plan a detection path within the effective detection area; a sampling unit configured to acquire raw thickness data of multiple feature sampling points along the detection path using the displacement detection unit; an identification unit configured to identify candidate anomalies among the feature sampling points, wherein the candidate anomalies are feature sampling points whose spatial change rate exceeds a set threshold; a first correction unit configured to execute a first correction process after identifying the candidate anomalies; the first correction process includes: performing region segmentation on the two-dimensional characterization image to generate an attribute mask for distinguishing regions with different physical attributes; extracting local neighborhood attribute features of the candidate anomalies at corresponding positions in the attribute mask; correcting the attributes of the candidate anomalies based on the local neighborhood attribute features; and a filtering unit configured to filter the raw thickness data of multiple feature sampling points based on the corrected attributes to generate the thickness of the sample to be tested.

[0016] In this application, after identifying candidate outliers, they are not immediately eliminated, but their properties are re-evaluated through a first correction process. In the thickness detection of transparent crystals similar to diamond samples, the noise caused by laser scattering interference and extreme values ​​resulting from sample morphology highly overlaps. This application establishes a multi-filtering mechanism by building a cross-index of spatial sampling data and local physical property masks. This mechanism can fully preserve the true growth texture of the diamond sample and eliminate false point interference, effectively resisting environmental noise fluctuations. It can also demonstrate extremely high efficiency in high-precision measurement and large-scale automated production.

[0017] Other features and advantages of the present invention will become clearer after reading the detailed embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart of a thickness detection method provided in this application;

[0020] Figure 2 This is a flowchart illustrating the sample detection process in the thickness detection method provided in this application.

[0021] Figure 3 A flowchart illustrating the raw thickness data cleaning and validity verification process in the thickness detection method provided in this application;

[0022] Figure 4 A flowchart for establishing an effective thickness dataset in the thickness detection method provided in this application;

[0023] Figure 5 A flowchart of the second calibration process in the thickness detection method provided in this application;

[0024] Figure 6 A flowchart for extracting the global median of the effective thickness dataset in the thickness detection method provided in this application;

[0025] Figure 7 A flowchart illustrating the identification of candidate anomalies in the thickness detection method provided in this application;

[0026] Figure 8 Another flowchart for identifying candidate anomalies in the thickness detection method provided in this application;

[0027] Figure 9 Another flowchart for identifying candidate anomalies in the thickness detection method provided in this application;

[0028] Figure 10 This is a schematic block diagram of the processing unit in the non-contact optical scanning system provided in this application. Detailed Implementation

[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0030] The first aspect of this application provides a thickness detection method that can be used for diamond sample detection.

[0031] The thickness measurement method provided in this application can also be used for thickness measurement of other transparent crystal samples similar to diamonds.

[0032] In high-precision industries, diamonds, due to their extremely high thermal conductivity and light transmittance, are often processed into samples of specific dimensions, such as round or rectangular transparent slices. The precision of their thickness directly determines the basic functionality of high-precision industrial equipment. In the jewelry industry, if a diamond is too thick, it will appear dark; if it is too thin, the center of the diamond will lose its luster. Only when the ratio of thickness to diameter reaches a specific value will the optimal visual effect be achieved. Therefore, the thickness of a diamond sample is a core functional indicator closely related to its optical performance.

[0033] In some embodiments of this application, the thickness detection method can be implemented by a non-contact optical scanning system.

[0034] In some embodiments of this application, the non-contact optical scanning system includes a displacement detection unit, an optical imaging unit, and a processing unit; wherein the processing unit achieves synchronous triggering and data interaction with other components through electrical connection.

[0035] In some embodiments of this application, the displacement detection unit includes a laser displacement sensor.

[0036] When measuring thickness, a laser displacement sensor projects a probe beam onto the diamond being measured, either perpendicularly or at a specific angle. Upon contact with the diamond surface, the laser beam undergoes diffuse reflection. The scattered light is then focused onto a photosensitive element (such as a CCD or CMOS linear image sensor) by a receiving lens assembly inside the laser displacement sensor, forming a light spot. Because diamonds (or other transparent crystals) vary in thickness, the angle at which the reflected light enters the receiving lens assembly changes, further displacing the light spot on the photosensitive element. Therefore, using a pre-defined trigonometric relationship, the actual distance between the diamond sample surface and the laser displacement sensor can be calculated based on the pixel position of the light spot on the photosensitive element. The displacement detection unit can be pre-configured with a zero-point reference plane, which can be an empty stage surface or a highly flat optical glass or metal stage. This allows the actual distance between the diamond surface and the laser displacement sensor to be converted into diamond thickness data based on the zero-point reference plane.

[0037] like Figure 1 As shown, in some embodiments of this application, the thickness detection method includes the following steps:

[0038] Step S11: Use an optical imaging unit to acquire a two-dimensional characterization image of the sample to be tested (e.g., a diamond sample to be tested).

[0039] Step S12: Determine the effective detection area of ​​the displacement detection unit based on the two-dimensional characterization image.

[0040] Step S13: Plan the detection path within the effective detection area.

[0041] Step S14: Use the displacement detection unit to obtain the original thickness data of multiple feature sampling points along the detection path.

[0042] Step S15: Identify candidate outliers in the feature sampling points.

[0043] Candidate outliers are feature sampling points whose spatial rate of change exceeds a set threshold.

[0044] Step S16: After identifying candidate outliers, the first correction process can be executed.

[0045] Specifically, the first calibration process includes:

[0046] S161: Perform region segmentation on the two-dimensional representation image to generate an attribute mask for distinguishing regions with different physical attributes;

[0047] S162: Extract the local neighborhood attribute features of the candidate anomaly points at the corresponding positions in the attribute mask;

[0048] S163: Correct the attributes of candidate outliers based on local neighborhood attribute features.

[0049] Step S17: Based on the corrected attributes, filter the original thickness data of multiple feature sampling points to generate the thickness of the sample to be tested.

[0050] In some embodiments of this application, each feature sampling point is associated with a preset attribute, which is used to characterize whether the corresponding feature sampling point participates in the final thickness output, or to characterize the corresponding weight.

[0051] In some embodiments of this application, the preset attribute can be a numerical parameter, such as confidence level.

[0052] In some embodiments of this application, the preset attribute can be a flag bit, such as 1 and 0 or False and True.

[0053] In this application, after identifying candidate outliers, they are not immediately eliminated, but their properties are re-evaluated through a first correction process. In the thickness detection of transparent crystals similar to diamond samples, the noise caused by laser scattering interference and extreme values ​​resulting from sample morphology highly overlaps. This application establishes a multi-filtering mechanism by building a cross-index of spatial sampling data and local physical property masks. This mechanism can fully preserve the true growth texture of the diamond sample and eliminate false point interference, effectively resisting environmental noise fluctuations. It can also demonstrate extremely high efficiency in high-precision measurement and large-scale automated production.

[0054] As an example, during measurement, the processing unit acquires a two-dimensional characterization image of the sample under test through the optical imaging unit, and further identifies the geometric center and edges of the sample under test.

[0055] Based on the identified geometric centroid and edges, the processing unit is set up. The processing unit drives the stage along a pre-set gridded scanning path. The gridded scanning path moves at a constant speed, and the laser displacement sensor is triggered at equal intervals.

[0056] Each time the stage moves a set distance and enters a grid, the laser sensor records a thickness value and can convert it into diamond thickness data based on the zero-point reference plane. The grid coordinates are then associated with the diamond thickness value, thus obtaining the feature sampling points and their corresponding original thickness data.

[0057] To eliminate mechanical lag, the processing unit can output a synchronous clock signal. When the real-time coordinates fed back by the encoder built into the stage reach the preset feature sampling point, the displacement detection unit is synchronously triggered to capture the reflected light signal that is offset by the thickness of the diamond surface, so that the pose data and the spot data are aligned on the time axis.

[0058] In some embodiments of this application, the measurement accuracy of the laser displacement sensor is ±0.001 mm.

[0059] In some embodiments of this application, the positioning accuracy of the stage is ±0.01mm.

[0060] In some embodiments of this application, the optical imaging unit is an industrial camera with a pixel count of not less than 5 million pixels.

[0061] In some embodiments of this application, the processing unit is an embedded processor, for example, with a main frequency of not less than 1.8 GHz.

[0062] In some embodiments of this application, the thickness detection method includes, for example: Figure 2 The following steps are shown.

[0063] Step S101: Control the stage to move to the calibration area. The displacement detection unit samples the zero-point reference surface under no-load conditions. The processing unit records and stores the thickness information of the zero-point reference surface, which is defined as the global reference thickness.

[0064] Global reference thickness can establish a unified thickness measurement benchmark, eliminating systematic errors caused by slight tilting or impurities on the zero-point reference surface.

[0065] Step S102: Place no fewer than S diamond samples (e.g., 100 diamond samples) sequentially or in batches on the stage. The optical imaging unit captures a two-dimensional representation image of the sample under test, which may be, for example, a top-view image of the sample under test. The processing unit identifies the two-dimensional projected contour of each sample under test using an edge detection algorithm. Based on the two-dimensional projected contour and its geometric center, the effective detection area of ​​each sample under test is located.

[0066] Edge detection algorithms can be selected from existing mature algorithms, which are not the focus of this invention and will not be elaborated here.

[0067] Step S103: Based on the effective detection area of ​​each identified sample to be tested, calculate the scanning step interval (e.g., denoted as...). The sampling grid is divided into equally spaced grids, and a continuous scanning path is generated based on the sampling grids, so that each sample to be tested collects no less than P feature sampling points.

[0068] For example, the effective detection area of ​​each identified sample is divided into a 10×10 sampling grid (i.e., M=10, N=10). The processing unit generates a continuous scanning path (e.g., an S-shaped scanning path) based on the sampling grid coordinates to minimize vibrations caused by stage reversal.

[0069] Step S104: The processing unit drives the stage to move at a constant speed along the continuous scanning path to obtain the displacement of the stage; when the stage moves a distance that reaches the preset scanning step interval, the processing unit drives the laser displacement sensor to act and records the current thickness of the diamond surface based on the feedback from the laser displacement sensor.

[0070] Step S105: The processing unit aligns the collected thickness of the current diamond surface with the coordinate space of the sampling grid, obtains the original thickness data of the feature sampling points corresponding to each sampling grid, and establishes a thickness matrix based on the horizontal index (e.g., coordinates or number) and vertical index of the sampling grid.

[0071] The thickness matrix can be an M×N dimension thickness matrix, such as a 10×10 dimension thickness matrix.

[0072] Repeat the above steps until all S samples to be tested are completed.

[0073] For example, 100 diamond samples of different types and specifications provided by a diamond processing company are selected. For each sample, a 10×10 thickness matrix is ​​obtained, resulting in 100 feature sampling points. Finally, a total of 10,000 sets of feature sampling points and original thickness data are obtained.

[0074] In some embodiments of this application, after obtaining the original thickness data of multiple feature sampling points along the detection path using the displacement detection unit, the original thickness data is further cleaned and its validity is verified.

[0075] Specifically, thickness detection methods include, for example: Figure 3 The following steps are shown:

[0076] Step S201: Perform statistical distribution analysis on the original thickness data of multiple feature sampling points, and extract multiple quantile feature values ​​that reflect the central trend and dispersion of the original thickness data.

[0077] Step S202: Calculate the statistical deviation based on the quantile feature value, and construct a dynamic discrimination interval for identifying outlier feature sampling points based on the statistical deviation.

[0078] Step S203: Call the preset lower limit value of the industrial standard and the upper limit value of the processing specification to correct the boundary value of the dynamic discrimination interval and determine the effective thickness threshold range.

[0079] Step S204: Traverse the original thickness data of multiple feature sampling points and filter out the feature sampling points that are within the effective thickness threshold range using the effective thickness threshold range.

[0080] For feature sampling points within the effective thickness threshold range, the process of identifying candidate anomalies among the feature sampling points is then executed.

[0081] In one specific implementation, the thickness detection method includes, for example: Figure 4 The following steps are shown:

[0082] Step S301: Call the original thickness data of multiple feature sampling points in the thickness matrix to establish the original thickness data sequence, and sort the original thickness data sequence in ascending order to obtain the ordered sequence of original thickness data.

[0083] For example, retrieve 10,000 sets of original thickness data sequences from 100 samples to be tested, sort the sequences in ascending order, and obtain an ordered sequence of original thickness data.

[0084] Step S302: Calculate the quantile position index based on the total number of samples to obtain the lower quantile and upper quantile.

[0085] For example:

[0086] Lower quantile ;

[0087] Upper quantile .

[0088] Step S303: Extract the ordered sequence of the original thickness data at the lower quantile. The thickness data at the location is used as the lower quartile. .

[0089] Lower quantile The thickness data at a location represents the upper limit of the smallest 25% of the thickness data in the ordered sequence of the original thickness data.

[0090] Step S304: Extract the ordered sequence of the original thickness data at the upper quantile. The thickness data at the location is used as the upper quartile. .

[0091] Upper quantile The thickness data at a location represents the lower bound of the largest 25% of the thickness data in the ordered sequence of the original thickness data. Linear interpolation can be performed to handle cases where the index is not an integer.

[0092] Step S305: Calculate the interquartile range .

[0093] Interquartile range It is the upper quartile. and lower quartiles The difference is expressed as .

[0094] Step S306: Based on the lower quartile and interquartile range Construct the lower discrimination boundary of the dynamic discrimination interval.

[0095] For example, the lower decision boundary can be denoted as , ,in, It is the lower quartile.

[0096] Step S307: Based on the upper quartiles and interquartile range Construct the upper discrimination boundary of the dynamic discrimination interval.

[0097] For example, the upper discrimination boundary can be denoted as: , ,in, It is the upper quartile.

[0098] Step S308: Traverse each original thickness data and compare the original thickness data with the lower discrimination boundary and the original thickness data with the upper discrimination boundary respectively.

[0099] Step S309: If the original thickness data is below the lower discrimination threshold or above the upper discrimination threshold, then delete the corresponding feature sampling points and the original thickness data in the original thickness data sequence.

[0100] Step S310: Otherwise, mark the corresponding feature sampling points as initial screening sampling points, and obtain the initial screening sampling point set and the corresponding original thickness data.

[0101] Step S311: Compare the minimum value of the original thickness data in the initial screening sampling point set with the preset lower limit value of the industry standard, select the larger value to correct the boundary value of the dynamic discrimination interval, and set it as the lower limit of the effective thickness threshold range.

[0102] Step S312: Compare the maximum value of the original thickness data in the initial screening sampling point set with the preset processing specification upper limit value, select the smaller value to correct the boundary value of the dynamic discrimination interval, and set it as the upper limit of the effective thickness threshold range.

[0103] Step S313: Traverse the original thickness data sequence, compare the original thickness data with the effective thickness lower limit threshold, and compare the original thickness data with the effective thickness upper limit threshold.

[0104] Step S314: If any of the original thickness data is lower than the effective thickness lower limit threshold or higher than the effective thickness upper limit threshold, it is marked as an outlier feature sampling point. The attributes of the outlier feature sampling point are modified to delete the outlier feature sampling point and its corresponding original thickness data in the original thickness data sequence.

[0105] Step S315: Otherwise, mark them as valid feature sampling points, obtain the valid feature sampling points and their corresponding original thickness data, and establish a valid thickness dataset.

[0106] The effective thickness dataset is denoted as: For example, the original thickness data is in the range of 0.3mm to 100mm.

[0107] Effective thickness dataset The thickness data is arranged in ascending order.

[0108] During the construction of the effective thickness dataset, the processing unit dynamically constructs the effective thickness threshold range through two rounds of correction, and filters the original thickness data sequence to ensure that the effective thickness dataset passes the dual verification of statistical outlier identification and physical logic constraints, filtering out error data caused by laser displacement sensor noise, edge reflection of the sample under test, and mechanical transmission interference.

[0109] In some embodiments of this application, a second correction process can be performed after candidate outliers are identified.

[0110] The second correction process includes, for example: Figure 5 The following steps are shown:

[0111] Step S401: Calculate the global statistical feature value of the original thickness data of multiple feature sampling points.

[0112] Step S402: Calculate the degree of deviation between candidate outliers and global statistical features.

[0113] Step S403: Correct the attributes of candidate outliers based on the degree of deviation.

[0114] The original thickness data of multiple feature sampling points are filtered based on the corrected attributes to generate the thickness of the sample to be tested.

[0115] In some embodiments of this application, the global statistical feature is the global median. Besides the global median, the global statistical feature can also be other common statistical features such as the mean, standard deviation, or a combination of one or more of them.

[0116] The global median is effective in resisting interference. Even if a small number of outliers remain in the effective thickness dataset and are not completely removed, the global median can accurately calibrate the core distribution level of the sample under test in the thickness matrix. In non-contact optical measurement systems, the global median can characterize the true average physical thickness of the current sample under test, serving as a global benchmark anchor point for subsequent algorithms.

[0117] When extracting the global median of the effective thickness dataset, the processing unit is configured to perform actions such as... Figure 6The following steps are shown:

[0118] Step S501: Read the total number of elements in the effective thickness dataset.

[0119] Step S502: Determine whether the total number of elements in the effective thickness dataset is odd.

[0120] Step S503: If the total number of elements in the effective thickness dataset is odd, calculate the target index and read the original thickness data corresponding to the target index as the global median.

[0121] Step S504: Otherwise, calculate the middle position index and extract the original thickness data corresponding to the middle position index, and use the arithmetic mean of the original thickness data corresponding to the middle position index as the global median.

[0122] The processing unit uses the calculated global median as the global baseline anchor point, which serves as the nominal central thickness of the sample under test. The global median can be calculated using algorithms integrated into existing software.

[0123] In some embodiments of this application, the second correction process includes: calculating the degree of deviation between the thickness data of two adjacent candidate outliers and the global median; correcting the attributes of candidate outliers that are farther from the global median; and deleting the corresponding candidate outliers from the original thickness data of multiple feature sampling points.

[0124] In some embodiments of this application, the second correction process further includes: for candidate outliers that are closer to the global median, searching whether there is at least one adjacent feature sampling point in their spatial neighborhood; if there is no adjacent feature sampling point, setting it as an isolated feature sampling point; correcting the attributes of the isolated feature sampling point, and deleting the corresponding candidate outlier from the original thickness data of multiple feature sampling points.

[0125] In some embodiments of this application, when identifying candidate anomalies among feature sampling points, the following steps are included: for any pair of adjacent feature sampling points, calculate the absolute difference between the original thickness data of the two points; compare the absolute difference with a preset smoothing judgment threshold; if the absolute difference is higher than the smoothing judgment threshold, determine that the spatial change rate of the adjacent feature sampling points exceeds the set threshold, and the adjacent feature sampling points are candidate anomalies.

[0126] The processing unit performs adjacent iterations in the same row and adjacent iterations in the same column.

[0127] In some embodiments of this application, the processing unit is configured to perform, as Figure 7 The following steps are shown:

[0128] Step S601: For any pair of adjacent feature sampling points in the thickness matrix of the sample to be tested, calculate the absolute difference between the original thickness data of the two points.

[0129] Step S602: Compare the absolute difference with the preset smoothing threshold.

[0130] Step S603: If the absolute difference is not higher than the preset smoothing judgment threshold, then keep the attributes of a pair of adjacent feature sampling points unchanged.

[0131] Step S604: If the absolute difference is higher than the preset smoothing judgment threshold, then the spatial change rate of adjacent feature sampling points is determined to exceed the set threshold, and the adjacent feature sampling points are a pair of candidate anomalies.

[0132] Step S605: Calculate the deviation between the original thickness data of two adjacent feature sampling points and the global statistical feature value.

[0133] Step S606: Keep the attributes of feature sampling points that are closer to the global statistical feature values ​​unchanged;

[0134] Step S607: Modify the attributes of feature sampling points that are farther away from the global statistical feature value so that they can be removed by filtering the attributes.

[0135] Step S608: For feature sampling points that are closer to the global statistical feature value, check whether there are still at least one adjacent feature sampling point above, below, to the left, and to the right of them.

[0136] Step S609: If there are no adjacent feature sampling points, set it as an isolated feature sampling point and modify the attributes of the isolated feature sampling point so that it can be removed by filtering the attributes.

[0137] Step S610: Use the thickness matrix of the test sample after removing isolated feature sampling points and feature sampling points that are farther away from the global statistical feature value as the screening thickness matrix of the test sample.

[0138] For example, the smoothing threshold can be set to 0.3 mm.

[0139] That is, the processing unit traverses the matrix through a double loop to perform horizontal (e.g., X direction) and vertical (e.g., Y direction) checks respectively.

[0140] In a more specific implementation, the processing unit is configured to perform, as Figure 8 The following steps are shown:

[0141] Step S701: Create a marker matrix of the same size as the thickness matrix of the sample to be tested, and set the initial value of the marker matrix to True; read the thickness matrix of the sample to be tested.

[0142] Step S702: Read the original thickness data corresponding to adjacent feature sampling points in the horizontal direction;

[0143] For example, let's denote the original thickness data corresponding to adjacent feature sampling points in the horizontal direction as... and .

[0144] Step S703: Calculate the absolute difference between the original thickness data of adjacent feature sampling points in the horizontal direction;

[0145] The absolute difference is denoted as: .

[0146] Step S704: If the absolute difference between the original thickness data of the feature sampling points is higher than the smoothing judgment threshold, the coordinates of the adjacent feature sampling points are stored in the undetermined anomaly stack as candidate anomalies.

[0147] Step S705: Read the original thickness data corresponding to adjacent feature sampling points in the vertical direction;

[0148] For example, let's denote the original thickness data corresponding to adjacent feature sampling points in the vertical direction as... and .

[0149] Step S706: Calculate the absolute difference between the original thickness data of adjacent feature sampling points in the vertical direction;

[0150] The absolute difference is denoted as: .

[0151] Step S707: If the absolute difference between the original thickness data of the feature sampling points is higher than the smoothing judgment threshold, the coordinates of the adjacent feature sampling points are stored in the undetermined anomaly stack as candidate anomalies.

[0152] Step S708: Retrieve the pre-calculated global median Calculate the absolute difference between the original thickness data corresponding to the adjacent feature sampling points of the candidate outlier and the global median.

[0153] Assume the original thickness data of the candidate anomaly points is denoted as... and Then we have:

[0154] ; .

[0155] Step S709: Compare the absolute differences between the two original thickness data and the global median, and set the value of the feature sampling point with the larger absolute difference to False in the label matrix.

[0156] For example:

[0157] if Then determine For noise, the corresponding values ​​in the label matrix Set the value to False.

[0158] if Then determine For noise, the corresponding values ​​in the label matrix Set the value to False.

[0159] If a feature sampling point has its corresponding label matrix value set to False during horizontal verification, then noisy feature sampling points that have already been removed are selectively avoided from participating in subsequent logic.

[0160] After completing all neighborhood comparisons, the processing unit is configured to execute:

[0161] Step S710: Traverse the feature sampling points in the label matrix whose values ​​are still True, and check whether there are at least one adjacent feature sampling point in the horizontal and vertical directions, and the value of the adjacent feature sampling point in the label matrix is ​​also True.

[0162] Step S711: If there are no adjacent feature sampling points in either the horizontal or vertical direction, mark them as isolated feature sampling points and set the value of the isolated feature sampling point in the labeling matrix to False.

[0163] Step S712: Calculate the product of the thickness matrix and the label matrix of the sample to be tested, and clear or invalidate the data of the feature sampling points marked as False.

[0164] Step S713: Delete the marker matrix and temporary variables.

[0165] For embedded systems, independent marker matrices can more easily implement inspection. When processing boundary feature sampling points or isolated feature points, only the corresponding bit markers need to be updated, without the need for complex array reconstruction. This decouples the noise judgment logic from the data storage logic, reduces the degree of coupling, and improves stability.

[0166] In some embodiments of this application, the first correction process includes: acquiring a two-dimensional representation image of the sample to be tested; calling an adaptive threshold segmentation algorithm to dynamically determine a discrimination threshold based on the local neighborhood gray-scale mean of each pixel in the two-dimensional representation image of the sample to be tested, so as to extract the light-transmitting and non-light-transmitting regions in the two-dimensional representation image of the sample to be tested; generating a binarized mask; establishing a mapping relationship between feature sampling points and the coordinates of the two-dimensional representation image of the sample to be tested; traversing candidate anomalies and determining whether the candidate anomalies belong to the light-transmitting region; if the candidate anomaly does not belong to the light-transmitting region, then correcting the attributes of the candidate anomaly and deleting the corresponding candidate anomaly from the original thickness data of multiple feature sampling points.

[0167] In some embodiments of this application, after establishing the mapping relationship between the feature sampling points and the two-dimensional representation image coordinates of the sample to be tested in the first correction process, it is necessary to traverse whether the candidate anomaly points belong to the preset edge region. If the candidate anomaly point belongs to the preset edge region, the attributes of the candidate anomaly point are corrected and the corresponding candidate anomaly point is deleted from the original thickness data of multiple feature sampling points.

[0168] In some embodiments of this application, the thickness detection method further includes, for example: Figure 9 The following steps are shown:

[0169] Step S801: Obtain a two-dimensional representation image (e.g., top view image) of the sample to be tested.

[0170] The processing unit can perform grayscale conversion, Gaussian filtering, and histogram equalization on the two-dimensional representation image of the sample to be tested. For example, grayscale conversion can convert an RGB image into a single-channel grayscale image. Sensor noise is removed by Gaussian filtering; the contrast between the light-transmitting and non-light-transmitting areas is enhanced by histogram equalization.

[0171] Step S802: Call the adaptive threshold segmentation algorithm to dynamically determine the discrimination threshold based on the local neighborhood gray mean of each pixel in the two-dimensional representation image of the test sample, so as to extract the light-transmitting area and the non-light-transmitting area in the test sample.

[0172] Because diamonds have a high refractive index and multifaceted reflective properties, an adaptive threshold segmentation algorithm is used to identify the light-transmitting and non-light-transmitting areas in the sample to be tested. This compensates for the non-uniformity of illumination caused by the high refractive properties of diamonds and prevents misjudgment or missed detection caused by ambient light and shadow. For example, it may misjudge dark areas as impurities and miss defects in bright areas.

[0173] The adaptive thresholding algorithm can be implemented by calling OpenCV's built-in functions.

[0174] Step S803: Generate a binarization mask.

[0175] For example, in a binary mask, a region with a pixel value of 255 represents a light-transmitting region (i.e., the region corresponding to the effective crystal), and a region with a pixel value of 0 represents a non-light-transmitting region (i.e., a region other than a defect, impurity, crack, or edge).

[0176] Step S804: Establish the mapping relationship between the feature sampling points and the coordinates of the two-dimensional representation image of the sample to be tested.

[0177] For feature sampling points, the image pixel coordinates in the binary mask are mapped using a pre-calibrated transformation formula.

[0178] Step S805: Traverse the coordinates of candidate exception points in the pending exception stack.

[0179] Step S806: If the coordinates of the candidate outlier point belong to the edge region, then modify the attributes of the candidate outlier point to delete the corresponding candidate outlier point from the original thickness data of multiple feature sampling points by filtering attributes.

[0180] Step S807: If it does not belong to the edge area, determine whether the abnormal point belongs to the light-transmitting area.

[0181] Because a laser beam is not an ideal geometric point, but a physical spot with a certain diameter, the area represented by a pixel in a visual image is smaller than the area corresponding to the spot. The projected area on the visual image contains multiple pixels. If only the mapped single pixel is considered, it cannot represent the physical state of the entire area covered by the spot.

[0182] Therefore, in some preferred embodiments of this application, the processing unit defines a sampling window centered on the mapped pixel coordinates, and calculates the local transmittance confidence by statistically analyzing the percentage of pixels representing light transmission within the sampling window, in order to simulate the actual contact state of the probe beam on the sample surface.

[0183] For example, a sampling window is generated centered on the pixel coordinates of the mapped outlier.

[0184] The size of the sampling window is set to be greater than (preferably slightly greater than) the equivalent area of ​​the laser spot mapped onto the image.

[0185] Calculate the transmittance corresponding to the outlier. The transmittance can be the ratio of the number of pixels with a value of 255 in the sampling window to the total number of pixels in the sampling window.

[0186] The transmittance corresponding to the outlier is compared with the preset retention threshold and rejection threshold.

[0187] Step S808: If the anomaly belongs to the light-transmitting area, then retain the attributes of the candidate anomaly.

[0188] If the transmittance corresponding to the outlier is higher than the preset retention threshold, it means that the sampling point is located inside the crystal, and the laser can penetrate normally and return the real surface reflection signal. The thickness data corresponding to the outlier is determined to be the real extreme value. Even if the difference between it and the adjacent points is large, it is still the real microscopic morphology extreme value of the sample and is retained as valid data.

[0189] Step S809: If the outlier belongs to a non-transparent area, then the attributes of the candidate outlier are corrected so that the corresponding candidate outlier can be deleted from the original thickness data of multiple feature sampling points by filtering the attributes.

[0190] If the transmittance of the abnormal point is lower than the preset rejection threshold, it means that the center or most of the area of ​​the sampling point falls on an opaque impurity or crack. The laser echo signal at this location is severely affected by scattering interference. The abnormal jump is due to pseudo-signal noise caused by physical defects, and the abnormal point is rejected.

[0191] In some embodiments of this application, the second correction process and the first correction process can be executed sequentially in a preset order.

[0192] For example, if the surface morphology of the sample to be tested is complex, such as the presence of large-area inclusions, the first correction process is initiated first. This involves extracting local neighborhood attribute features using attribute masks to perform preliminary physical attribute determination on candidate anomalies. After completing the first correction process, the candidate anomalies, after preliminary correction, enter the second correction process, where the deviation in a statistical sense is calculated using global statistical feature values. This dual verification method effectively distinguishes between genuine sample thickness mutations and detection errors. In particular, when combined with steps S201 to S204, the feature sampling points themselves are already within the effective thickness range, effectively undergoing four layers of screening, making it suitable for thickness detection of crystal samples with complex morphologies.

[0193] In some embodiments of this application, the second correction process and the first correction process may be performed selectively.

[0194] For example, if the two-dimensional representation image has a high signal-to-noise ratio and clear edges, it is preferable to perform the first correction process to quickly complete the correction using the image's semantic information.

[0195] If the quality of the 2D representation image is poor, a second correction process can be performed to remove outliers in the data dimension. The second correction process can achieve faster processing speed.

[0196] Based on the corrected attributes, the original thickness data of multiple feature sampling points are filtered, and the final thickness distribution map or thickness value can be generated through weighted averaging or fitting algorithms. The thickness distribution map can be used as one of the basic data for diamond grading reports, and can also output standardized test reports such as outlier coordinates, defect area, light transmittance grade, thickness uniformity score, diamond cut grading recommendations, and lab-grown diamond usability assessment results. It can also be directly output to MES systems or other similar data platforms.

[0197] A second aspect of this application provides a non-contact optical scanning system that can be used to detect the thickness of a diamond sample.

[0198] like Figure 10 As shown, the non-contact optical scanning system includes a processing unit 100, which further includes an acquisition unit 101, a determination unit 102, a planning unit 103, a sampling unit 104, an identification unit 105, and a first correction unit 106. Each part of the processing unit 100 can be implemented by an embedded processor, coordinating the execution of programs by a storage system and a hardware acceleration unit. The embedded processor can be a dedicated image processor, an on-chip chip, a high-performance microcontroller, or a digital signal processor. The hardware acceleration unit can quickly perform attribute extraction and correction in the first correction process.

[0199] The acquisition unit 101 is configured to acquire a two-dimensional characterization image of the sample to be tested using an optical imaging unit; the determination unit 102 is configured to determine the effective detection area of ​​the displacement detection unit based on the two-dimensional characterization image; the planning unit 103 is configured to plan a detection path within the effective detection area; the sampling unit 104 is configured to acquire the original thickness data of multiple feature sampling points along the detection path using the displacement detection unit; the identification unit 105 is configured to identify candidate anomalies among the feature sampling points, wherein the candidate anomalies are feature sampling points whose spatial change rate exceeds a set threshold; the first correction unit 106 is configured to execute a first correction process after identifying the candidate anomalies; the first correction process includes: performing region segmentation on the two-dimensional characterization image to generate an attribute mask for distinguishing regions with different physical attributes; extracting local neighborhood attribute features of the candidate anomalies at the corresponding positions in the attribute mask; correcting the attributes of the candidate anomalies based on the local neighborhood attribute features; and the filtering unit is configured to filter the original thickness data of multiple feature sampling points based on the corrected attributes to generate the thickness of the sample to be tested.

[0200] The non-contact optical scanning system provided in this application can exhibit extremely high efficiency in high-precision measurement and large-scale automated production.

[0201] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions claimed by the present invention.

Claims

1. A thickness detection method for diamond sample testing, characterized in that, Includes the following steps: Two-dimensional characterization images of the sample under test are acquired using an optical imaging unit; The effective detection area of ​​the displacement detection unit is determined based on the two-dimensional characterization image. Plan a detection path within the effective detection area; The displacement detection unit acquires the original thickness data of multiple feature sampling points along the detection path; Identify candidate outliers among the feature sampling points, wherein the candidate outliers are feature sampling points whose spatial change rate exceeds a set threshold; After identifying candidate outliers, a first correction process is executed, which includes: The two-dimensional representation image is segmented into regions to generate attribute masks for distinguishing regions with different physical attributes. Extract the local neighborhood attribute features of the candidate anomaly points at the corresponding positions in the attribute mask; The attributes of the candidate anomalies are corrected based on the local neighborhood attribute features; The original thickness data of multiple feature sampling points are filtered based on the corrected attributes to generate the thickness of the sample to be tested. The first correction process specifically includes: Obtain a two-dimensional representation image of the sample to be tested; An adaptive threshold segmentation algorithm is invoked to dynamically determine the discrimination threshold based on the local neighborhood gray-scale mean of each pixel in the two-dimensional representation image of the test sample, so as to extract the light-transmitting and non-light-transmitting regions in the two-dimensional representation image of the test sample. Generate a binary mask; Establish a mapping relationship between feature sampling points and the coordinates of the two-dimensional representation image of the sample to be tested; Traverse the candidate anomalies and determine whether each candidate anomaly belongs to a light-transmitting area; If a candidate outlier does not belong to the transparent area, then the attributes of the candidate outlier are corrected, and the corresponding candidate outlier is deleted from the original thickness data of multiple feature sampling points.

2. The thickness detection method according to claim 1, characterized in that, After identifying candidate outliers, a second correction process is performed, which includes: Calculate the global statistical feature values ​​of the raw thickness data from multiple feature sampling points; Calculate the degree of deviation between candidate outliers and global statistical feature values; The attributes of the candidate outliers are modified according to the degree of deviation; The original thickness data of multiple feature sampling points are filtered based on the corrected attributes to generate the thickness of the sample to be tested.

3. The thickness detection method according to claim 2, characterized in that, The second correction process and the first correction process are executed sequentially or selectively according to a preset order.

4. The thickness detection method according to any one of claims 1 to 3, characterized in that, After acquiring the raw thickness data of multiple feature sampling points along the detection path using the displacement detection unit, the following steps are also included: Statistical distribution analysis was performed on the original thickness data of multiple feature sampling points to extract multiple quantile feature values ​​that reflect the central tendency and dispersion of the original thickness data. Statistical deviation is calculated based on the quantile feature values, and a dynamic discrimination interval for identifying outlier feature sampling points is constructed based on the statistical deviation. The boundary values ​​of the dynamic discrimination interval are corrected by calling the preset lower limit value of the industrial standard and the upper limit value of the processing specification to determine the effective thickness threshold range; The original thickness data of multiple feature sampling points are traversed, and feature sampling points within the effective thickness threshold range are selected using the effective thickness threshold range.

5. The thickness detection method according to claim 2 or 3, characterized in that, The second calibration process includes: Calculate the global median of the raw thickness data from multiple feature sampling points; Calculate the deviation between the thickness data of two adjacent candidate outliers and the global median; Correct the attributes of candidate outliers that are further away from the global median, and delete the corresponding candidate outliers from the original thickness data of multiple feature sampling points.

6. The thickness detection method according to claim 5, characterized in that, The second calibration process also includes: For candidate outliers that are closer to the global median, search for at least one neighboring feature sampling point in their spatial neighborhood. If there are no adjacent feature sampling points, then it is set as an isolated feature sampling point; Correct the attributes of isolated feature sampling points and delete the corresponding candidate outliers from the original thickness data of multiple feature sampling points.

7. The thickness detection method according to claim 1, characterized in that, When identifying candidate outliers among the feature sampling points, the following steps are included: For any pair of adjacent feature sampling points, calculate the absolute difference between the original thickness data of the two points; The absolute difference is compared with a preset smoothing threshold. If the absolute difference is higher than the smoothing determination threshold, then the spatial change rate of adjacent feature sampling points is determined to exceed the set threshold, and the adjacent feature sampling points are candidate anomalies.

8. The thickness detection method according to claim 1, characterized in that, In the first calibration process, after establishing the mapping relationship between the feature sampling points and the coordinates of the two-dimensional representation image of the sample to be tested, Iterate through the candidate anomalies to determine if they belong to the preset edge region; If a candidate outlier belongs to a preset edge region, the attributes of the candidate outlier are modified so that the corresponding candidate outlier can be deleted from the original thickness data of multiple feature sampling points by filtering attributes.

9. A non-contact optical scanning system for detecting the thickness of a diamond sample, characterized in that, include: Processing unit, comprising: The acquisition unit is configured to acquire a two-dimensional characterization image of the sample to be tested using an optical imaging unit; The determining unit is configured to determine the effective detection area of ​​the displacement detection unit based on the two-dimensional characterization image; The planning department is configured to plan detection paths within the effective detection area; The sampling unit is configured to acquire the original thickness data of multiple feature sampling points along the detection path using a displacement detection unit; The identification unit is configured to identify candidate outliers among the feature sampling points, wherein the candidate outliers are feature sampling points whose spatial change rate exceeds a set threshold. The first correction unit is configured to execute a first correction process after identifying candidate anomalies; The first correction process includes: performing region segmentation on the two-dimensional representation image to generate an attribute mask for distinguishing regions with different physical attributes; extracting local neighborhood attribute features of the candidate anomaly points at their corresponding positions in the attribute mask; and correcting the attributes of the candidate anomaly points based on the local neighborhood attribute features. The first calibration process specifically includes: acquiring a two-dimensional representation image of the sample to be tested; An adaptive threshold segmentation algorithm is invoked to dynamically determine the discrimination threshold based on the local neighborhood gray-scale mean of each pixel in the two-dimensional representation image of the test sample, so as to extract the light-transmitting and non-light-transmitting regions in the two-dimensional representation image of the test sample. Generate a binary mask; Establish a mapping relationship between feature sampling points and the coordinates of the two-dimensional representation image of the sample to be tested; Traverse the candidate anomalies and determine whether each candidate anomaly belongs to a light-transmitting area; If a candidate outlier does not belong to the transparent area, then the attributes of the candidate outlier are corrected and the corresponding candidate outlier is deleted from the original thickness data of multiple feature sampling points. The screening unit is configured to filter the raw thickness data of multiple feature sampling points based on the corrected attributes to generate the thickness of the sample to be tested.