A multi-directional dark field inspection method and system for micro-prism edge chipping
Patent Information
- Application Number
- CN202611495479.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]然而,在实际产线的连续运行中观察到,当检测设备对微棱镜执行工作面翻转以进行跨面流转检测时,监控系统界面上原本精准套合的检测基准框经常会随机偏离微棱镜的实际物理轮廓,导致在提取图像特征时抓取到错误的像素区域,进而将正常的边缘形貌误判为严重的崩边缺陷
[0065]本发明通过定姿载具、动态光学锚点与机械像素零点构建跨曲率空间映射矩阵,实现了物理位姿锁定与像素基准确立的双重目标,解决传统方案中全局空间坐标基准在跨工作面检测流转后极易产生错位与失效的问题;非对称形态畸变参数将传统对物理崩边与崩角的定性判断,转化为度量边界散射光轮廓沿直径方向半径失衡程度的定量计算,精准识别物理崩边缺陷、物理崩角缺陷及形位偏差,降低缺陷误判率;图像序列最大值投影与同心分区隔离策略实现了缺陷方向选择性散射保留与边缘区域解耦,既压制暗背景干扰,又为微小缺陷分类提供精准数据支撑,缩短检测周期,提升产品良率与检测经济性。
Smart Images

Figure CN123015544A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of appearance defect detection technology, specifically to a multi-directional dark field detection method and system for chipped edges from microprism cutting. Background Technology
[0002] In the field of micro-optical component manufacturing, machine vision technology is widely used for the inspection of appearance defects in microprisms. Typically, a physical mounting platform is used to support the optical components, and automated microscopic imaging equipment is used to acquire images of the component's working surface. By pre-setting a fixed global coordinate reference in the inspection system, image processing algorithms can locate the surface of the microprism to be inspected and extract its edge contours. Then, based on the grayscale characteristics of the contours, it can determine whether the microprism has cutting or chipping defects, possessing the technical characteristics of being non-contact and highly automated.
[0003] However, during continuous operation on actual production lines, it was observed that when the inspection equipment flips the working surface of the microprism for cross-surface transfer inspection, the originally precisely fitted inspection reference frame on the monitoring system interface often randomly deviates from the actual physical contour of the microprism. This causes incorrect pixel areas to be captured when extracting image features, leading to the misjudgment of normal edge features as severe edge chipping defects. This triggers erroneous execution actions of the sorting mechanism, resulting in a large number of fully qualified high-value optical components being forcibly rejected and scrapped as defective products. This not only causes batch abnormal losses of precision components but also leads to the serious consequence of a complete shutdown of the downstream optical communication module assembly workshop due to a sudden interruption in the supply of key optical materials. Therefore, how to solve the problem of the inspection reference frame deviating from the actual contour of the component during the cross-surface transfer inspection of micro optical components is an urgent problem to be solved in this field. Summary of the Invention
[0004] To address the shortcomings of existing technologies, the present invention aims to provide a multi-directional dark field detection method for chipped edges in microprism cutting. This method establishes the mechanical pixel zero point using an attitude-fixed vehicle, performs multi-directional dark field grazing using spatial angle time-series to obtain a set of bi-directional scattering images, constructs a cross-curvature space mapping matrix to convert physical translation and in-plane rotation deviations into mathematical mapping parameters to generate an aligned response image set, and employs asymmetric morphological distortion parameters in conjunction with an in-plane defect registration table to perform defect classification and judgment. This achieves the effects of eliminating mechanical drift errors and accurately decoupling internal defects from edge chipping halo overlap, providing reliable data support for the accurate classification and extraction of micron-level defects and the determination of shape and position deviations, thereby improving the stability and recognition rate of appearance inspection of multi-curvature components.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] In a first aspect, the present invention provides a multi-directional dark field detection method for chipped edges from microprism cutting, comprising:
[0007] The microprism under test is positioned at the inspection station of the attitude-fixed vehicle. The mechanical pixel zero point is established through the attitude-fixed vehicle. Grazing is performed on the end face of the microprism under test. The maximum value projection of the image sequence is collected and executed to obtain a set of two-sided scattering images.
[0008] The two-sided scattering image set is analyzed and feature contours are extracted to obtain dynamic optical anchors. The dynamic optical anchors and mechanical pixel zeros are combined to construct a cross-curvature space mapping matrix. The cross-curvature space mapping matrix is used to perform coordinate mapping and interpolation operations on the two-sided scattering image set to obtain an aligned response image set.
[0009] Highlighted connected components are extracted from the aligned response image set. Defect type decoupling and differentiation are performed on the highlighted connected components to obtain an in-plane defect registration table. Asymmetric morphological distortion parameters are calculated based on the aligned response image set. Defect classification and determination are performed by combining the asymmetric morphological distortion parameters and the in-plane defect registration table to obtain a set of surface defect types.
[0010] Furthermore, the method for establishing the zero point of the mechanical pixel includes:
[0011] The microprism to be tested is acquired and loaded onto the testing station of the attitude-fixed vehicle. The pneumatic push rod is controlled to apply pushing force to the three orthogonal physical limiting surfaces in the microprism to be tested in sequence and the three-way contact pressure values are obtained in real time.
[0012] Obtain the preset bonding pressure range. If the three contact pressure values fall within the bonding pressure range, then establish a three-dimensional rectangular coordinate system with three orthogonal physical limiting surfaces, and define the intersection of the three orthogonal physical limiting surfaces in the three-dimensional rectangular coordinate system as the origin of the mechanical coordinate system.
[0013] Obtain the hand-eye mapping parameter matrix, extract the three-dimensional coordinate values of the origin of the machine coordinate system and add a constant to form the target column vector. Calculate the three-dimensional column vector by left-multiplying the target column vector using the hand-eye mapping parameter matrix. After homogenization and normalization, extract the horizontal pixel column coordinate values and combine them with the vertical pixel row coordinate values to form the machine pixel zero point.
[0014] Furthermore, the method for acquiring the two-sided scattering image set includes:
[0015] The spatial angle time sequence is obtained, and the microscopic imaging component and the dark field illumination source with multiple independently on and off azimuth sectors are controlled. The single azimuth sector is cyclically connected and the exposure is triggered according to the spatial angle time sequence to obtain a set of single azimuth scattering images of the current working surface.
[0016] Construct a two-dimensional image coordinate system. For each pixel coordinate position in the two-dimensional image coordinate system, extract the gray value of each frame of single-directional scattering image at that pixel coordinate position, filter out the maximum gray value and assign it to obtain the planar dark field scattering image.
[0017] The attitude-fixing vehicle is controlled to rotate the microprism under test so that the convex spherical working surface of the microprism is facing the microscopic imaging component. The cyclic acquisition and assignment operation is performed again to generate a spherical dark field scattering image, which is then combined with the planar dark field scattering image to form a two-sided scattering image set.
[0018] Furthermore, the method for obtaining the dynamic optical anchor point includes:
[0019] For each pixel location in the planar dark field scattering image, the gradient magnitude is calculated, combined into a gradient magnitude map, and a gray-level histogram of the gradient magnitude map is constructed.
[0020] Set a traversal threshold, calculate the inter-class variance of the grayscale histogram under different traversal thresholds, select the traversal threshold that makes the inter-class variance reach the maximum value as the gradient segmentation threshold, and generate a binary gradient mask.
[0021] The eight-neighbor connected component labeling operation is performed on the binary gradient mask to obtain each connected component. The minimum circumcircle fitting is performed on the set of edge contour coordinates in each connected component to obtain the circumcircle radius. The number of grids occupied by the circle and the radial thickness in the polar coordinate system are counted.
[0022] Divide the radial thickness by the radius of the circumscribed circle to obtain the radial flatness ratio. If the number of grids occupied by the circumference is greater than or equal to the preset circumference continuity threshold and the radial flatness ratio is less than the preset radial flatness ratio threshold, then the connected region is registered as a ring-shaped candidate region.
[0023] Furthermore, the method for obtaining the dynamic optical anchor point also includes:
[0024] Obtain the coordinates of the circumcircle's center and use them as a reference point to generate multiple radial rays. Calculate the arithmetic mean of pixel grayscale values at the same radial distance and combine them into a radial average grayscale profile curve.
[0025] The number of local extreme points on the radial average grayscale profile curve is counted. If the number of local extreme points is greater than or equal to two, the target extreme point with the largest corresponding radial distance value is selected, and the set of all connected pixels within the radius position and the preset extension range of the target extreme point is registered as the diffraction ring feature contour.
[0026] If the number of local extrema is equal to one, calculate the full width at half maximum (FWHM) of the local extrema. If it is greater than or equal to the preset solid ring width threshold, register the entire set of pixels in the ring-shaped candidate region as a bright solid ring feature contour and register the corresponding bright solid ring feature contour in the spherical dark field scattering image.
[0027] The column and row coordinates of the geometric center of each feature contour are calculated separately and combined to form planar dynamic optical anchor points and spherical dynamic optical anchor points, collectively referred to as dynamic optical anchor points.
[0028] Furthermore, the method for constructing the transcurvature space mapping matrix includes:
[0029] Subtract the column coordinates and row coordinates of the mechanical pixel zero from the column coordinates and row coordinates of the planar dynamic optical anchor point to obtain the planar lateral displacement component and the planar longitudinal displacement component.
[0030] Set the reference ring radius, divide the radius of the circumcircle of the diffraction ring feature profile by the reference ring radius to obtain the plane scale factor; extract the polar angle of the straight line segment feature corresponding to the positioning cut straight edge in the plane dark field scattering image, and subtract the preset reference edge polar angle to obtain the in-plane rotation angle.
[0031] If the plane scale factor falls within the preset scale factor allowable range and the absolute value of the in-plane rotation angle is less than or equal to the preset in-plane rotation angle allowable threshold, then a two-row, two-column matrix is constructed using the trigonometric functions of the plane scale factor and the in-plane rotation angle, and the intermediate coordinates of the anchor point linear transformation are obtained by left multiplying the column vector composed of the coordinates of the plane dynamic optical anchor point.
[0032] Subtracting the intermediate coordinates of the anchor point linear transformation from the zero-point coordinates of the mechanical pixel, and combining them, yields the cross-curvature space mapping matrix.
[0033] Furthermore, the method for obtaining the alignment response image set includes:
[0034] Extract the column and row coordinates of pixels in the planar dark field scattering image and supplement them with a constant to form a homogeneous column vector of three rows and one column. Construct a reference detection coordinate system with the zero point of the mechanical pixel as the coordinate zero point.
[0035] By left-multiplying the homogeneous column vector by the cross-curvature space mapping matrix, the target column coordinates and target row coordinates in the reference detection coordinate system are calculated and combined to define the target pixel coordinates.
[0036] If the target pixel coordinates contain non-integer values, extract the gray values of the four adjacent integer grid pixels in the original planar dark field scattering image, perform linear interpolation in the horizontal and vertical directions to calculate the interpolated gray values, and write them into the grid position corresponding to the target pixel coordinates. Then, iterate through the grids to generate a planar aligned response image.
[0037] The same recalculation logic is used to generate spherical alignment response images, and the planar alignment response images are combined with the spherical alignment response images to form an alignment response image set.
[0038] Furthermore, the method for obtaining the highlighted connected component includes:
[0039] Set the shrinkage ratio and the expansion ratio. With the mechanical pixel zero point as the center, the circular in-plane detection area is defined by the product of the radius of the outer circle of the diffraction ring feature contour and the shrinkage ratio. The annular edge detection zone is defined by the product of the radius of the outer circle and the expansion ratio.
[0040] Calculate the arithmetic mean and standard deviation of the grayscale values of all pixels in the in-plane detection domain, set the brightness ratio, and calculate the brightness judgment threshold based on the arithmetic mean, standard deviation and brightness ratio;
[0041] The pixel positions in the in-plane detection domain whose gray values are greater than the highlight determination threshold are assigned a value of one, an in-plane scattering binary map is generated, and an eight-neighbor connected component labeling operation is performed on the in-plane scattering binary map.
[0042] Set a minimum effective area threshold, extract the set of connected pixels in the in-plane scattering binary image whose total number of pixels is greater than or equal to the minimum effective area threshold, and obtain several independent highlighted connected regions.
[0043] Furthermore, the method for obtaining the in-plane defect registration form includes:
[0044] Calculate the centroid coordinates, equivalent circle diameter, length-to-short side ratio, and fill rate of the highlighted connected component, and set the shape discrimination threshold and fill rate threshold.
[0045] If the ratio of the length to the short side is less than the shape distinction threshold and the fill rate is greater than or equal to the fill rate threshold, it is registered as a contamination pit defect when the minimum Euclidean distance from the centroid coordinates of the other highlighted connected domains is greater than or equal to three times the equivalent circle diameter; when it is less than three times, a straight line is fitted to the centroid of the connected domain, and the vertical spatial distance from the individual centroid to the fitted line is calculated as the fitting residual. If the root mean square value of the fitting residual is less than or equal to the preset collinear residual threshold, it is registered as a surface scratch defect as a whole; otherwise, it is registered as a contamination pit defect independently.
[0046] If the ratio of the length to the short side is greater than or equal to the shape distinction threshold and the fill rate is less than the fill rate threshold, then a closing operation is performed to obtain the skeleton centerline. The number of pixels of the skeleton centerline is counted as the scratch length and then divided and registered as a surface scratch defect. If both the ratio of the length to the short side and the fill rate are greater than or equal to the corresponding threshold, then it is registered as a contamination pit defect. The in-plane defect registration table is then obtained by summarizing the data.
[0047] Furthermore, the method for calculating the asymmetric morphological distortion parameters includes:
[0048] Multiple radial rays are generated within the edge detection zone with the zero point of the mechanical pixel as the pole, and the maximum gray value of each ray is extracted.
[0049] If the maximum gray value is greater than the highlight determination threshold, the Euclidean distance from the pixel position where the maximum gray value is located to the extreme point is recorded as the boundary scattering radius; otherwise, the boundary scattering radius is assigned a null value and marked as the contour break angle, and the boundary scattering light contour is obtained by arranging them.
[0050] Extract the set of pixels in the boundary scattered light profile whose boundary scattering radius is not null, perform least squares circle fitting, and obtain the theoretical reference boundary radius;
[0051] Two angles 180 degrees apart are paired symmetrically in diameter. Valid angle pairs are selected where the scattering radii of both sides are not null, and the number of valid symmetrical angle pairs is counted.
[0052] The asymmetric morphological distortion parameters are calculated by summing the absolute values of the differences between the scattering radii on both sides of the effective angle pairs, and then dividing them by the theoretical reference boundary radius and the number of effective symmetric angle pairs.
[0053] Furthermore, the method for obtaining the set of surface defect types includes:
[0054] Set a zero distortion rate threshold and a break angle span threshold;
[0055] If the asymmetric shape distortion parameter is greater than the distortion rate zero judgment threshold and the number of contour break angles is greater than zero, the adjacent contour break angles are clustered into break angle intervals. If the angle span of the break angle interval is less than or equal to the break angle span threshold, a physical break angle defect is output; otherwise, a physical edge break defect is output.
[0056] If the asymmetric distortion parameter is greater than the zero distortion rate judgment threshold and the number of contour breakage angles is zero, output a shape and position deviation alarm.
[0057] If the asymmetric morphological distortion parameter is less than or equal to the distortion rate zero judgment threshold and the number of contour break angles is greater than zero, it is marked as edge attachment contamination; otherwise, it is marked as an abnormality to be re-inspected.
[0058] If the asymmetric shape distortion parameter is less than or equal to the distortion rate zero judgment threshold and the number of contour breakage angles is zero, it is determined that there is no edge chipping defect.
[0059] Summarize all defect entries to obtain a set of surface defect types.
[0060] Secondly, the present invention provides a multi-directional dark field detection system for microprism cutting edge chipping, which is used to implement the above-mentioned multi-directional dark field detection method for microprism cutting edge chipping, the system comprising:
[0061] The pose locking module is used to position the microprism under test at the inspection station of the attitude fixation vehicle, establish the mechanical pixel zero point through the attitude fixation vehicle, perform grazing on the end face of the microprism under test, collect and perform maximum value projection of the image sequence to obtain a set of two-sided scattering images.
[0062] Curvature Image Module: Used to analyze and extract feature contours from a two-sided scattering image set to obtain dynamic optical anchors. The dynamic optical anchors and mechanical pixel zeros are combined to construct a cross-curvature space mapping matrix. The cross-curvature space mapping matrix is used to perform coordinate mapping and interpolation operations on the two-sided scattering image set to obtain an aligned response image set.
[0063] Defect determination module: It is used to extract highlighted connected components based on the aligned response image set, perform defect type decoupling and differentiation on the highlighted connected components, obtain an in-plane defect registration table, calculate asymmetric morphological distortion parameters based on the aligned response image set, and perform defect classification determination by combining the asymmetric morphological distortion parameters and the in-plane defect registration table to obtain a set of surface defect types.
[0064] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0065] This invention constructs a cross-curvature space mapping matrix using an attitude-fixed vehicle, dynamic optical anchors, and mechanical pixel zeros, achieving the dual goals of physical pose locking and pixel reference establishment. This solves the problem of global spatial coordinate references easily becoming misaligned and failing after cross-working surface detection in traditional solutions. The asymmetric morphological distortion parameter transforms the traditional qualitative judgment of physical edge and corner breakage into a quantitative calculation of the degree of radial imbalance along the diameter direction of the boundary scattered light profile, accurately identifying physical edge and corner breakage defects and shape and position deviations, and reducing the defect misjudgment rate. The maximum value projection of the image sequence and the concentric partitioning isolation strategy achieve selective scattering preservation of defect direction and decoupling of edge regions, which not only suppresses dark background interference but also provides accurate data support for the classification of small defects, shortens the detection cycle, and improves product yield and detection economy. Attached Figure Description
[0066] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 This is a flowchart of a multi-directional dark field detection method for microprism cutting edge chipping provided in an embodiment of the present invention;
[0068] Figure 2A schematic diagram of a multi-concentrically distributed dark field illumination source provided in an embodiment of the present invention;
[0069] Figure 3 This is a schematic diagram of the maximum value projection of an image sequence provided in an embodiment of the present invention;
[0070] Figure 4 This is a schematic diagram of the minimum circumcircle and radial thickness of a connected region provided in an embodiment of the present invention;
[0071] Figure 5 This is a schematic diagram of concentric partitioning of the in-plane detection domain and the edge detection band provided in an embodiment of the present invention;
[0072] Figure 6 This is a schematic diagram of a dark-field scattering image of a microprism contamination pitting defect provided in an embodiment of the present invention;
[0073] Figure 7 This is a schematic diagram of dark-field scattering images of scratch defects on the surface of a microprism provided in an embodiment of the present invention;
[0074] Figure 8 This is a schematic diagram showing the skeleton extraction process before and after, as provided in an embodiment of the present invention.
[0075] Figure 9 This is a schematic diagram of a dark-field scattering image of a microprism physical chipping defect provided in an embodiment of the present invention;
[0076] Figure 10 This is a schematic diagram of a dark-field scattering image of a qualified microprism sample provided in an embodiment of the present invention;
[0077] Figure 11 This is a functional block diagram of a multi-directional dark field detection system for chipped edges in microprism cutting, provided in an embodiment of the present invention. Detailed Implementation
[0078] 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.
[0079] Example 1
[0080] Please see Figure 1 As shown, this embodiment provides a multi-directional dark field detection method for chipped edges from microprism cutting, including:
[0081] Step S10: Position the microprism under test at the testing station of the attitude-fixing vehicle, establish the mechanical pixel zero point through the attitude-fixing vehicle, perform grazing on the end face of the microprism under test, collect and perform maximum value projection of the image sequence to obtain a two-sided scattering image set.
[0082] Further, step S10 includes:
[0083] Step S11: Position the microprism to be tested at the testing station of the attitude-fixing vehicle, and establish the mechanical pixel zero point through the attitude-fixing vehicle.
[0084] In automated surface defect inspection of micro-optical components, such as optical communication lens-prism assemblies with end-face dimensions ranging from 0.5 mm to 2 mm, traditional vacuum adsorption platforms can only constrain the degrees of freedom of a single surface due to the small size of the components and their complex working surfaces with alternating planar and spherical distributions. When the multi-station inspection process involves component flipping or transfer, pressure pulsations in the adsorption gas path can easily cause sub-micron-level physical slippage of the components, and mechanical wear after long-term continuous operation can cause unidirectional drift of the physical zero-point of the equipment. Existing machine vision inspection architectures typically use the zero-point of the adsorption platform or a fixed pixel offset as the global spatial coordinate reference, which can easily lead to misalignment and failure of the coordinate zero point after cross-working surface inspection. In order to lock the spatial orientation of the micro-optical components and compensate for the coordinate reference distortion caused by physical orientation shift, a mechanical coordinate origin establishment mechanism based on three-dimensional orthogonal rigid limiting surface bonding and contact pressure closed-loop confirmation is established. The aim is to transform the physical orientation lock of the microprism under test during the multi-working surface transfer process into a deterministic pixel coordinate zero point.
[0085] Specifically, the microprism to be tested is acquired and loaded onto the testing station of the attitude-fixing vehicle. The microprism to be tested refers to a miniature polyhedral optical element. The outer contour of this element is typically a cylindrical substrate, with one end precisely cut to form a planar working surface and the other end a convex spherical working surface. A positioning straight edge, formed by the cutting process, is retained around the perimeter of the planar working surface to provide an in-plane orientation reference. The attitude-fixing vehicle refers to a mechanical assembly used to precisely hold the microprism to be tested. It consists of a bottom positioning reference surface, a side positioning reference surface, and an end positioning block. The bottom positioning reference surface, side positioning reference surface, and end positioning block are perpendicular to each other and are made of hard ceramic material, such as silicon nitride ceramic, through grinding. Together, they form orthogonal physical limiting surfaces that simultaneously constrain the three translational degrees of freedom of the microprism to be tested through geometric contact. After the microprism under test is pushed to the testing station of the attitude-fixing carrier by the feeding mechanism, the pneumatic push rod is controlled to apply a pushing force to the microprism under test sequentially along the normal direction of the bottom positioning reference surface, the normal direction of the side positioning reference surface, and the normal direction of the end face positioning block, so that the cylindrical outer wall and the two end faces of the microprism under test respectively make contact with the three orthogonal physical limiting surfaces. The contact pressure values of the three channels are obtained in real time from the piezoelectric micro-force sensors embedded in the back of the three orthogonal physical limiting surfaces in the attitude-fixing carrier. The contact pressure value refers to the mechanical scalar value output by the piezoelectric micro-force sensor after converting the normal compressive stress of the limiting contact interface into a charge quantity, which is then quantified by the charge amplifier and used to characterize the physical contact state of the contact interface. A preset bonding pressure range is obtained. The bonding pressure range is set based on the critical fracture load of the cutting edge of the microprism under static load and the minimum stable output force of the pneumatic push rod. The purpose is to ensure three-dimensional zero-gap physical bonding while avoiding the pushing force from cracking the cutting edge of the component. For example, the bonding pressure range is set to 0.05 Newtons to 0.30 Newtons.
[0086] The three real-time acquired contact pressure values are compared with the contact pressure range using the following logic: If all three contact pressure values are greater than or equal to the lower limit of the contact pressure range and less than or equal to the upper limit, the microprism under test is determined to be properly clamped; if any one of the contact pressure values is less than the lower limit, the corresponding orthogonal physical limiting surface is determined to be suspended and not properly clamped, and the pneumatic push rod in the corresponding direction is controlled to perform one or two pushing actions, after which the three contact pressure values are acquired and compared again; if any one of the contact pressure values is greater than the upper limit, the corresponding direction is determined to be under stress overload, the pneumatic push rod is controlled to unload the pushing force, and the microprism under test is returned to the feeding mechanism to re-execute the clamping process. After the microprism under test is properly clamped, a three-dimensional Cartesian coordinate system is established using the mechanical structure of the attitude-fixed carrier. Specifically, a three-dimensional Cartesian coordinate system is constructed using the geometric plane containing the bottom positioning reference plane as the XY coordinate plane, the geometric plane containing the side positioning reference plane as the YZ coordinate plane, and the geometric plane containing the end-face positioning block as the ZX coordinate plane. Since the bottom positioning reference plane, the side positioning reference plane, and the end-face positioning block are perpendicular to each other, the unique physical intersection of these three geometric planes in the three-dimensional Cartesian coordinate system is the origin of this coordinate system. This origin is defined as the mechanical coordinate origin. The mechanical coordinate origin remains unchanged on the mechanical structure of the attitude-fixing vehicle and is the physical zero point describing the pose of the microprism under test. To enable this physical zero point to be directly referenced by the microscopic imaging component for image acquisition, a hand-eye mapping parameter matrix pre-generated based on the target calibration method is obtained. The hand-eye mapping parameter matrix is a 3x4 perspective projection matrix, obtained by multiplying the 3x3 camera intrinsic parameter matrix and the 3x4 camera extrinsic parameter matrix of the microscopic imaging component. It is used to map 3D coordinate values in a 3D Cartesian coordinate system to a 2D image coordinate system of the image sensor pixel array. The 3D coordinate values of the machine coordinate origin are extracted, and a constant element 1 is added to the end of these 3D coordinate values, i.e., at the fourth row position, to form a 4D column vector, which is used as the target column vector. The 3x4 hand-eye mapping parameter matrix is then multiplied on the left by this 4D target column vector, performing linear algebra matrix multiplication to calculate a 3D column vector. The elements of the first and second rows of this 3D column vector are divided by the element of the third row to perform homogenization, obtaining the 2D image coordinate vector corresponding to the machine coordinate origin in the image sensor pixel array. The horizontal pixel column coordinate values and vertical pixel row coordinate values of this 2D coordinate vector are extracted and combined, defined as the machine pixel zero point.
[0087] Step S12: Perform grazing reflection on the end face of the microprism to be measured, acquire and perform maximum projection of the image sequence to obtain a two-sided scattering image set.
[0088] After acquiring the mechanical pixel zero point, the microscopic imaging component is controlled to acquire images with multiple concentrically distributed dark-field illumination sources. To ensure that the acquired images of different working surfaces of the microprism under test share the same physical pose reference, all image acquisition actions are performed under the premise that the real-time monitored three-way contact pressure values are continuously within the contact pressure range.
[0089] Specifically, the multiple concentrically distributed dark-field illumination sources comprise a triple-ring light-emitting diode array arranged concentrically from the inside out along the radial direction, with the optical axis of the microscopic imaging component as the central axis. These are defined as the inner ring light source, the middle ring light source, and the outer ring light source, respectively. Each ring light source array is uniformly divided into eight independently switchable azimuth sectors along the circumference. Each ring light source is configured to grazing illumination angles that avoid the numerical aperture receiving cone angle range of the microscopic imaging component. Reflected light cannot enter the objective lens, resulting in a dark background on the mirror surface. Diffuse light generated by surface defects, due to its scattering direction covering a large angle range, can partially enter the objective lens and be detected. For example, the angles between the main illumination rays of the inner, middle, and outer ring light sources and the geometric plane of the working surface of the microprism currently facing the microscopic imaging component are set to 40 degrees, 25 degrees, and 10 degrees, respectively. See [link to relevant documentation]. Figure 2This diagram illustrates a multi-concentric dark-field illumination source provided in an embodiment of the present invention. The central dot represents the central axis, i.e., the optical axis of the microscopic imaging component. The three concentric rings from the inside out are labeled "inner ring light source," "middle ring light source," and "outer ring light source," corresponding to the triple-ring light-emitting diode array arranged concentrically along the radial direction. Eight dividing lines emanating from the center evenly divide each ring into eight sections along the circumference. The blackened section is the "azimuth sector," representing the currently selected, independently switchable light-emitting unit. This diagram illustrates the two-dimensional organizational relationship of the light source divided into rings in the radial direction and sectors in the circumferential direction. In the scenario of dark-field grazing detection of the microprism end face, different rings and sectors correspond to different incident azimuths and grazing angles. Only when a single, determined azimuth sector provides illumination can the directional diffuse light from the defect be independently excited. A preset spatial angle timing sequence is obtained, which is a sequence containing multiple illumination entries. Each illumination entry consists of a ring number, an azimuth sector number, and an exposure duration value. The ring number is an index number used to uniquely identify whether the currently selected ring LED array is an inner ring light source, a middle ring light source, or an outer ring light source. The azimuth sector number is an index number used to indicate the specific circumferential angle range of light emission within the currently selected ring LED array. The exposure duration value refers to the time it takes for the photosensitive chip of the area array camera in the microscopic imaging component to accumulate charge. Its value is set based on the reflectivity of the optical material of the microprism under test and the numerical aperture size of the microscopic imaging component. The purpose is to ensure that the diffuse scattering signal of small defects can achieve a recognizable grayscale contrast while avoiding pixel overflow caused by overexposure of local edge halos. For example, this exposure duration value is set to 10 milliseconds to 50 milliseconds.
[0090] For the working surface of the microprism currently facing the microscope imaging component, cyclic acquisition is performed according to the spatial angle time sequence. When executing the current illumination entry, a single azimuth sector corresponding to the ring number and azimuth sector number is activated. After issuing the activation command, after a preset luminous flux stabilization delay, the area array camera is triggered to perform a single image exposure according to the exposure duration value set in the current illumination entry. The luminous flux stabilization delay refers to the time interval from the issuance of the control signal to the light-emitting diode reaching its steady-state rated luminous brightness. It is set based on the step response rise time of the constant current drive circuit of the light source, with the aim of preventing exposure from being triggered during the transient process of the light source brightness rise, which would cause the overall grayscale of the image to be too dark or flickering; for example, the luminous flux stabilization delay is set to 5 milliseconds to 15 milliseconds. After completing a single image exposure, the acquired frame of single-azimuth scattering image is stored in the frame buffer area corresponding to the current working surface, and then the current azimuth sector is disconnected. The single-azimuth scattering image refers to a two-dimensional grayscale pixel array captured by an area array camera under the condition of illumination provided by only a single, defined ring light source and azimuth sector. It records the directional diffuse scattering response characteristics of the microprism under test at a specific incident light angle. The above-mentioned on-time, delay, exposure, and disconnection acquisition actions are repeated until all illumination entries in the spatial angle time sequence are traversed. During the execution of the cyclic acquisition, the three-way contact pressure values fed back by the piezoelectric micro-force sensor are continuously read in real time. If any contact pressure value is not within the contact pressure range, the current cyclic acquisition is interrupted, the image data in the corresponding working surface frame buffer is cleared, and the pushing and reference calibration process of the orthogonal physical limiting surface is retried. After completing the cyclic acquisition of the current working surface, the maximum value projection of the image sequence is performed on a set of single-azimuth scattering images in the frame buffer. Specifically, for each pixel coordinate position in the two-dimensional image coordinate system, the grayscale value of each frame of single-azimuth scattering image at the same pixel coordinate position is extracted. A set of extracted grayscale values is compared, and the maximum grayscale value is selected and assigned to the corresponding pixel coordinates in the composite dark-field scattering image. This assignment operation is performed by traversing all pixel coordinates in the two-dimensional image coordinate system to generate the composite dark-field scattering image of the working surface. This maximum value projection operation of the image sequence can preserve the bright diffuse light excited by surface defects in any single orientation sector, while suppressing the low grayscale specular areas in each orientation sector into a uniform dark background. See also... Figure 3This is a schematic diagram of the maximum value projection of an image sequence provided in an embodiment of the present invention. The multiple overlapping grayscale images on the left represent single-directional scattering images. Bright spots located at different positions on each image represent the directional diffuse scattering responses of the same element excited under illumination from different directional sectors. The middle arrow represents taking the maximum grayscale value pixel by pixel, corresponding to the operation of comparing the grayscale values of each frame and selecting the maximum value for the same pixel coordinate position. The larger square image on the right is a composite dark-field scattering image, which simultaneously displays the bright spots of each single frame. Its uniform dark background is a dark background. In dark-field detection scenarios, any defect is often strongly excited only under a specific incident direction, while the specular area maintains low grayscale in all directions. Taking the maximum grayscale value pixel by pixel can retain and converge the high-brightness scattering signals excited under all directions onto the same image, while suppressing the consistently low grayscale specular area into a uniform dark background, thereby comprehensively presenting the multi-directional defect responses in a single frame and avoiding the mutual submersion of defect features.
[0091] In the actual process flow, the planar working surface of the microprism under test is first oriented towards the microscopic imaging component, and the above-mentioned cyclic acquisition and image sequence maximum value projection process is executed. The resulting composite dark-field scattering image is defined as a planar dark-field scattering image. Subsequently, the attitude-fixing carrier is controlled to rotate 180 degrees around the normal of the side positioning reference plane, so that the convex spherical working surface of the microprism under test is oriented towards the microscopic imaging component. After completing the rotation and reconfirming that the three contact pressure values all fall within the contact pressure range, the above-mentioned cyclic acquisition and image sequence maximum value projection process is executed again, and the resulting composite dark-field scattering image is defined as a spherical dark-field scattering image. Both the planar dark-field scattering image and the spherical dark-field scattering image contain self-emitting scattering halos formed by the edge edges and surface defects of the microprism under test excited by dark-field grazing rays; among them, the periphery of the planar dark-field scattering image retains a concentric ring structure formed by edge diffraction, and the periphery of the spherical dark-field scattering image retains a high-brightness ring structure formed by the convergence of the spherical equatorial zone. The planar dark field scattering image and the spherical dark field scattering image are combined into a two-sided scattering image set.
[0092] Step S10 addresses the technical challenges of global spatial coordinate references in existing machine vision inspection architectures, such as easy misalignment and failure after cross-working-plane inspection, and the mutual submersion of micro-defect features under bright-field grayscale imaging, through the use of an attitude-fixing vehicle, mechanical pixel zero points, spatial angle temporal sequence, maximum image sequence projection, and a two-sided scattering image set. Specifically, the attitude-fixing vehicle deterministically locks the physical pose of the microprism under test; the mechanical pixel zero point cuts off the propagation path of mechanical zero-point drift error, providing a unique pixel-level reference point for cross-working-plane operations; the spatial angle temporal sequence controls the light source to perform multi-directional dark-field grazing, thereby independently exciting the scattering signal of micron-level defects; the maximum image sequence projection preserves the selective scattering of defect directions, suppressing the dark background of the mirror area; and the two-sided scattering image set enables the acquisition of the same pose of the response data from the two composite working surfaces.
[0093] Step S20: Analyze and extract feature contours from the two-sided scattering image set to obtain dynamic optical anchor points. Combine the dynamic optical anchor points with the mechanical pixel zero points to construct a cross-curvature space mapping matrix. Use the cross-curvature space mapping matrix to perform coordinate mapping and interpolation operations on the two-sided scattering image set to obtain an aligned response image set.
[0094] Further, step S20 includes:
[0095] Step S21: Analyze and extract the feature contours of the two-sided scattering image set to obtain dynamic optical anchor points.
[0096] After acquiring the two-sided scattering image set, in order to separate the reference coordinate points with circular symmetry properties from the edge scattering halo and not dependent on external mechanical rigid positioning, so as to eliminate the physical displacement error caused by mechanical flipping and other actions, a feature extraction operation based on gray-level gradient and morphological features is performed on the two-sided scattering image set, thereby extracting a stable image layer alignment benchmark.
[0097] Specifically, for a planar dark-field scattering image, for each pixel location in the image, the horizontal and vertical gray-level gradient components are calculated. The horizontal gray-level gradient component is squared to obtain a horizontal squared value, and the vertical gray-level gradient component is squared to obtain a vertical squared value. The horizontal and vertical squared values are added together, and the square root of the sum is calculated to obtain the gradient magnitude of that pixel location. The gradient magnitudes of all pixel locations in the planar dark-field scattering image are combined to generate a gradient magnitude map. A gray-level histogram of the gradient magnitude map is constructed. The gray-level histogram is a statistical chart with the gradient magnitude values on the x-axis and the frequency of pixels with the corresponding gradient magnitude values on the y-axis. The sum of the gradient magnitudes of all pixels in the gradient magnitude map is calculated and divided by the total number of pixels to obtain the global average gradient magnitude. A traversal threshold is set, which is based on the effective dynamic range of the gradient magnitude. For example, the gradient magnitude is taken in increments of 1 within the range of 0 to 255. The pixels in the grayscale histogram are divided into two parts using the traversal threshold: pixels with a gradient magnitude greater than the traversal threshold are assigned to the foreground pixel set, and pixels with a gradient magnitude less than or equal to the traversal threshold are assigned to the background pixel set.
[0098] The foreground pixel ratio is obtained by dividing the number of pixels in the foreground pixel set by the total number of pixels in the gradient magnitude map. The mean foreground gradient magnitude is obtained by dividing the sum of the gradient magnitudes of all pixels in the foreground pixel set by the number of pixels in the foreground pixel set. Similarly, the background pixel ratio and the mean background gradient magnitude of the background pixel set are calculated. The inter-class variance corresponding to the current traversal threshold is then calculated. Specifically, the inter-class variance corresponding to the current traversal threshold is obtained by multiplying the product of the foreground pixel ratio, the mean foreground gradient magnitude, and the square of the difference between the mean global gradient magnitude and the background pixel ratio, the mean background gradient magnitude, and the square of the difference between the mean global gradient magnitude and the background pixel ratio. The traversal threshold that maximizes the inter-class variance is selected and defined as the gradient segmentation threshold. Pixels with values greater than the gradient segmentation threshold in the gradient magnitude map are assigned a value of one, and pixels with values less than or equal to the gradient segmentation threshold are assigned a value of zero, generating a binary gradient mask.
[0099] An eight-neighborhood connected component labeling operation is performed on the binary gradient mask to obtain each connected component in the binary gradient mask. A connected component refers to a set of connected pixels in the binary gradient mask that are spatially adjacent and all have a pixel value of one. The connected components are traversed one by one, and their geometric parameters are calculated. Specifically, the two-dimensional coordinate set of the boundary pixels adjacent to the background pixels within the connected component is obtained and defined as the edge contour coordinate set. A minimum bounding circle fitting is performed on the edge contour coordinate set. Specifically, the circle that completely encloses all pixels in the edge contour coordinate set and has the smallest area is found. The center coordinates of this minimum bounding circle are extracted as the center coordinates of the outer circle, and the radius of this minimum bounding circle is extracted as the radius of the outer circle. Using the coordinates of the circumscribed circle's center as the pole, the 360-degree circumference is divided into 360 angular intervals with 1-degree intervals. The number of angular intervals occupied by pixels within this connected region in polar coordinates is defined as the number of grid squares occupied by the circumference. Simultaneously, the radial distances from all pixels within this connected region to the circumscribed circle's center are calculated, and the maximum and minimum radial distances are selected. The algebraic difference between the maximum and minimum radial distances is defined as the radial thickness. (See also...) Figure 4 This diagram illustrates the minimum circumcircle and radial thickness of a connected region according to an embodiment of the present invention. The gray, irregularly shaped ring-shaped area represents the connected region. The circle that completely surrounds it is the "minimum circumcircle," the cross at its center is the "circumcircle center," and the radius line from the center to the circumference is the "circumcircle radius." The difference between the longest and shortest radial line segments drawn from the center to the connected region is the "radial thickness." Short markings on the circumference indicate angular intervals divided in degrees. In scenarios where candidate annular regions are selected from edge-scattered halos, it is necessary to distinguish between true annular structures and large-area non-annular spots. The minimum circumcircle radius provides a dimensional benchmark, the radial thickness reflects the span of the connected region in the radial direction, and the circumferential angular interval statistics reflect its degree of closure along the circumference. Together, these are used to determine whether the connected region is a thin and closed annulus, providing a geometric basis for extracting a stable circular symmetry alignment benchmark.
[0100] Obtain preset circumferential continuity thresholds and radial flatness ratio thresholds. The circumferential continuity threshold is used to determine whether a connected region is closed along the circumferential direction; for example, this circumferential continuity threshold is set to 320. The radial flatness ratio threshold is used to exclude large-area non-annular light spots; for example, this radial flatness ratio threshold is set to 0.15. For the currently traversed connected region, divide the radial thickness of the connected region by its circumscribed circle radius to obtain the radial flatness ratio value. If the number of grids occupied by the connected region is greater than or equal to the circumferential continuity threshold, and the radial flatness ratio value of the connected region is less than the radial flatness ratio threshold, then the connected region is retained and registered as an annular candidate region; if the number of grids occupied by the connected region is less than the circumferential continuity threshold, or the radial flatness ratio value of the connected region is greater than or equal to the radial flatness ratio threshold, then the connected region is discarded. For each annular candidate region, using the coordinates of its fitted circumcircle's center as a reference point, 720 outward-emitting radial rays are generated along the circumference with an angular step of 0.5 degrees. Along each radial ray, extending outward with a step of one pixel, the grayscale values of the corresponding pixel positions in the planar dark-field scattering image are extracted sequentially. For all 720 radial rays, the extracted grayscale values at the same radial distance are summed and divided by the total number of rays, 720, to calculate the arithmetic mean at that distance. The arithmetic means of all distance positions are combined to obtain a radial average grayscale profile curve that varies with radial distance. The radial average grayscale profile curve is traversed, and the number of local extrema on the curve where the grayscale value is simultaneously greater than both its left and right adjacent positions is counted. If the number of extreme points is greater than or equal to two, the target extreme point with the largest corresponding radial distance is selected from the multiple extreme points. The set of all connected pixels within the radius position corresponding to the target extreme point and extending one pixel before and after it is registered as the diffraction ring feature contour. If the number of extreme points is equal to one, the full width at half maximum (FWHM) of the unique extreme point on the radial average grayscale profile curve is calculated. The full width at half maximum (FWHM) refers to the radial distance width corresponding to half of the maximum grayscale amplitude of the local extreme point. The calculation process is as follows: extract the peak grayscale value of the unique extreme point and divide it by 2 to obtain the FWHM grayscale threshold; on the radial average grayscale profile curve, numerical interpolation search is performed to the left and right of the extreme point to find the left and right intersection points where the grayscale value is equal to the FWHM grayscale threshold; the algebraic difference between the radial distance corresponding to the right intersection point and the radial distance corresponding to the left intersection point is calculated to obtain the full width at half maximum (FWHM).
[0101] A solid ring width threshold is set. This threshold refers to the lower limit of the radial span for determining the validity of continuous bright rings. It is set based on the number of pixels calculated by the magnification of the microscope imaging component after converting the theoretical convergence width of the convex spherical equatorial zone at the current dark field grazing angle. The purpose is to avoid misjudging narrow stray reflection fringes as spherical edge structures. For example, the solid ring width threshold is set to 5 pixels. If the full width at half maximum (FWHM) is greater than or equal to the solid ring width threshold, the entire pixel set of the candidate annular region is registered as a bright solid ring feature contour; if the FWHM is less than the solid ring width threshold, the candidate region is discarded. In the extraction process of the planar dark field scattering image, the corresponding diffraction ring feature contour is output. For spherical dark-field scattering images in the two-sided scattering image set, the same processing logic is used to perform the above-mentioned gradient magnitude calculation, binary gradient mask generation, connected component filtering, and radial average gray-scale profile curve extreme point judgment and full width at half maximum (FWHM) calculation steps, thereby registering the corresponding bright solid ring feature contour in the spherical dark-field scattering image. After registering the diffraction ring feature contour of the planar dark-field scattering image and the bright solid ring feature contour of the spherical dark-field scattering image, the gray-scale weighted geometric center of both is calculated. Specifically, taking the diffraction ring feature contour as an example, the gray-scale value, column coordinate, and row coordinate of each pixel within the feature contour are extracted. The gray-scale value of a single pixel is multiplied by the column coordinate of that pixel to obtain the first product. The first products of all pixels within the feature contour are accumulated to obtain the first accumulated sum. The gray-scale values of all pixels within the feature contour are accumulated to obtain the gray-scale accumulated sum. The first accumulated sum is divided by the gray-scale accumulated sum to calculate the column coordinate of the geometric center. Similarly, the grayscale value of a single pixel is multiplied by its row coordinate to obtain a second product. The second products of all pixels within the feature contour are then summed to obtain a second accumulated sum. This second accumulated sum is divided by the grayscale accumulated sum to calculate the row coordinates of the geometric center. The column and row coordinates of the geometric center of the diffraction ring feature contour are combined to define a planar dynamic optical anchor point. Using the same grayscale weighted geometric center calculation logic, the column and row coordinates of the bright solid ring feature contour are calculated and combined to define a spherical dynamic optical anchor point. The planar and spherical dynamic optical anchor points are collectively referred to as dynamic optical anchor points. These are floating-point pixel coordinate references calculated in real-time according to the actual imaging pose of the microprism under test, used to provide a precise image layer alignment reference when flowing across the curvature working surface.
[0102] Step S22: Construct a cross-curvature space mapping matrix by combining dynamic optical anchor points and mechanical pixel zeros. Use the cross-curvature space mapping matrix to perform coordinate mapping and interpolation operations on the two-sided scattering image set to obtain an aligned response image set.
[0103] After obtaining the planar dynamic optical anchor point and the spherical dynamic optical anchor point, in order to enable the two working surfaces with different curvature properties to be compared in the same coordinate grid, the pixel coordinates of the two-sided scattering image set are reduced to a common grid with the mechanical pixel zero point as the zero point.
[0104] Specifically, for the planar working surface, the planar lateral displacement component, planar longitudinal displacement component, planar scale factor, and in-plane rotation angle are calculated respectively. Specifically, the planar lateral displacement component is obtained by subtracting the column coordinates of the mechanical pixel zero from the column coordinates of the planar dynamic optical anchor point; the planar longitudinal displacement component is obtained by subtracting the row coordinates of the mechanical pixel zero from the row coordinates of the planar dynamic optical anchor point. The circumcircle radius of the annular feature profile obtained during the factory calibration stage using a standard sample at a standard working distance is defined as the reference ring radius; for example, this reference ring radius is set to 800 pixels. The ratio obtained by dividing the circumcircle radius of the extracted diffraction ring feature profile by this reference ring radius is defined as the planar scale factor. Since a positioning cut straight edge is retained around the planar working surface of the microprism under test, straight line detection is performed on the background area far from the edge of the scattered halo in the planar dark-field scattering image, and the set of straight line pixels corresponding to the positioning cut straight edge is extracted and defined as the straight line segment feature. A polar coordinate system is established with the top-left pixel position of the planar dark-field scattering image as the origin. The normal direction of the straight line segment feature is extracted, and the angle between this normal direction and the positive horizontal direction is calculated and defined as the polar angle of the straight line segment feature. The normal angle of the positioning cut straight edge of the standard sample recorded during factory calibration is obtained and defined as the reference edge polar angle. The algebraic difference between the polar angle of the straight line segment feature and the reference edge polar angle is defined as the in-plane rotation angle.
[0105] Based on the plane scale factor, in-plane rotation angle, and the plane lateral and longitudinal displacement components, a curvature space mapping matrix for the planar working surface is constructed. This curvature space mapping matrix is a two-row, three-column real number matrix. The distribution of its elements follows this pattern: the first row contains, in order, the product of the plane scale factor and the cosine of the in-plane rotation angle, the negative of the product of the plane scale factor and the sine of the in-plane rotation angle (multiplied by negative one), and the final lateral translation component; the second row contains, in order, the product of the plane scale factor and the sine of the in-plane rotation angle, the product of the plane scale factor and the cosine of the in-plane rotation angle, and the final longitudinal translation component. The solution logic for the final lateral and longitudinal translation components is as follows: The two-dimensional column and row coordinates of the planar dynamic optical anchor point are arranged in a top-down order to form a two-row, one-column column vector. Using the two-row, two-column matrix on the left side of the cross-curvature space mapping matrix (i.e., the matrix formed by the elements of the first row, first column, first row, second column, second row, first column, and second row, second column of the cross-curvature space mapping matrix), the matrix is multiplied on the left by this two-row, one-column column vector, performing matrix multiplication and addition to obtain a two-row, one-column intermediate coordinate of the anchor point linear transformation. The column coordinates of the mechanical pixel zero point are subtracted from the first row value of this intermediate coordinate to obtain the final lateral translation component. The row coordinates of the mechanical pixel zero point are subtracted from the second row value of this intermediate coordinate to obtain the final longitudinal translation component.
[0106] Before generating the cross-curvature space mapping matrix, a data compliance check is performed: a preset allowable range for the scale factor and an allowable threshold for the in-plane rotation angle are obtained. The allowable range for the scale factor refers to the upper and lower boundary values for determining whether the magnification drift is within an acceptable range. It is set based on the reasonable magnification variation range obtained by converting the axial runout of the attitude-fixing vehicle's rotation axis into depth of field using a microscopic imaging component. For example, the allowable range for the scale factor is set to 0.9 to 1.1. The allowable threshold for the in-plane rotation angle refers to the upper absolute value for determining whether the in-plane rotation is within an acceptable range. It is set based on the angular repeatability tolerance of the mechanical limit block of the attitude-fixing vehicle's rotation axis. For example, the allowable threshold for the in-plane rotation angle is set to 3 degrees. If the planar scale factor falls within the allowable range of the scale factor, and the absolute value of the in-plane rotation angle is less than or equal to the allowable threshold of the in-plane rotation angle, then the cross-curvature space mapping matrix of the working plane is generated according to the above allocation logic; if any of the above conditions are not met, an abnormal alarm is output. The abnormal alarm is a digital communication command or interruption signal used to indicate that the current microprism under test has serious defocusing or attitude fixation vehicle overturning failure.
[0107] For each pixel in the planar dark-field scattering image, its column and row coordinates are extracted, and a constant 1 is appended to the end to form a homogeneous column vector of three rows and one column. A two-dimensional grid coordinate system is constructed with the zero point of the mechanical pixel as the coordinate zero point and having the same coordinate axis direction as the image sensor pixel array, defined as the reference detection coordinate system. The target column coordinates and target row coordinates of the pixel in the reference detection coordinate system are calculated by left-multiplying the homogeneous column vector using the planar cross-curvature space mapping matrix. The target column coordinates and target row coordinates are combined to define the target pixel coordinates. If the target pixel coordinates contain non-integer values, the coordinates of the four adjacent integer grid pixels around the target pixel coordinates and their corresponding gray values are extracted, and an interpolated gray value is calculated using a bilinear interpolation algorithm. The specific calculation process is as follows: Obtain the two adjacent integer column coordinates in the horizontal direction and the two adjacent integer row coordinates in the vertical direction of the target pixel coordinates, forming four integer grid pixels. Extract the grayscale values of these four integer grid pixels in the original planar dark-field scattering image. First, in the horizontal direction, use the distance ratio between the target column coordinates and the two integer column coordinates to perform two linear interpolations on the grayscale values of the upper and lower pairs of integer grid pixels, obtaining two intermediate grayscale values. Then, in the vertical direction, use the distance ratio between the target row coordinates and the two integer row coordinates to perform one linear interpolation on the two intermediate grayscale values, defining the calculated final grayscale value as the interpolated grayscale value. Write this interpolated grayscale value into the grid position corresponding to the target pixel coordinates in the reference detection coordinate system. Traverse all pixels of the planar dark-field scattering image and perform the above matrix mapping and interpolation operations to generate a planar alignment response image. Using the same recalculation logic, obtain a spherical alignment response image. Combine the planar alignment response image and the spherical alignment response image into an alignment response image set.
[0108] Step S20 addresses the technical challenge of spatial coordinate reference failure caused by minute slippage and magnification drift due to physical flipping when switching between the cross-curvature working surfaces of micro-polyhedral optical elements. This is achieved through dynamic optical anchor points, a cross-curvature space mapping matrix, and an aligned response image set. Specifically, the dynamic optical anchor points eliminate the influence of mechanical errors; the cross-curvature space mapping matrix transforms translation, scaling, and in-plane rotation deviations into deterministic mathematical mapping parameters; and the aligned response image set achieves registration of dual-surface optical features under a unified detection reference through coordinate mapping and interpolation.
[0109] Step S30: Extract highlighted connected components based on the aligned response image set, perform defect type decoupling and differentiation on the highlighted connected components to obtain an in-plane defect registration table, calculate asymmetric morphological distortion parameters based on the aligned response image set, and perform defect classification and determination by combining the asymmetric morphological distortion parameters and the in-plane defect registration table to obtain a set of surface defect types.
[0110] Further, step S30 includes:
[0111] Step S31: Extract highlighted connected components based on the aligned response image set, perform defect type decoupling and differentiation on the highlighted connected components, and obtain an in-plane defect registration table.
[0112] After obtaining the aligned response image set, in order to avoid misjudgment due to the scattering characteristics of isolated scattered or continuous linear internal region defects and the scattering halo of edge contours such as the diffraction ring feature contour of the dark field scattering image of the microprism plane or the bright solid ring feature contour of the dark field scattering image of the spherical surface, the defect features and edge contour features inside the image are spatially isolated and decoupled by type.
[0113] Specifically, for the planar alignment response images and spherical alignment response images in the alignment response image set, spatial isolation boundaries based on concentric partitions are established respectively. For the planar working surface, an inward shrinkage ratio and an outward expansion ratio are set; the inward shrinkage ratio and the outward expansion ratio are set based on the ratio of the full width at half maximum (FWHM) of the extreme point in the radial average grayscale profile curve to the radius of the circumscribed circle of the annular feature contour of the microprism under test, with the aim of spatially cutting off the overlapping area of the prism halo and the internal defect scattering; for example, the inward shrinkage ratio is set to 0.92 and the outward expansion ratio is set to 1.05. With the mechanical pixel zero point as the center, a circular region is delineated with the product of the circumscribed circle radius of the diffraction ring feature contour and the inward shrinkage ratio as the radius, and this circular region is defined as the in-plane detection domain; at the same time, with the boundary of this circular region as the inner boundary and the product of the circumscribed circle radius and the outward expansion ratio as the outer boundary, an annular region is delineated, and this annular region is defined as the edge detection zone. After determining the in-plane detection domain, the arithmetic mean and standard deviation of the grayscale values of all pixels within the domain are calculated. A brightness factor is set; the brightness factor refers to the statistical factor used to separate defective bright diffuse scattering pixels from background noise, and its setting is based on the readout noise distribution characteristics of the area array camera in dark field imaging; for example, the brightness factor is set to 4. The arithmetic mean is added to the product of the standard deviation and the brightness factor to calculate the dynamic brightness determination threshold. Pixels with grayscale values greater than the brightness determination threshold within the in-plane detection domain are assigned a value of one, and the remaining pixel positions are assigned a value of zero, generating an in-plane scattering binary map. An eight-neighbor connected component labeling operation is performed on the in-plane scattering binary map to obtain several bright connected components. Specifically, the in-plane scattering binary image is scanned pixel by pixel from left to right and top to bottom. When a pixel with a grayscale value of one and no label is encountered, a new initial label is assigned to it, and the pixel is pushed onto the logic stack as a seed point. A pixel is popped from the logic stack, and its eight adjacent pixels in the eight directions (top left, top right, top right, left, right, bottom left, bottom right, bottom right) are checked sequentially. If an adjacent pixel has a grayscale value of one and no label, it is assigned the same label as the current seed point and pushed onto the logic stack. This popping and checking operation is repeated until the logic stack is empty, thus completing the traversal and labeling of an independent connected component. The image is scanned again until all pixels with a grayscale value of one have been assigned a label. The set of connected pixels with the same label is extracted and defined as a highlighted connected component. After the above full-image scan and connected component traversal, several independent highlighted connected components are extracted. See also... Figure 5This diagram illustrates the concentric partitioning of the in-plane detection domain and edge detection zone according to an embodiment of the present invention. The cross at the center of the diagram is labeled "Mechanical Pixel Zero," serving as the center of the concentric partition. The dashed circle is the "circumcircle of the diffraction ring feature contour," serving as the reference radius for the partition. The shallower inner disk region is labeled "In-plane Detection Domain," its radius obtained by multiplying the circumcircle radius by the inward scaling ratio; the outer gray ring region is the "Edge Detection Zone," its outer boundary obtained by multiplying the circumcircle radius by the outward scaling ratio. In defect decoupling and differentiation scenarios, the scattering of internal defects and the edge halo are prone to grayscale overlap. Delineating the in-plane detection domain with the inward scaling ratio and the edge detection zone with the outward scaling ratio spatially severs the overlapping area of the edge halo and the scattering of internal defects, allowing isolated scattered points or linear internal defects to be processed separately from the edge contour features, reducing the risk of mutual misjudgment.
[0114] For each highlighted connected component, calculate its various morphological topological feature parameters. Specifically, count the number of pixels contained in the highlighted connected component, defined as the total number of pixels. Calculate the centroid coordinates of the highlighted connected component; specifically, sum the column coordinates of all pixels in the highlighted connected component and divide by the total number of pixels to obtain the centroid column coordinates; sum the row coordinates of all pixels in the highlighted connected component and divide by the total number of pixels to obtain the centroid row coordinates; combine the centroid column coordinates and centroid row coordinates to obtain the unique centroid coordinates. Calculate the equivalent circle diameter of the highlighted connected component; specifically, divide the total number of pixels by pi, take the square root of the quotient, and multiply the square root by a constant two to obtain the equivalent circle diameter of the highlighted connected component. Calculate the minimum bounding rectangle of the highlighted connected region, extract the length of the long side and the length of the short side of the minimum bounding rectangle, divide the length of the long side by the length of the short side to calculate the length-to-short side ratio; divide the total number of pixels by the area of the minimum bounding rectangle, that is, divide the total number of pixels by the product of the length of the long side and the length of the short side to calculate the fill rate.
[0115] A minimum effective area threshold is set. This minimum effective area threshold refers to the minimum number of pixels required to be identified as a real physical defect. It is set based on the conversion relationship between the object-space resolution of a single pixel in the microscopic imaging component and the minimum physical size of the defect that can be judged in the product. For example, this minimum effective area threshold is set to 3 pixels. If the total number of pixels in a bright connected region is less than this minimum effective area threshold, the bright connected region is determined to be system shot noise and is discarded without being counted as a defect. If the total number of pixels in the bright connected region is greater than or equal to the minimum effective area threshold, the bright connected region is decoupled and distinguished by defect type, and a morphology distinction threshold and a fill rate threshold are set. The morphology distinction threshold refers to the ratio of the longer side to the shorter side used to distinguish between approximately equiaxial morphologies and elongated morphologies; for example, it is set to 2. The fill rate threshold refers to the minimum area ratio of the bounding rectangle used to distinguish between solid patches and elongated strips; for example, it is set to 0.6.
[0116] If the ratio of the longer side to the shorter side is less than the shape distinction threshold and the fill rate is greater than or equal to the fill rate threshold, it indicates that the bright connected region exhibits an approximately equiaxed patchy appearance. In this case, the Euclidean distance from the centroid coordinates of the current bright connected region to the centroid coordinates of all other bright connected regions is calculated, and the minimum value among all calculated Euclidean distances is extracted. If the minimum value is greater than or equal to three times the diameter of the equivalent circle, the bright connected region is determined to be an isolated and discrete cluster of bright pixels, and it is marked and registered as a contamination pitting defect. See also Figure 6 This is a schematic diagram of a dark-field scattering image of a microprism contamination pitting defect provided in an embodiment of the present invention. Figure 6In the image, within the in-plane detection domain of the microprism end face, a highly isolated, bright circular patch exists in the lower right region outside the diffraction ring, while several small, dot-like diffuse scattering bright spots are scattered in the upper left region. As can be seen from the image, the bright connected region in the lower right has roughly the same scale in both the horizontal and vertical directions, exhibiting a highly symmetrical, approximately equiaxed solid patch shape. Its circumscribed rectangle is almost completely filled by effective scattering pixels. Furthermore, the geometric centroid of this patch maintains a relatively large physical spatial distance from other surrounding discrete points, showing no tendency to extend collinearly along a specific straight line. This visually demonstrates the typical morphological characteristics of contamination pitting defects caused by tiny particles or surface-attached foreign matter in dark-field scattering imaging. If the minimum value is less than three times the diameter of the equivalent circle, all bright connected regions with a minimum value less than this value are grouped into a pixel cluster. The centroid coordinates of each bright connected region within this pixel cluster form a centroid point set, and least-squares linear fitting is performed, with the root mean square value of the fitting residual calculated. Specifically, the arithmetic mean of the column coordinates of all centroids in the centroid set is calculated to obtain the average column coordinates, and the arithmetic mean of the row coordinates of all centroids is calculated to obtain the average row coordinates. The average column coordinate is subtracted from the column coordinate of each centroid to obtain the column deviation, and the average row coordinate is subtracted from the row coordinate of each centroid to obtain the row deviation. The products of the column deviations and row deviations corresponding to each centroid are summed to obtain the cumulative covariance. The squares of the column deviations corresponding to each centroid are summed to obtain the cumulative variance. The cumulative covariance is divided by the cumulative variance to calculate the slope of the fitted line. The intercept of the fitted line is calculated by subtracting the product of the slope and the average column coordinates from the average row coordinates. For each centroid coordinate in the centroid set, the perpendicular spatial distance from that centroid coordinate to the fitted line is calculated using the point-to-line distance formula, serving as the fitting residual for a single centroid. The fitting residuals of all centroids within the pixel cluster are squared and summed, divided by the total number of bright connected regions within the pixel cluster, and the quotient is then squared to obtain the root mean square (RMS) value of the fitting residual. A collinearity residual threshold is set, based on the number of pixels corresponding to the straightness tolerance of the physical scratch in the extension direction during the microprism cutting process, converted by the magnification of the microscopic imaging component; for example, it is set to 1.5 pixels. If the RMS value of the fitting residual is less than or equal to the collinearity residual threshold, the pixel cluster is determined to constitute a discontinuous surface scratch defect and is registered as a whole. If the RMS value of the fitting residual is greater than the collinearity residual threshold, each bright connected region within the pixel cluster is independently registered as a contamination pitting defect.
[0117] If the ratio of the length to the short side is greater than or equal to the morphological distinction threshold and the fill rate is less than the fill rate threshold, it indicates that the highlighted connected region presents a thin, elongated strip shape. See also Figure 7This is a schematic diagram of the dark-field scattering image of a microprism surface scratch defect provided in an embodiment of the present invention. Within the in-plane detection domain defined by concentric partitions, in addition to the inherent concentric diffraction rings and converging halos at the center, a bright yellow, thin, elongated strip of high-brightness diffuse scattering feature extends obliquely from the lower left to the upper right. This feature corresponds to the high-brightness connected region extracted after binarization. As can be seen from the image, its geometric shape shows a significantly longer length in the main extension direction than its cross-sectional width, exhibiting obvious elongated geometric extension characteristics, and its internal pixels occupy a relatively low proportion of the area of the circumscribed rectangular region. After filling the local gaps through morphological closing operations, this high-brightness diffuse scattering strip can be iteratively refined to extract a single-pixel-width skeleton centerline running through its geometric center. The image shows only two end points along this skeleton centerline, intuitively reflecting the optical and geometric characteristics of the continuous linear surface scratch defect in the in-plane. For the highlighted connected region, a morphological closing operation is first performed. Specifically, a square structuring element of a preset size is used to first perform a dilation operation on the outer edge pixels of the highlighted connected region to expand the highlighted area, and then an erosion operation of the same size is performed to reduce the redundant edges. The size of the preset-sized square structural element is set based on the number of pixels corresponding to the expected maximum physical scratch fracture width. For example, it is set as a square pixel matrix consisting of 3 rows and 3 columns of pixels, where the rows and columns directly correspond to the vertical pixel row distribution and horizontal pixel column distribution in the two-dimensional image coordinate system, respectively. The dilation operation involves iterating through all background pixels surrounding the bright connected region corresponding to the center of the square structural element. If the area covered by the square structural element contains at least one foreground pixel with a grayscale value of one, the grayscale value of the background pixel corresponding to the center is changed from zero to one, thereby expanding the boundary of the bright region outwards. The erosion operation of the same size involves iterating through all foreground pixels within the expanded bright region corresponding to the center of the same-sized square structural element. If the area covered by the square structural element contains at least one background pixel with a grayscale value of zero, the grayscale value of the foreground pixel corresponding to the center is changed from one to zero, thereby peeling away the expanded excess non-fracture boundary. This achieves effective pixel filling of fracture gaps with a grayscale value of zero caused by uneven local illumination or extremely fine scratches within the bright connected region. Then, morphological skeleton extraction is performed to obtain foreground pixels with a gray value of one that are directly adjacent to background pixels with a gray value of zero in the bright connected region after the closing operation, and these pixels are defined as outer contour pixels. The outer contour pixels are iterated repeatedly to determine whether each outer contour pixel is a deletable pixel.If deleting the outer contour pixel, i.e., changing its grayscale value from one to zero, causes a previously interconnected bright connected region to break and split into two or more non-intersecting connected parts, or creates a new hole surrounded by background pixels inside the originally hole-free bright connected region, then the deletion operation is determined to have destroyed the topological connectivity of the original bright connected region. If deleting the outer contour pixel does not destroy the topological connectivity of the original bright connected region, and the pixels at both ends of the connected region are not reduced, i.e., the main extension length of the connected region is not shortened, then the outer contour pixel is determined to be a deletable pixel, and its grayscale value is changed from one to zero, thereby achieving iterative stripping of the outer contour pixel. Repeat the iterative stripping operation on the outer contour pixels as described above, and the pixel width of the highlighted connected region will decrease layer by layer; until the pixel width of the entire highlighted connected region in any normal cross-sectional direction is reduced to and remains only one pixel wide, so that there are no more outer contour pixels that can be deleted, the stripping operation terminates; the original highlighted connected region is completely stripped and refined into a connected, unbroken line of pixels with a width of one pixel, defined as the skeleton centerline. See also. Figure 8 This diagram illustrates the skeleton extraction process before and after the present invention. On the left side of the diagram, the two gray stripes with gaps in the middle are labeled before the closing operation. The gaps are marked as fracture gaps, indicating fractures with zero grayscale caused by uneven local lighting or extremely fine scratches. The arrow in the middle is labeled as the morphological closing operation, indicating that expansion followed by erosion fills the fracture gaps. On the right side of the diagram, the single-pixel-wide thin line running through the continuous strips after filling is labeled as the skeleton centerline. The solid points at its two ends are labeled as "endpoints," and the hollow squares at the intersection of the three lines are branch points. In surface scratch defect recognition scenarios, scratches often present as discontinuous, elongated shapes. By first closing the fracture gaps and then iteratively peeling and refining them into single-pixel-wide skeleton centerlines, the scratch direction can be uniformly described while maintaining topological connectivity. By statistically analyzing the endpoints and branch points, it is possible to determine whether the scratch is a single line or multiple branches, and to classify and register them accordingly, providing a stable basis for scratch length measurement.
[0118] The total number of pixels along the center line of the skeleton is used as the scratch length, and the number of endpoints along the center line is also counted. Specifically: for each pixel along the center line of the skeleton, the number of adjacent pixels with a gray value of 1 in their eight-neighborhood is counted. If the number of adjacent pixels is equal to 1, the pixel is identified as an endpoint. The total number of pixels identified as endpoints along the center line of the skeleton is counted to obtain the endpoint count. If the endpoint count is equal to 2, the highlighted connected region is directly registered as a surface scratch defect. If the endpoint count is greater than 2, the skeleton branch point on the center line of the skeleton where the number of adjacent pixels with a gray value of 1 in their eight-neighborhood is greater than 2 is used as the breakpoint to split the center line of the skeleton into multiple independent branches, and each independent branch is registered as a surface scratch defect. If the ratio of the length to the short side is greater than or equal to the morphological distinction threshold and the fill rate is greater than or equal to the fill rate threshold, the highlighted connected region is identified as an area-type attached foreign object, which is marked and registered as a contamination pitting defect. The entries for contamination pitting defects and surface scratch defects are summarized, and the type label, centroid coordinates in the reference detection coordinate system, morphological size value, and peak gray value of each defect entry are recorded to obtain an in-plane defect registration table corresponding to the planar working surface. The specific rules for recording the morphological size value are as follows: if the type label of the defect entry is contamination pitting defect, its morphological size value is recorded as the total number of pixels corresponding to the defect; if the type label of the defect entry is surface scratch defect, its morphological size value is recorded as the scratch length corresponding to the defect. The scratch length refers to the total number of pixels contained on the center line of the skeleton with a single pixel width generated after morphological skeleton extraction of the highlighted connected region. The peak gray value refers to the maximum gray value of all pixels in the highlighted connected region corresponding to the defect in the planar alignment response image. The type label is a classification identifier used to indicate whether the current defect entry belongs to a contamination pitting defect or a surface scratch defect. For the spherical alignment response images in the alignment response image set, the same processing logic is used to generate an in-plane defect registration table corresponding to the spherical working surface. Summarize the in-plane defect registration forms for both working surfaces.
[0119] Step S32: Calculate asymmetric morphological distortion parameters based on the aligned response image set, and perform defect classification and determination by combining the asymmetric morphological distortion parameters with the in-plane defect registration table to obtain a set of surface defect types.
[0120] After obtaining the in-plane defect registration form, it is determined whether there is material missing at the physical edge of the microprism to be tested. This avoids missing chipping defects located at the physical edge of the component based solely on the topological morphology in the in-plane defect registration form. The geometric integrity of the edge profile is independently evaluated within the edge detection zone that is spatially isolated from the in-plane detection domain.
[0121] Specifically, for the planar working surface, within the edge detection band corresponding to the planar alignment response image, 720 radial rays are generated with the zero point of the mechanical pixel in the reference detection coordinate system as the pole, at an angle step of 0.5 degrees. Along each radial ray, with a step size of one pixel, the grayscale value of the ray in the planar alignment response image is collected pixel by pixel from the inner boundary to the outer boundary; the maximum grayscale value among all the collected grayscale values on the radial ray is extracted. If the maximum grayscale value is greater than the brightness determination threshold recalculated based on the pixels within the edge detection band, the Euclidean distance from the pixel location of the maximum grayscale value to the pole is calculated, and this Euclidean distance is recorded as the boundary scattering radius of that angle; if the maximum grayscale value is less than or equal to the brightness determination threshold, the edge scattering halo in that angle direction is determined to be interrupted, the boundary scattering radius corresponding to that angle is assigned a null value, and the angle is marked as the contour break angle. The 720 angles and their corresponding boundary scattering radii are formed into a binary sequence and arranged in ascending order of angle to obtain the boundary scattering light contour. From the boundary scattered light profile, extract the set of pixels corresponding to all angles where the boundary scattering radius is not null. Perform least-squares circle fitting on this set of pixels to obtain the coordinates of the fitted circle center and the radius of the fitted circle. The fitted circle center coordinates and the fitted circle radius refer to the two-dimensional position and scale of the center of the optimal circle, based on the least-squares optimization criterion, which minimizes the sum of the squares of the geometric distance deviations from the center of all pixels in the extracted pixel set. They represent the complete physical boundary shape of the current working surface under the condition of no local material loss. The fitted circle center coordinates are defined as the theoretical reference boundary circle center, and the fitted circle radius is defined as the theoretical reference boundary radius.
[0122] To quantify the asymmetric distortion caused by unilateral material loss, 720 angles in the boundary scattered light profile were paired according to the symmetry of the circumference diameter. Specifically, for any angle, 180 degrees was added to obtain the corresponding symmetrical angle, forming a diameter-symmetrical pair. Effective angle pairs were selected where both sides of the diameter-symmetrical pair had non-nullable boundary scattering radii, and the number of such effective angle pairs was counted. The boundary scattering radii corresponding to the two angles in each effective angle pair were extracted, and the absolute value of their difference was calculated. The absolute values of the differences of all effective angle pairs were summed, divided by the theoretical baseline boundary radius, and finally divided by the number of effective symmetrical angle pairs to calculate the asymmetric morphological distortion parameter. This asymmetric morphological distortion parameter is a dimensionless scalar used to measure the degree of radial imbalance in the boundary scattered light profile along the diameter direction. The calculation is based on the fact that when a perfectly symmetrical edge undergoes overall translation or overall magnification, the boundary scattering radii at both ends of the diameter increase or decrease synchronously, and the absolute value of their difference always approaches zero; while edge or corner chipping is a unilateral material loss, causing only one side's radius to collapse, and the absolute value of the difference between the two ends of the diameter is magnified, thus enabling the separation of asymmetric material loss from overall pose shift. A zero distortion rate threshold and a chipping angle span threshold are set. The zero distortion rate threshold refers to the upper limit of the value used to determine whether the asymmetric distortion parameter is at zero in an engineering sense. It is set based on the ratio of the roundness tolerance of the qualified cutting edge to the object size of a single pixel in the microscopic imaging component. The purpose is to prevent radius jitter caused by quantization noise from being judged as material loss. For example, the zero distortion rate threshold is set to 0.004. The chipping angle span threshold refers to the angle span value used to distinguish between localized peeling at the corner point and continuous loss extending along the edge. It is set based on the nominal central angle occupied by the cutting edge of the microprism under test in the circumferential direction. For example, the chipping angle span threshold is set to 8 degrees. A fracture angle interval is defined, which is the set of angles where the contour fracture angle appears continuously in the circumferential direction.
[0123] Edge defects are classified and output using mutually exclusive decision branches. The first decision branch: if the asymmetric morphological distortion parameter is greater than the zero distortion rate threshold, and the number of contour break angles is greater than zero, then all contour break angles are clustered according to angular continuity: if the algebraic difference between two adjacent contour break angles is less than or equal to 1 degree, they are grouped into the same break angle interval; thus generating several independent break angle intervals. For each break angle interval, the angle span is obtained by subtracting the starting angle from the ending angle; simultaneously, within this break angle interval, for each contour break angle, the maximum gray value among all gray values on the radial ray is extracted, and the Euclidean distance from the pixel location of the maximum gray value to the pole is calculated, defined as the residual scattering radius; the residual scattering radius is subtracted from the theoretical reference boundary radius to obtain the indentation depth, and the maximum value among all indentation depths within this interval is taken as the chipping depth. If the angle span of this break angle interval is less than or equal to the chipping angle span threshold, then this break angle interval is determined and output as a physical chipping defect; see [link to relevant documentation]. Figure 9This is a schematic diagram of dark-field scattering images of physical corner breakage defects in a microprism provided in an embodiment of the present invention. After multi-directional dark-field grazing and maximum projection, the boundary scattered light profile of the microprism under test generally presents a closed square frame shape. However, in the lower right corner region, the edge scattered halo shows obvious inward collapse and local interruption, forming a triangular missing contour breakage region. As can be seen from the figure, the angular span occupied by this contour breakage region in the circumferential direction is small, concentrated near the corner inflection point, forming a local breakage angle interval. At the same time, due to the missing corner on one side, the extracted boundary scattering radius at this location is severely reduced compared to the complete corner on the opposite side, presenting a radius imbalance in the symmetrical direction of the diameter. This causes the asymmetric morphological distortion parameter to be obviously non-zero, which physically characterizes the physical corner breakage defect of the microprism. If the angular span of this breakage angle interval is greater than the corner breakage angle span threshold, then the breakage angle interval is determined and output as a physical edge breakage defect. The second decision branch: If the asymmetric distortion parameter is greater than the zero distortion rate threshold, and the number of contour breakage angles is zero, then it is determined that the working surface edge has not experienced local material loss, but rather that there is an overall form and position machining error, and a form and position deviation alarm is output. The form and position deviation alarm refers to a digital communication identifier triggered to indicate that the overall contour size or roundness tolerance of the microprism under test does not meet the process standard requirements. The third decision branch: If the asymmetric distortion parameter is less than or equal to the zero distortion rate threshold, and the number of contour breakage angles is greater than zero, then the in-plane defect registration table is checked to see if there is a contamination pit defect whose centroid coordinates are located on the radial ray corresponding to the contour breakage angle and whose radial distance from the inner boundary of the edge detection zone is less than a preset number of pixels. If it exists, then the contour breakage is determined to be a false breakage caused by edge-attached contamination occlusion, the contour breakage angle is removed, and its corresponding contamination pit defect is marked as edge-attached contamination. If it does not exist, then the contour breakage angle is marked as an anomaly to be re-inspected. The preset pixel count is set based on the number of pixels corresponding to the maximum measured diffusion radius of the scattered halo generated by the foreign object in the dark field image. For example, the preset pixel count is set to 3 pixels. Edge attachment contamination refers to a label indicating that the fracture artifact is caused by surface foreign objects obscuring edge reflection. The pending re-inspection anomaly refers to a scheduling flag indicating that the system cannot confirm the cause of the fracture through the current frame image data and needs to re-trigger the acquisition and judgment process. Fourth judgment branch: If the asymmetric morphological distortion parameter is less than or equal to the distortion rate zero judgment threshold, and the number of contour fracture angles is equal to zero, then the working surface edge is judged to be intact, and a conclusion of no edge chipping defects is output. The conclusion of no edge chipping defects refers to a normal result identifier indicating that the physical edge of the microprism under test is complete and qualified.For the spherical alignment response images in the alignment response image set, the same processing logic is used to generate the spherical boundary scattered light profile within the corresponding edge detection band. Its asymmetric morphological distortion parameters are calculated, and the same decision branch is executed to extract the edge defect entries of the spherical working surface. All contamination pitting defects, surface scratches, physical edge chipping defects, and physical corner chipping defects output from both the planar and spherical working surfaces are summarized to obtain a surface defect type set. This surface defect type set refers to a structured data set containing all in-plane and edge defect feature information and decision labels of the microprism under test. See also. Figure 10 This is a schematic diagram of the dark-field scattering image of a qualified microprism sample provided in an embodiment of the present invention. The qualified microprism sample exhibits a highly regular and symmetrical optical response in the dark-field scattering image: the outer periphery cut straight edges within the outer edge detection zone are continuous and complete, without any local defects or inward breaks; the four corners have distinct transitions and complete edges; continuous boundary diffuse scattering peaks can be stably detected on each radial ray generated in the circumferential direction, ensuring a high degree of dimensional balance in the entire boundary scattered light profile along the 180-degree diametrically symmetrical direction; simultaneously, within the in-plane detection domain, apart from the bright purple dot-shaped diffraction rings and high-brightness concentric circles distributed in a circular symmetry pattern at the center, there are no redundant isolated bright spots or linear diffuse scattering high-brightness connected regions, presenting an overall qualified benchmark state with intact physical edges and a clean, defect-free surface.
[0124] Step S30 solves the technical problem of signal superposition between micron-level defect scratch scattering features and physical chipping distortion features in the edge halo region, which leads to the failure of cross-working surface micro-defect classification and extraction, by using the in-plane defect registration table and the surface defect type set. Among them, the in-plane defect registration table realizes the spatial isolation and classification of internal region defects and edge contour features by using morphological topological features, and the surface defect type set realizes the confirmation and identification of physical chipping edge defects and chipping corner defects based on the joint judgment of asymmetric morphological distortion parameters and the in-plane defect registration table.
[0125] Example 2
[0126] This embodiment, based on Embodiment 1, provides a multi-directional dark field detection system for chipped edges from microprism cutting, such as... Figure 11 As shown, it includes:
[0127] The pose locking module is used to position the microprism under test at the inspection station of the attitude fixation vehicle, establish the mechanical pixel zero point through the attitude fixation vehicle, perform grazing on the end face of the microprism under test, collect and perform maximum value projection of the image sequence to obtain a set of two-sided scattering images.
[0128] Curvature Image Module: Used to analyze and extract feature contours from a two-sided scattering image set to obtain dynamic optical anchors. The dynamic optical anchors and mechanical pixel zeros are combined to construct a cross-curvature space mapping matrix. The cross-curvature space mapping matrix is used to perform coordinate mapping and interpolation operations on the two-sided scattering image set to obtain an aligned response image set.
[0129] Defect determination module: It is used to extract highlighted connected components based on the aligned response image set, perform defect type decoupling and differentiation on the highlighted connected components, obtain an in-plane defect registration table, calculate asymmetric morphological distortion parameters based on the aligned response image set, and perform defect classification determination by combining the asymmetric morphological distortion parameters and the in-plane defect registration table to obtain a set of surface defect types.
[0130] In the pose locking module, the microprism under test is positioned at the detection station of the attitude-fixing vehicle, the mechanical pixel zero point is established through the attitude-fixing vehicle, grazing is performed on the end face of the microprism under test, and the maximum value projection of the image sequence is acquired and performed to obtain a two-sided scattering image set, including:
[0131] Step S11: Position the microprism to be tested at the testing station of the attitude fixation vehicle, and establish the mechanical pixel zero point through the attitude fixation vehicle.
[0132] Step S12: Perform grazing reflection on the end face of the microprism to be measured, acquire and perform maximum projection of the image sequence to obtain a two-sided scattering image set.
[0133] In the curvature image module, the two-sided scattering image set is analyzed and its feature contours are extracted to obtain dynamic optical anchor points. A cross-curvature space mapping matrix is constructed by combining the dynamic optical anchor points and mechanical pixel zeros. The cross-curvature space mapping matrix is then used to perform coordinate mapping and interpolation operations on the two-sided scattering image set to obtain an aligned response image set, including:
[0134] Step S21: Analyze and extract feature contours from the two-sided scattering image set to obtain dynamic optical anchor points;
[0135] Step S22: Construct a cross-curvature space mapping matrix by combining dynamic optical anchor points and mechanical pixel zeros. Use the cross-curvature space mapping matrix to perform coordinate mapping and interpolation operations on the two-sided scattering image set to obtain an aligned response image set.
[0136] In the defect determination module, the process involves extracting highlighted connected components based on the aligned response image set, performing defect type decoupling and differentiation on these components to obtain an in-plane defect registration table, calculating asymmetric morphological distortion parameters based on the aligned response image set, and combining these parameters with the in-plane defect registration table to perform defect classification and determination, resulting in a set of surface defect types, including:
[0137] Step S31: Extract the bright connected components based on the aligned response image set, perform defect type decoupling and differentiation on the bright connected components, and obtain the in-plane defect registration table;
[0138] Step S32: Calculate asymmetric morphological distortion parameters based on the aligned response image set, and perform defect classification and determination by combining the asymmetric morphological distortion parameters with the in-plane defect registration table to obtain a set of surface defect types.
[0139] In addition, the parts of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of the corresponding technical solutions in the prior art have not been described in detail, so as to avoid excessive elaboration.
[0140] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely preferred embodiments of the present invention, and the scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A multi-directional dark field detection method for chipped edges from microprism cutting, characterized in that, The method includes: The microprism under test is positioned at the inspection station of the attitude-fixed vehicle. The mechanical pixel zero point is established through the attitude-fixed vehicle. Grazing is performed on the end face of the microprism under test. The maximum value projection of the image sequence is collected and executed to obtain a set of two-sided scattering images. The two-sided scattering image set is analyzed and feature contours are extracted to obtain dynamic optical anchors. The dynamic optical anchors and mechanical pixel zeros are combined to construct a cross-curvature space mapping matrix. The cross-curvature space mapping matrix is used to perform coordinate mapping and interpolation operations on the two-sided scattering image set to obtain an aligned response image set. Highlighted connected components are extracted from the aligned response image set. Defect type decoupling and differentiation are performed on the highlighted connected components to obtain an in-plane defect registration table. Asymmetric morphological distortion parameters are calculated based on the aligned response image set. Defect classification and determination are performed by combining the asymmetric morphological distortion parameters and the in-plane defect registration table to obtain a set of surface defect types.
2. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 1, characterized in that, The method for establishing the zero point of the mechanical pixel includes: The microprism to be tested is acquired and loaded onto the testing station of the attitude-fixed vehicle. The pneumatic push rod is controlled to apply pushing force to the three orthogonal physical limiting surfaces in the microprism to be tested in sequence and the three-way contact pressure values are obtained in real time. Obtain the preset bonding pressure range. If the three contact pressure values fall within the bonding pressure range, then establish a three-dimensional rectangular coordinate system with three orthogonal physical limiting surfaces, and define the intersection of the three orthogonal physical limiting surfaces in the three-dimensional rectangular coordinate system as the origin of the mechanical coordinate system. Obtain the hand-eye mapping parameter matrix, extract the three-dimensional coordinate values of the origin of the machine coordinate system and add a constant to form the target column vector. Calculate the three-dimensional column vector by left-multiplying the target column vector using the hand-eye mapping parameter matrix. After homogenization and normalization, extract the horizontal pixel column coordinate values and combine them with the vertical pixel row coordinate values to form the machine pixel zero point.
3. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 1, characterized in that, The method for acquiring the two-sided scattering image set includes: The spatial angle time sequence is obtained, and the microscopic imaging component and the dark field illumination source with multiple independently on and off azimuth sectors are controlled. The single azimuth sector is cyclically connected and the exposure is triggered according to the spatial angle time sequence to obtain a set of single azimuth scattering images of the current working surface. Construct a two-dimensional image coordinate system. For each pixel coordinate position in the two-dimensional image coordinate system, extract the gray value of each frame of single-directional scattering image at that pixel coordinate position, filter out the maximum gray value and assign it to obtain the planar dark field scattering image. The attitude-fixing vehicle is controlled to rotate the microprism under test so that the convex spherical working surface of the microprism is facing the microscopic imaging component. The cyclic acquisition and assignment operation is performed again to generate a spherical dark field scattering image, which is then combined with the planar dark field scattering image to form a two-sided scattering image set.
4. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 3, characterized in that, The method for obtaining the dynamic optical anchor point includes: For each pixel location in the planar dark field scattering image, the gradient magnitude is calculated, combined into a gradient magnitude map, and a gray-level histogram of the gradient magnitude map is constructed. Set a traversal threshold, calculate the inter-class variance of the grayscale histogram under different traversal thresholds, select the traversal threshold that makes the inter-class variance reach the maximum value as the gradient segmentation threshold, and generate a binary gradient mask. The eight-neighbor connected component labeling operation is performed on the binary gradient mask to obtain each connected component. The minimum circumcircle fitting is performed on the set of edge contour coordinates in each connected component to obtain the circumcircle radius. The number of grids occupied by the circle and the radial thickness in the polar coordinate system are counted. Divide the radial thickness by the radius of the circumscribed circle to obtain the radial flatness ratio. If the number of grids occupied by the circumference is greater than or equal to the preset circumference continuity threshold and the radial flatness ratio is less than the preset radial flatness ratio threshold, then the connected region is registered as a ring-shaped candidate region.
5. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 4, characterized in that, The method for obtaining dynamic optical anchor points further includes: Obtain the coordinates of the circumcircle's center and use them as a reference point to generate multiple radial rays. Calculate the arithmetic mean of pixel grayscale values at the same radial distance and combine them into a radial average grayscale profile curve. The number of local extreme points on the radial average grayscale profile curve is counted. If the number of local extreme points is greater than or equal to two, the target extreme point with the largest corresponding radial distance value is selected, and the set of all connected pixels within the radius position and the preset extension range of the target extreme point is registered as the diffraction ring feature contour. If the number of local extrema is equal to one, calculate the full width at half maximum (FWHM) of the local extrema. If it is greater than or equal to the preset solid ring width threshold, register the entire set of pixels in the ring-shaped candidate region as a bright solid ring feature contour and register the corresponding bright solid ring feature contour in the spherical dark field scattering image. The column and row coordinates of the geometric center of each feature contour are calculated separately and combined to form planar dynamic optical anchor points and spherical dynamic optical anchor points, collectively referred to as dynamic optical anchor points.
6. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 5, characterized in that, The method for constructing the transcurvature space mapping matrix includes: Subtract the column coordinates and row coordinates of the mechanical pixel zero from the column coordinates and row coordinates of the planar dynamic optical anchor point to obtain the planar lateral displacement component and the planar longitudinal displacement component. Set the reference ring radius, divide the radius of the circumcircle of the diffraction ring feature profile by the reference ring radius to obtain the plane scale factor; extract the polar angle of the straight line segment feature corresponding to the positioning cut straight edge in the plane dark field scattering image, and subtract the preset reference edge polar angle to obtain the in-plane rotation angle. If the plane scale factor falls within the preset scale factor allowable range and the absolute value of the in-plane rotation angle is less than or equal to the preset in-plane rotation angle allowable threshold, then a two-row, two-column matrix is constructed using the trigonometric functions of the plane scale factor and the in-plane rotation angle, and the intermediate coordinates of the anchor point linear transformation are obtained by left multiplying the column vector composed of the coordinates of the plane dynamic optical anchor point. Subtracting the intermediate coordinates of the anchor point linear transformation from the zero-point coordinates of the mechanical pixel, and combining them, yields the cross-curvature space mapping matrix.
7. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 6, characterized in that, The method for obtaining the alignment response image set includes: Extract the column and row coordinates of pixels in the planar dark field scattering image and supplement them with a constant to form a homogeneous column vector of three rows and one column. Construct a reference detection coordinate system with the zero point of the mechanical pixel as the coordinate zero point. By left-multiplying the homogeneous column vector by the cross-curvature space mapping matrix, the target column coordinates and target row coordinates in the reference detection coordinate system are calculated and combined to define the target pixel coordinates. If the target pixel coordinates contain non-integer values, extract the gray values of the four adjacent integer grid pixels in the original planar dark field scattering image, perform linear interpolation in the horizontal and vertical directions to calculate the interpolated gray values, and write them into the grid position corresponding to the target pixel coordinates. Then, iterate through the grids to generate a planar aligned response image. The same recalculation logic is used to generate spherical alignment response images, and the planar alignment response images are combined with the spherical alignment response images to form an alignment response image set.
8. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 7, characterized in that, The method for obtaining the highlighted connected component includes: Set the shrinkage ratio and the expansion ratio. With the mechanical pixel zero point as the center, the circular in-plane detection area is defined by the product of the radius of the outer circle of the diffraction ring feature contour and the shrinkage ratio. The annular edge detection zone is defined by the product of the radius of the outer circle and the expansion ratio. Calculate the arithmetic mean and standard deviation of the grayscale values of all pixels in the in-plane detection domain, set the brightness ratio, and calculate the brightness judgment threshold based on the arithmetic mean, standard deviation and brightness ratio; The pixel positions in the in-plane detection domain whose gray values are greater than the highlight determination threshold are assigned a value of one, an in-plane scattering binary map is generated, and an eight-neighbor connected component labeling operation is performed on the in-plane scattering binary map. Set a minimum effective area threshold, extract the set of connected pixels in the in-plane scattering binary image whose total number of pixels is greater than or equal to the minimum effective area threshold, and obtain several independent highlighted connected regions.
9. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 8, characterized in that, The method for obtaining the in-plane defect registration form includes: Calculate the centroid coordinates, equivalent circle diameter, length-to-short side ratio, and fill rate of the highlighted connected component, and set the shape discrimination threshold and fill rate threshold. If the ratio of the length to the short side is less than the shape distinction threshold and the fill rate is greater than or equal to the fill rate threshold, it is registered as a contamination pit defect when the minimum Euclidean distance from the centroid coordinates of the other highlighted connected domains is greater than or equal to three times the equivalent circle diameter; when it is less than three times, the vertical spatial distance from the centroid of a single centroid to the fitted line is calculated as the fitting residual. If the root mean square value of the fitting residual is less than or equal to the preset collinear residual threshold, it is registered as a surface scratch defect as a whole; otherwise, it is registered as a contamination pit defect independently. If the ratio of the length to the short side is greater than or equal to the shape distinction threshold and the fill rate is less than the fill rate threshold, then a closing operation is performed to obtain the skeleton centerline. The number of pixels of the skeleton centerline is counted as the scratch length and then divided and registered as a surface scratch defect. If both the ratio of the length to the short side and the fill rate are greater than or equal to the corresponding threshold, then it is registered as a contamination pit defect. The in-plane defect registration table is then obtained by summarizing the data.
10. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 8, characterized in that, The calculation method for the asymmetric morphological distortion parameters includes: Multiple radial rays are generated within the edge detection zone with the zero point of the mechanical pixel as the pole, and the maximum gray value of each ray is extracted. If the maximum gray value is greater than the highlight determination threshold, the Euclidean distance from the pixel position where the maximum gray value is located to the extreme point is recorded as the boundary scattering radius; otherwise, the boundary scattering radius is assigned a null value and marked as the contour break angle, and the boundary scattering light contour is obtained by arranging them. Extract the set of pixels in the boundary scattered light profile whose boundary scattering radius is not null, perform least squares circle fitting, and obtain the theoretical reference boundary radius; Two angles 180 degrees apart are paired symmetrically in diameter. Valid angle pairs are selected where the scattering radii of both sides are not null, and the number of valid symmetrical angle pairs is counted. The asymmetric morphological distortion parameters are calculated by summing the absolute values of the differences between the scattering radii on both sides of the effective angle pairs, and then dividing them by the theoretical reference boundary radius and the number of effective symmetric angle pairs.
11. The multi-directional dark field detection method for chipped edges in microprism cutting according to claim 10, characterized in that, The method for obtaining the set of surface defect types includes: Set a zero distortion rate threshold and a break angle span threshold; If the asymmetric shape distortion parameter is greater than the distortion rate zero judgment threshold and the number of contour break angles is greater than zero, the adjacent contour break angles are clustered into break angle intervals. If the angle span of the break angle interval is less than or equal to the break angle span threshold, a physical break angle defect is output; otherwise, a physical edge break defect is output. If the asymmetric distortion parameter is greater than the zero distortion rate judgment threshold and the number of contour breakage angles is zero, output a shape and position deviation alarm. If the asymmetric morphological distortion parameter is less than or equal to the distortion rate zero judgment threshold and the number of contour break angles is greater than zero, it is marked as edge attachment contamination; otherwise, it is marked as an abnormality to be re-inspected. If the asymmetric shape distortion parameter is less than or equal to the zero distortion rate judgment threshold and the number of contour breakage angles is zero, it is determined that there is no edge chipping defect. Summarize all defect entries to obtain a set of surface defect types.
12. A multi-directional dark-field detection system for microprism cutting edge chipping, used to implement the multi-directional dark-field detection method for microprism cutting edge chipping as described in any one of claims 1-11, characterized in that, The system includes: The pose locking module is used to position the microprism under test at the inspection station of the attitude fixation vehicle, establish the mechanical pixel zero point through the attitude fixation vehicle, perform grazing on the end face of the microprism under test, collect and perform maximum value projection of the image sequence to obtain a set of two-sided scattering images. Curvature Image Module: Used to analyze and extract feature contours from a two-sided scattering image set to obtain dynamic optical anchors. The dynamic optical anchors and mechanical pixel zeros are combined to construct a cross-curvature space mapping matrix. The cross-curvature space mapping matrix is used to perform coordinate mapping and interpolation operations on the two-sided scattering image set to obtain an aligned response image set. Defect determination module: It is used to extract highlighted connected components based on the aligned response image set, perform defect type decoupling and differentiation on the highlighted connected components, obtain an in-plane defect registration table, calculate asymmetric morphological distortion parameters based on the aligned response image set, and perform defect classification determination by combining the asymmetric morphological distortion parameters and the in-plane defect registration table to obtain a set of surface defect types.
