Ranging TOF lens assembly process
Through real-time signal feedback and multi-directional displacement adjustment, the spot offset trend is accurately judged, which solves the problem of large assembly errors in traditional lens assembly, and realizes stable assembly and consistency evaluation of high-precision lens components, improving ranging accuracy and signal reliability.
Patent Information
- Application Number
- CN202510676597.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-25
- Publication Date
- 2025-07-08
AI Technical Summary
The assembly process of traditional ranging TOF lenses relies on manual experience, resulting in large assembly errors and the inability to accurately judge focus deviations, which affects the equipment ranging accuracy and system reliability.
By obtaining the effective response point coordinate set of TOF reflection area, calculating the spot offset trend, performing multi-directional displacement adjustment, judging the optical axis offset consistency based on grayscale changes, generating a focus locked axial parameter value group to achieve high-precision assembly of lens components.
Significantly improve the assembly accuracy and stability of the lens, reduce assembly error to ±5μm, improve the uniformity of the light intensity distribution and ranging signal stability of the imaging target surface, and ensure stable optical ranging accuracy and performance.
Smart Images

Figure CN120276170A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lens assembly, and in particular to a ranging TOF lens assembly process. Background Art
[0002] The technical field of lens assembly mainly involves the positioning, calibration, fixation of lens components in optical systems and their process control, and is widely used in high-precision devices such as optical imaging, sensing detection, and laser projection. This field focuses on the relative position accuracy between lenses and other optical elements, optical axis alignment, optical path control, and the stability of mechanical structures, and involves core technologies such as multi-axis adjustment platforms, automatic or semi-automatic assembly equipment, vision-assisted calibration systems, dispensing and curing processes. Lens assembly needs to achieve micron-level assembly error control in applications to meet the system requirements of highly sensitive optical performance such as laser ranging, image acquisition, and three-dimensional recognition, and is an important basic link in the precision manufacturing of modern optoelectronic systems.
[0003] Among them, the ranging TOF lens assembly process is a high-precision lens component assembly method applied to the TOF time-of-flight ranging system, aiming to achieve the optimal matching of the TOF signal emission and reception paths. This process ensures that the reflected signal intensity reaches the optimum at the set ranging distance through high-precision adjustment, real-time signal feedback control, and stable fixation means, thereby guaranteeing the ranging accuracy and consistency of the entire TOF system. Such processes are widely used in scenarios that require highly reliable optical alignment, such as vehicle-mounted intelligent systems, industrial ranging equipment, and consumer-grade three-dimensional sensing modules.
[0004] When the traditional assembly process determines the best assembly position of the lens and the optical axis, it relies on manual experience or simple image observation to judge the focusing deviation. The traditional process will result in an assembly error of ±50μm. There is a lack of objective real-time quantification indicators to characterize the offset direction and degree of the actual light spot, and no clear multi-directional offset trend analysis mechanism is established. It is impossible to accurately judge and eliminate the focusing error caused by excessive or insufficient adjustment, resulting in difficulty in effectively controlling the specific amplitude of the assembly position deviation, causing fluctuations in the consistency of the optical axis alignment of the lens component. Without the specific quantitative analysis basis of the light spot stability gray difference value, the positioning of the optical component is uncertain, which easily leads to uneven distribution of the light spot response intensity on the imaging target surface, causing fluctuations and inconsistencies in the laser signal echo in the actual working environment, and affecting the ranging accuracy of the equipment and the overall reliability performance of the system. Summary of the Invention
[0005] The purpose of the present invention is to solve the drawbacks existing in the prior art, and to propose a ranging TOF lens assembly process.
[0006] To achieve the above purpose, the present invention adopts the following technical solutions: A ranging TOF lens assembly process includes the following steps:
[0007] S1: Obtain the signal reflection image generated when the TOF laser emission module is aligned with the reflection target surface in the preliminary adjustment state, screen the response point set with energy higher than the mean background noise in the four quadrant regions, and generate the coordinate set of effective response points in the TOF reflection region;
[0008] S2: Based on the coordinate set of effective response points in the TOF reflection region, calculate the Euclidean distance difference between the maximum edge offset point and the center point within the pixel matrix according to the distribution intervals of the horizontal and vertical edge coordinates on the four sides, determine whether there is a spot offset trend, and generate the reflection response boundary offset direction and amplitude identifier;
[0009] S3: Based on the reflection response boundary offset direction and amplitude identifier, perform displacement adjustments with standard step lengths on the X and Y directions of the multi-degree-of-freedom motion mechanism respectively, combine the four-direction data to determine whether there is a problem with the consistency of the optical axis offset, and generate the multi-directional focusing offset stable trend set;
[0010] S4: Call the multi-directional focusing offset stable trend set, calculate the minimum perturbation block of the central focus on the imaging target surface, record the current X-axis and Y-axis positions of the multi-degree-of-freedom motion mechanism, keep the Z-axis constant, mark the three-axis numerical group as the target reference point, and generate the focus locking axial parameter value set in the assembled state.
[0011] The improvements of the present invention are that the coordinate set of effective response points in the TOF reflection region includes the horizontal coordinate value of the edge response point, the vertical coordinate value of the edge response point, and the pixel distribution map of the effective response region, the reflection response boundary offset direction and amplitude identifier include the maximum pixel offset in the left-right direction, the minimum pixel offset in the up-down direction, and the pixel symmetry judgment result, the multi-directional focusing offset stable trend set includes the brightness change trend in the X direction, the brightness change trend in the Y direction, and the gray level stable interval distribution characteristics, and the focus locking axial parameter value set in the assembled state includes the locked state X-axis position value, the locked state Y-axis position value, and the imaging position index corresponding to the CCD image plane.
[0012] The improvements of the present invention are that the specific steps for obtaining the coordinate set of effective response points in the TOF reflection region are as follows:
[0013] S101: Obtain the signal reflection image generated when the TOF laser emission module is aligned with the reflection target surface in the preliminary adjustment state, collect the entire original image data of the current frame image of the photoelectric sensor, establish a two-dimensional gray matrix in combination with the image size parameters, and generate the image pixel gray distribution matrix;
[0014] S102: According to the image pixel gray scale distribution matrix, take the horizontal edge pixel rows and vertical edge pixel columns in the edge region as the target region, set the determination range of the gray scale concentration area according to the gray scale response characteristic curve of the CCD imaging chip, index and mark the edge points whose gray scale means exceed the range, and generate a set of edge energy concentration coordinate points;
[0015] S103: Call the set of edge energy concentration coordinate points, allocate them to the four quadrant regions constructed with the image center point as the origin, calculate the difference between the gray scale value and the gray scale mean of the image background region, and determine whether it exceeds the image background noise reference value, screen the edge response points that meet the conditions as the effective point set, and obtain the coordinate set of the effective response points in the TOF reflection region.
[0016] The improvement of the present invention is that the specific steps for obtaining the reflection response boundary offset direction and amplitude identifier are as follows:
[0017] S201: Based on the coordinate set of the effective response points in the TOF reflection region, extract the response coordinate value sets of the left boundary region and the right boundary region in the X-axis direction of the image, combine the response coordinate value sets of the upper boundary region and the lower boundary region in the Y-axis direction, respectively determine the outermost edge coordinates on each side of the X-axis and the Y-axis, and record the row and column values of the image center point in the pixel matrix to generate the image edge boundary coordinate interval;
[0018] S202: Call the image edge boundary coordinate interval, take the center point coordinates as the symmetric reference axis, calculate the corresponding edge distance differences between the left boundary and the right boundary, and between the upper boundary and the lower boundary, and use the Euclidean distance calculation method to convert the left and right boundary differences and the upper and lower boundary differences into pixel coordinate distance values respectively to obtain the pair of axisymmetric edge distance differences;
[0019] S203: According to the pair of axisymmetric edge distance differences, determine whether there is an item in the left and right boundary differences and the upper and lower boundary differences that exceeds the set reference gap threshold of the image, mark the corresponding direction as the offset direction, and combine the offset direction and the Euclidean distance value of the corresponding boundary into a parameter group to obtain the reflection response boundary offset direction and amplitude identifier.
[0020] The improvement of the present invention is that the specific steps for obtaining the multi-directional focusing offset stable trend set are as follows:
[0021] S301: Based on the reflection response boundary offset direction and amplitude identifier, perform standard step displacement adjustment on the multi-degree-of-freedom motion mechanism respectively, collect TOF reflection images at each adjustment step position, extract the pixel gray scale values in the central region of the image, calculate the gray scale maximum value and the gray scale mean of the region, and obtain the gray scale characteristic value group of the central region;
[0022] S302: Based on the gray-scale feature value group of the central region, extract the peak gray scale and average gray scale at the adjustment position, calculate the difference between the peak gray scale and the average gray scale change values at the step positions of three consecutive points, respectively obtain the gray-scale change rate and the average change rate, calculate the comprehensive gray-scale fluctuation quantity, determine whether the comprehensive gray-scale fluctuation quantity falls within the set gray-scale stability threshold, screen the points that meet the conditions, obtain the position index set of the gray-scale change stable section, and establish the multi-directional gray-scale stable section interval value;
[0023] S303: Call the multi-directional gray-scale stable section interval value, sum up the number of stable point sets obtained in the positive and negative directions of the X-axis and the positive and negative directions of the Y-axis respectively, perform a comparison operation on the number of gray-scale sections in each direction, calculate the difference quantity of the number of stable sections in each direction, determine whether there is any direction among the four directions whose deviation from the stable area quantity exceeds the difference threshold, and obtain the multi-directional focusing offset stable trend set.
[0024] The improvement of the present invention is that the formula for calculating the comprehensive gray-scale fluctuation quantity is specifically:
[0025]
[0026] Among them, S i represents the comprehensive gray-scale fluctuation quantity at the i-th adjustment step, which is used to determine whether the current point is in the gray-scale change stable area, G i represents the peak gray scale of the central region image at the i-th adjustment step, G i-1 represents the peak gray scale of the central region image at the (i - 1)-th adjustment step, A i represents the average gray scale of the central region image at the i-th adjustment step, A i-1 represents the average gray scale of the central region image at the (i - 1)-th adjustment step, A i-2 represents the average gray scale of the central region image at the (i - 2)-th adjustment step.
[0027] The improvement of the present invention is that the steps for obtaining the focus locking axial parameter value group in the assembled state are specifically:
[0028] S401: Call the multi-directional focusing offset stable trend set, based on the gray-scale stable section interval values in the four directions, identify the adjustment step position with the smallest gray-scale difference in each direction, extract the position index values in the X direction and the Y direction corresponding to the corresponding step, and use the step positions that appear crosswise in the four groups of index values as the common position section to obtain the minimum gray-scale disturbance common step index set;
[0029] S402: Extract the image coordinate blocks corresponding to the indexes in the CCD imaging image according to the minimum gray-scale perturbation common step index set, mark the pixel index values of the left, right, upper, and lower boundaries of the block in the image space, calculate the pixel value ranges of the region width and height respectively, determine whether a closed boundary is formed within the image matrix for the region, and obtain the pixel perturbation range of the central focus region;
[0030] S403: According to the pixel perturbation range of the central focus region and the horizontal and vertical ranges in the image plane coordinate system, map the corresponding X-axis and Y-axis position values on the multi-degree-of-freedom motion mechanism, record the Z-axis axial state value corresponding to the moment as a constant height coordinate, and form a spatial positioning coordinate group with the three axial position values, and obtain the focus locking axial parameter value group in the assembled state.
[0031] The improvement of the present invention is that the process further includes the following steps:
[0032] S5: According to the focus locking axial parameter value group in the assembled state, perform a difference operation between the gray-scale mean value in each block and the central gray-scale mean value, determine whether the four-quadrant difference is within the range of the focus response stable domain, divide the imaging state, perform glue dotting and fixing on the lens brackets with consistent responses, and generate the consistency evaluation information of the assembled structure;
[0033] The consistency evaluation information of the assembled structure is specifically a consistent response level label, a defocus critical level label, and a severe defocus level label.
[0034] The improvement of the present invention is that the steps for obtaining the consistency evaluation information of the assembled structure are specifically as follows:
[0035] S501: According to the focus locking axial parameter value group in the assembled state, select the pixel coordinate points corresponding to the central spot in the image gray-scale matrix, divide the surrounding area into four equal-distance quadrant sub-blocks of upper left, upper right, lower left, and lower right with the center point as the origin, respectively extract the pixel gray-scale value sets in the four quadrant regions, and obtain the four-quadrant gray-scale distribution data set;
[0036] S502: Invoke the four-quadrant gray-scale distribution data set, extract the gray-scale mean value of the quadrant region, perform difference calculations with the gray-scale mean value of the central spot respectively, calculate the offset degree value of the quadrant region, determine whether it meets the range of the focus response stable domain, perform operations to obtain the offset classification identification quantity, and obtain the quadrant gray-scale offset comparison result;
[0037] S503: According to the comparison result of the quadrant gray-scale offset, count the number of quadrants that meet the condition that the offset value does not exceed the range of the focus response stable region, determine whether it belongs to the states of all consistent, partial boundary offset or full-region focus deviation, and combine with the good product identification standard to establish a classification mapping value corresponding to the state level. Perform dispensing and fixing on the brackets that meet the consistent conditions, record the assembly state, and obtain the consistency evaluation information of the assembly structure.
[0038] The improvement of the present invention is that the formula for calculating the offset value of the quadrant region is specifically:
[0039]
[0040] Wherein, E j represents the gray-scale offset value of the j-th quadrant region, C represents the gray-scale average value of the central light spot region, and Q j represents the gray-scale average value of the j-th quadrant sub-block, and Q k represents the gray-scale average value of the k-th quadrant sub-block.
[0041] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0042] In the present invention, through real-time signal feedback, the response points of the laser reflection image are screened, and through boundary offset direction recognition and central symmetry evaluation, the quantitative judgment of the focus offset trend is performed, clearly defining the optical axis offset direction and amplitude, realizing precise adjustment of the stepping displacement control. Based on the peak value and average difference stability of the image gray-scale after adjusting the positions of each axis, the optimal assembly position of the focusing consistency is determined, and the target reference point is accurately generated by locating the intersection of the minimum disturbance blocks in multiple directions, ensuring high-precision repeatability and stability of the lens axial parameters in the focus-locked state. Using the difference between the gray-scale average values of the four quadrant sub-blocks and the central region to quantify the focusing state of the assembled lens group, enabling a quantitative response consistency evaluation in the lens assembly process, significantly improving the assembly accuracy, stability and consistency of the lens and the optical path, capable of reducing the assembly error to ±5 μm, effectively improving the uniformity of the light intensity distribution on the imaging target surface and the stability and reliability of the ranging signal, reducing the later maintenance and failure risks of the lens assembly, and ensuring the overall optical ranging accuracy and stable performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0044] Figure 1 It is a schematic diagram of the main steps of the present invention;
[0045] Figure 2 This is a schematic structural diagram of the device of the present invention. Specific implementation manners
[0046] The following will describe the technical solutions in the present invention with reference to the accompanying drawings.
[0047] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as an "example" in the present invention should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, the use of the word "example" is intended to present concepts in a specific manner. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one of the two can be selected.
[0048] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference is not emphasized, the meanings they express are the same. "(of)", "corresponding", and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference is not emphasized, the meanings they express are the same.
[0049] In the embodiments of the present invention, sometimes the subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meanings they express are the same.
[0050] To make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will be described in detail with reference to the accompanying drawings and specific embodiments.
[0051] Please refer to Figure 1 , the present invention provides a technical solution: a ranging TOF lens assembly process, including the following steps:
[0052] S1: Obtain the signal reflection image generated when the TOF laser emission module is aligned with the reflection target surface in the initial adjustment state, detect the current frame image data of the photoelectric sensor, and according to the coordinate groups of the energy concentration points on the horizontal edge pixel rows and vertical edge pixel columns of the light spot area, screen out the response point set with energy higher than the background noise mean value in the four quadrant areas, and generate the coordinate set of effective response points in the TOF reflection area;
[0053] The background noise mean value refers to the average value of the image brightness in the area where the laser does not act, and can be obtained by statistical analysis of the external area of the ROI;
[0054] S2: Based on the effective response point coordinate set of the TOF reflection region, according to the distribution intervals of the horizontal and vertical four-side edge coordinates, calculate the corresponding boundary distances for the left-right and up-down symmetry axes constructed for the center point, calculate the Euclidean distance difference between the edge maximum offset point and the center point within the pixel matrix, determine whether there is a spot offset trend, and generate the reflection response boundary offset direction and amplitude identifier;
[0055] S3: Based on the reflection response boundary offset direction and amplitude identifier, perform displacement adjustments with a standard step size on the X direction and Y direction of the multi-degree-of-freedom motion mechanism respectively, collect the TOF reflection images at each adjusted position, extract the peak gray value and the regional average gray value of the central spot region in the image, calculate the degree of difference at consecutive points, and screen the points where the gray change is within the stable gray level range. Combine the four-direction data to determine whether there is an optical axis offset consistency problem, and generate a multi-directional focusing offset stable trend set;
[0056] The peak gray value refers to the gray value of the pixel with the maximum brightness in the image, and the regional average gray value: refers to the arithmetic average of the pixel gray values within the spot region;
[0057] S4: Call the multi-directional focusing offset stable trend set, perform intersection positioning according to the positions with the minimum brightness difference in the four directions, calculate the minimum perturbation block of the central focus on the imaging target surface, record the current X-axis and Y-axis positions of the multi-degree-of-freedom motion mechanism, keep the Z-axis constant, mark the three-axis numerical group as the target reference point, and generate the focus locking axial parameter value group in the assembled state;
[0058] The three-axis positions are taken from the real-time readings of the displacement encoder, and the minimum resolution of the encoder is usually 0.001 mm;
[0059] S5: According to the focus locking axial parameter value group in the assembled state, select the equidistant four-quadrant sub-blocks in the peripheral region of the central spot, perform difference operations between the gray mean value within each block and the central gray mean value, determine whether the four-quadrant difference is within the range of the focusing response stable domain, and combine the set good product identification criteria to divide the imaging state into "response consistent", "defocus critical", and "severe defocus". Glue and fix the lens brackets with consistent responses, and generate the consistency evaluation information of the assembled structure;
[0060] The coordinate set of valid response points in the TOF reflection area includes the horizontal coordinate values of edge response points, the vertical coordinate values of edge response points, and the pixel distribution map of the valid response area. The reflection response boundary offset direction and amplitude identifier include the maximum pixel offset in the left-right direction, the minimum pixel offset in the up-down direction, and the pixel symmetry judgment result. The multi-directional focusing offset stable trend set includes the brightness change trend in the X direction, the brightness change trend in the Y direction, and the gray-scale stable interval distribution characteristics. The set of focal point locking axial parameter values in the assembled state includes the X-axis position value in the locked state, the Y-axis position value in the locked state, and the imaging position index corresponding to the CCD image plane. The consistency evaluation information of the assembly structure is specifically the consistent response level label, the defocus critical level label, and the severe defocus level label.
[0061] The steps for obtaining the coordinate set of valid response points in the TOF reflection area are specifically as follows:
[0062] S101: Obtain the signal reflection image generated when the TOF laser emission module is aligned with the reflection target surface in the preliminary adjustment state, collect the entire original image data of the current frame of the photoelectric sensor, extract the set of gray-scale values of the pixel points in the image, and establish a two-dimensional gray-scale matrix in combination with the image size parameters to generate an image pixel gray-scale distribution matrix;
[0063] When obtaining the pulsed light beam generated by the TOF laser emission module in the preliminary adjustment state and projecting it onto the Lambert reflection surface located on the working platform, a standard Lambert reflection plate with a surface reflectivity greater than 90% should be arranged in the test area first. Its size is 50mm×50mm. This surface is used to receive and diffusely reflect the modulated pulse signal generated by the emission module. The emission module emits a near-infrared modulated pulse signal with a wavelength of 850 - 940nm, and its pulse repetition frequency is set to 30MHz. The signal propagates in the air and is received by the photoelectric sensor after reflection. During this period, by adjusting the emission direction of the TOF module and the position of the Lambert panel, ensure that the light beam is directly facing the center to ensure that the echo signal can cover the CCD photosensitive area to the greatest extent. The photoelectric sensor uses a grayscale camera with a resolution of 2560*1920 pixels, and the exposure time is set to 3ms. Under the drive of the acquisition clock, a complete reflection image data frame is obtained. The gray-scale value range of each pixel point in the image data frame is 0–255. The image data frame is stored in the memory cache. Subsequently, the gray-scale value of each pixel is called through the program, and a two-dimensional matrix is established according to the row and column dimensions of the horizontal pixel number 1280 and the vertical pixel number 1024 of the image. Each position in the gray-scale matrix corresponds to a gray-scale value. This matrix is used to represent the light intensity distribution of the entire image. The brighter areas in the image are concentrated in the middle. The proportion of pixel points with a brightness value greater than 220 in the total pixel points is 7.3%, and it shows an obvious elliptical distribution characteristic. The spot contour is initially visible. This matrix is then used as the basic data structure for subsequent spot edge recognition and energy concentration to generate an image pixel gray-scale distribution matrix.
[0064] S102: According to the image pixel gray-scale distribution matrix, extract the edge region of the spot shape in the central region of the image. Take the horizontal edge pixel rows and vertical edge pixel columns in the edge region as the target regions. Respectively, count the total gray-scale values of the pixel rows and columns and calculate the gray-scale mean value. Set the determination range of the gray-scale concentration area according to the gray-scale response characteristic curve of the CCD imaging chip. Index and mark the edge points whose gray-scale mean value exceeds the range, and generate the edge energy concentration coordinate point set;
[0065] When extracting the edge region of the spot shape in the central region of the image according to the image pixel gray-scale distribution matrix, first use the center point coordinates (640, 512) of the image matrix as the origin, expand 80 pixels in each of its up, down, left, and right directions, and construct a square region with a side length of 160 pixels as the spot analysis region. In this region, extract all 1280 columns of pixel rows horizontally, and identify the set of pixels whose gray-scale value is greater than the background average gray-scale value plus the threshold of 30. The background gray-scale value is calculated by averaging the 512-pixel block regions at the four corners outside the image edge and is 62. The set determination threshold is 62 + 30 = 92. If there are more than 15 consecutive pixels with a gray-scale value greater than 92 in the horizontal row, record this row as a horizontal edge response row, record the starting and ending pixel coordinate positions, calculate the total gray-scale value and record the average value. In the vertical column direction, use the same method, extract each column along 1024 rows, record the positions and gray-scale means of the response columns. Finally, a total of 37 horizontal response rows and 41 vertical response columns are obtained, and their average gray-scale values are concentrated between 136 and 212. If the gray-scale mean value exceeds the upper limit range defined in the gray-scale response characteristic curve of the set CCD chip (the set value is the background gray-scale + 3 × standard deviation, and the actual value is 62 + 3 × 21 = 125), then mark this edge coordinate point and add it to the concentrated energy response point set, complete the edge marking of the coordinate position and the judgment of the gray-scale response threshold, and generate the edge energy concentration coordinate point set.
[0066] S103: Call the edge energy concentration coordinate point set, distribute it to the four quadrant regions constructed with the image center point as the origin. For each quadrant, extract the gray-scale values of the marked edge points respectively, calculate the difference between the gray-scale value and the gray-scale mean value of the image background region, and determine whether it exceeds the image background noise reference value. Screen the edge response points that meet the conditions as the effective point set, and obtain the coordinate set of effective response points in the TOF reflection region.
[0067] Call the edge energy concentrated coordinate point set, map this coordinate point set into the four - quadrant area constructed with the center point as the center. Taking the image center point (640, 512) as the division basis, divide all coordinate points into the upper - left, upper - right, lower - left, and lower - right quadrant areas respectively. In each quadrant, count the number of coordinate points belonging to it and its corresponding gray - value set, and perform an average - value calculation on the gray values. Then, collect the average gray value of the image background area. The background area is defined as a 16×16 pixel matrix in the four corners of the image. Extract its gray - value means respectively and take the average of the four corners as the final background gray value. Suppose the gray - value means of the four corners are 59, 61, 60, and 62 respectively, then the background mean is 60.5. Take this value as the background - noise reference value. Subsequently, subtract this background - noise mean from the recorded point gray values in each quadrant to obtain the difference set of each point. Perform a judgment operation. If the number of points with a difference greater than 25 exceeds 60% of the total number of points in the current quadrant, it is determined that there are valid response points in this quadrant. This judgment value 25 is calculated by setting with the standard deviation 2σ (σ is the gray - value standard deviation of the entire image, approximately 12.5). The coordinate points that meet the conditions are selected into the valid - point position set. This set is used as the input basis for subsequent spatial - offset judgment and focus - consistency analysis to obtain the coordinate set of valid response points in the TOF reflection area.
[0068] The steps for obtaining the reflection - response boundary offset direction and amplitude identifier are specifically as follows:
[0069] S201: Based on the coordinate set of valid response points in the TOF reflection area, extract the response - coordinate - value sets of the left - boundary area and the right - boundary area in the X - axis direction of the image, and combine the response - coordinate - value sets of the upper - boundary area and the lower - boundary area in the Y - axis direction. Determine the outermost edge coordinates on each side of the X - axis and the Y - axis respectively, and record the row and column values of the image center point in the pixel matrix to generate the image - edge boundary coordinate interval;
[0070] Based on the set of effective response point coordinates in the TOF reflection region, first extract the set of response points at the leftmost and rightmost boundaries in the X-axis direction of the image. This operation is performed by scanning the abscissa values of all effective response points in the image matrix and obtaining the minimum abscissa value and the maximum abscissa value respectively. In the current imaging image, the image width is set to 1280 pixels, the point with the minimum abscissa value is x1 = 275, and the maximum point is x2 = 1018. The left and right boundary coordinate points are obtained as (275, y1) and (1018, y2). Similarly, extract the set of points at the upper and lower boundaries in the Y-axis direction. By traversing the ordinate values of the effective response points, assume the minimum value y1 = 204 and the maximum value y2 = 811. The corresponding upper and lower boundary points are (x3, 204) and (x4, 811). Subsequently, obtain the row and column values of the center point of the image. Given that the pixel dimension of the image is 1280×1024, the center pixel point of the image is (640, 512). Take this point as the symmetric reference benchmark point. In actual operation, these boundary point values are obtained through coordinate filtering operations after image grayscale binarization. For example, select the boundary extreme points among all points with grayscale values greater than 110, and use the pixel coordinate difference as the preliminary screening basis to identify the projection coordinates of the response points on the left and right sides and the response points at the upper and lower ends, complete the extraction of this boundary information and the positioning of the coordinate interval, and obtain the image edge boundary coordinate interval.
[0071] S202: Call the image edge boundary coordinate interval. Taking the center point coordinates as the symmetric reference axis, calculate the corresponding edge distance differences between the left boundary and the right boundary, and between the upper boundary and the lower boundary, and use the Euclidean distance calculation method to convert the left and right boundary differences and the upper and lower boundary differences into pixel coordinate distance values respectively to obtain the symmetric axis edge distance difference pair;
[0072] Call the image edge boundary coordinate interval. Taking the image center point coordinates (640, 512) as the symmetric reference axis, first calculate the position deviation of the boundary points on both sides of the X-axis respectively. Calculate the horizontal distance between the left boundary point (275, y1) and the center point (640, y), which is d1 = 640 - 275 = 365 pixels. The horizontal distance between the right boundary point (1018, y2) and the center point (640, y) is d2 = 1018 - 640 = 378 pixels. The symmetric difference between the left and right sides is 13 pixels. Similarly, calculate the vertical distance of the boundary points on both sides of the Y-axis. Calculate the vertical distance between the upper boundary point (x, 204) and the center point (x, 512) as d3 = 512 - 204 = 308 pixels. The vertical distance between the lower boundary point (x, 811) and the center point (x, 512) is d4 = 811 - 512 = 299 pixels. The symmetric difference is 9 pixels. The symmetry analysis is completed through the above two groups of deviation comparisons, and substitute d1 and d2, d3 and d4 into the Euclidean distance formula respectively to convert them into the real symmetric distance values in the pixel space. The formula is:
[0073] In this step, due to the fact that the Y value remains unchanged or the X value remains unchanged in practice, it is simplified to a one-dimensional distance calculation. Finally, it is obtained that the X-axis symmetry difference is 13 pixels and the Y-axis symmetry difference is 9 pixels, and a pair of symmetry axis edge distance differences is established.
[0074] S203: According to the pair of symmetry axis edge distance differences, determine whether there is a term exceeding the set reference gap threshold of the image in the left-right boundary difference and the up-down boundary difference, mark the corresponding direction as the offset direction, and combine the offset direction with the Euclidean distance value of the corresponding boundary into a parameter group to obtain the reflection response boundary offset direction and amplitude identifier.
[0075] When judging whether there is an abnormal offset direction according to the pair of symmetry axis edge distance differences, it is necessary to combine the reference gap threshold set by the image. This threshold is set according to the pixel space stable deviation standard, and the default maximum allowable symmetry difference is ±10 pixels. If the actual difference exceeds this value, it is determined as the offset direction. In the current situation, the X-direction symmetry difference is 13 pixels and the Y-direction is 9 pixels. Therefore, the X-axis is marked as having an offset direction, and this direction is denoted as "X positive offset", and the corresponding Euclidean distance is 13 pixels. The Y-axis does not exceed the threshold and is not marked. In the application scenario, when the TOF lens has a slight rotation or lateral displacement during assembly, it will cause stretching or compression of the bright area in the left-right or up-down direction in the image. Such stretching can be identified by this judgment process and included in the offset analysis range. Finally, the identified direction (X) and the corresponding Euclidean distance value (13) are input as paired data to obtain the reflection response boundary offset direction and amplitude identifier.
[0076] The specific steps for obtaining the multi-directional focusing offset stable trend set are as follows:
[0077] S301: Based on the reflection response boundary offset direction and amplitude identifier, perform standard step displacement adjustments on the multi-degree-of-freedom motion mechanism respectively. At each adjustment step position, collect the TOF reflection image, extract the pixel gray values in the central area of the image, calculate the maximum gray value and the average gray value of the area, and obtain the central area gray feature value group;
[0078] Obtain the X and Y directions identified based on the reflection response boundary offset direction and amplitude identification. First, determine the motion dimensions that the multi-degree-of-freedom motion mechanism needs to execute according to the offset direction information. If it is identified as a positive X-axis offset, the platform performs a standard step displacement operation of ±0.005 - 0.02 mm along the positive X-axis. The number of steps is set to 11 steps, and the corresponding displacement range is 0.05 - 0.1 mm. At each step position, the platform maintains a stable time of 500 ms for image acquisition. After each step of displacement, the image data of the central imaging area is obtained through the photoelectric sensor in the TOF receiving module. The gray values of all pixels within the 100×100 pixel area at the image center are extracted. The maximum gray value and the average value of the gray level in this area are extracted. The maximum gray value is used to represent the signal focusing intensity, and the average gray value reflects the signal diffusion characteristics. For example, at the 3rd step position, the maximum gray value of the central area is 231, and the average gray value is 174. The peak gray value Gi and the average gray value Ai at all steps are collected in sequence to form a set of gray feature values of the central area. Each set of data contains four components: the corresponding adjustment direction, step position, Gi value, and Ai value. The data set is finally stored in a two-dimensional list structure as the basic data for subsequent judgment of the gray change trend, and the set of gray feature values of the central area is obtained.
[0079] S302: According to the set of gray feature values of the central area, extract the peak gray value and the average gray value at the adjustment position. Calculate the difference values of the peak gray value and the average gray value changes at three consecutive step positions, respectively obtain the gray change rate and the average change rate, calculate the comprehensive gray fluctuation quantity, determine whether the comprehensive gray fluctuation quantity falls within the set gray stability threshold, screen the points that meet the conditions, obtain the index set of the gray change stable section positions, and establish the multi-direction gray stable section interval values;
[0080] The formula for calculating the comprehensive gray fluctuation quantity is specifically:
[0081]
[0082] where, S i represents the comprehensive gray fluctuation quantity at the i-th adjustment step, which is used to determine whether the current point is in the gray change stable area, G i represents the peak gray value of the central area image at the i-th adjustment step, G i-1 represents the peak gray value of the central area image at the (i - 1)-th adjustment step, A i represents the average gray value of the central area image at the i-th adjustment step, A i-1 represents the average gray value of the central area image at the (i - 1)-th adjustment step, A i-2 represents the average gray value of the central area image at the (i - 2)-th adjustment step;
[0083] This formula uses the grayscale feature data (G i-1 ,A i-1 ,A i-2 ) is used for calculation. The purpose of the formula is to avoid the interference of single-step abnormal disturbance on the judgment result: TOF system may have "transient grayscale mutation" phenomenon caused by ambient light interference, small mechanical vibration or hardware fluctuation during imaging. If only single-step grayscale change (such as G i -G i-1 ), which is easily misled by random noise and misjudged as system deviation; identify the real trend through "three-point smoothing": introduce the historical mean information of the i-2th step to help evaluate the "inertia" of the grayscale trend, that is, whether the grayscale change is stable and slow or a drastic jump caused by sudden interference; improve the anti-interference ability of determining the stable segment: the three points form a minimum sliding window, which can realize the time redundancy check of grayscale fluctuations with lower complexity.
[0084] The criterion for determining the "stable focus section" is not only based on the grayscale change of the current step length, but also takes into account its historical fluctuation trend, thereby avoiding misadjustment and mislocking caused by occasional noise.
[0085] According to the grayscale feature value group of the central area, the peak grayscale G under each adjustment step i is extracted i With the average grayscale A i , calculate the difference between the grayscale values of the two adjacent forward steps, and assume that the grayscale values of the 5th step adjustment position are G5=238, A5=181, the previous position is G4=233, A4=179, and the previous two positions are A3=174, then substitute into the formula:
[0086]
[0087] The grayscale fluctuation comprehensive amount is used to determine whether it is in the stable section, and the grayscale stability threshold ε is set to 0.06. If S i <ε, the current step position i is regarded as a grayscale stable point and i is added to the stable index set. If this condition is met for three consecutive steps, it is regarded as a stable segment. The judgment process is performed on all adjustment directions separately, and a stable index value set for each direction is generated accordingly. Finally, they are sorted and summarized into a segment start and end index list and a stable direction mark to establish a multi-directional grayscale stable segment interval value.
[0088] S303: calling the multi-directional grayscale stable segment interval value, summing up the number of stable point sets obtained in the positive and negative directions of the X-axis and the positive and negative directions of the Y-axis respectively, performing a comparison operation on the number of grayscale segments in each direction, and calculating the difference in the number of stable segments in each direction, judging whether any direction in the four directions deviates from the stable area by more than the difference threshold, and obtaining a multi-directional focus offset stable trend set;
[0089] Call the multi-directional gray-scale stable section interval values, and respectively count the number of stable point sets in the positive X-axis direction, negative X-axis direction, positive Y-axis direction, and negative Y-axis direction. For example, within the displacement range of ±0.05 mm, 3 stable points are obtained in the positive X direction, 2 in the negative X direction, 4 in the positive Y direction, and 1 in the negative Y direction. After comparing the stable quantities in the four directions, determine whether there is any direction with a stable difference deviation exceeding ±2. The current maximum difference is the difference between 4 in the positive Y and 1 in the negative Y, which is 3, exceeding the set threshold of ±2. Then mark that there is a focusing offset trend in this direction and label it as "Y-direction focusing offset". The offset amplitude is the difference in stable quantities. Finally, form a structured trend parameter set with the direction item and the difference item to obtain the multi-directional focusing offset stable trend set.
[0090] The steps for obtaining the focus locking axial parameter value group in the assembled state are specifically as follows:
[0091] S401: Call the multi-directional focusing offset stable trend set. According to the gray-scale stable section interval values in the four directions, identify the adjustment step position with the smallest gray-scale difference in each direction, extract the position index values of the corresponding steps in the X direction and Y direction, and use the step positions that cross-appear in the four groups of index values as the common position section to obtain the minimum gray-scale disturbance common step index set;
[0092] Call the gray-scale stable section interval values in the four directions in the multi-directional focusing offset stable trend set. First, identify the position points with the smallest gray-scale change in the positive X, negative X, positive Y, and negative Y directions respectively. This point is the adjustment step position corresponding to the minimum gray-scale change amount in the stable section of each direction. In actual operation, it can be achieved by traversing the gray-scale change rate sequences in each direction and extracting the corresponding minimum value index in each direction. For example, the corresponding step index in the positive X direction is +3, in the negative X direction is –2, in the positive Y direction is +1, and in the negative Y direction is –1. Subsequently, perform a set intersection operation on the four groups of index values, that is, select the co-occurring step indexes that appear in at least two directions or more from the stable step indexes in the four directions. For example, when the positive X is {+2, +3, +4}, the negative X is {–2, +3, +5}, the positive Y is {+3, +6}, and the negative Y is {+3, +1}, then the common step is +3. Mark this position as the common minimum gray-scale disturbance point, record its unique index value in the displacement sequence, and summarize to form a common index list to complete the positioning of the minimum disturbance point and the confirmation of the step length, and obtain the minimum gray-scale disturbance common step index set.
[0093] S402: According to the minimum gray-scale perturbation common step index set, extract the image coordinate blocks corresponding to the indexes in the CCD imaging image, mark the pixel index values of the left boundary, right boundary, upper boundary, and lower boundary of the block in the image space, calculate the pixel value ranges of the region width and height respectively, determine whether a closed boundary is formed by the region within the image matrix, and obtain the pixel perturbation range of the central focus region;
[0094] According to the displacement index value in the minimum gray-scale perturbation common step index set, first determine the actual displacement positions of the X-axis and Y-axis of the adjustment platform corresponding to this step, combine the current six-axis adjustment control parameters and the platform zero position setting, and multiply the displacement step index by the standard step value to obtain the corresponding spatial displacement. For example, the step index +3 corresponds to the position of +0.03 mm. Map this displacement coordinate to the image coordinate space, corresponding to the position offset of the gray-scale central region in the CCD imaging image matrix. According to the imaging scale relationship of the image, for example, a spatial displacement of 0.03 mm corresponds to an image offset of 3 pixels, and the specific region of this point in the image matrix can be located. Expand a 20-pixel region along the X-axis and Y-axis respectively within this region, and mark the left, right, upper, and lower edge pixels of the boundary points of this image block, which are x l 、x r 、y u 、y_d. For example, x l =622, x r =662, y u =492, y_d=532. Calculate the pixel range width as x r –x l =40, and the height as y_d–y u =40. This region is a closed rectangular structure. Perform a closed boundary determination on it to judge whether the edge points cross the image edge. The current image size is 1280×1024, and this region is entirely inside, meeting the complete closure requirement, and obtain the pixel perturbation range of the central focus region.
[0095] S403: According to the pixel perturbation range of the central focus region, in the horizontal and vertical ranges in the image plane coordinate system, map the corresponding X-axis and Y-axis position values on the multi-degree-of-freedom motion mechanism, record the Z-axis axial state value corresponding to the moment as a constant height coordinate, and form a spatial positioning coordinate group with the three axial position values, and obtain the focus locking axial parameter value group in the assembled state;
[0096] According to the horizontal and vertical pixel ranges of the pixel perturbation range in the central focus area in the image plane coordinate system, combined with the pixel pitch of the CCD imaging system and the platform displacement mapping parameters, the central point coordinates of the rectangular area in the image space are converted into the actual displacement coordinates on the multi-degree-of-freedom motion mechanism. For example, the image center offset is (x = 640, y = 512), the current area center is (x = 642, y = 514), the offset is (2, 2) pixels, and combined with the image pixel size of 5 μm, the mapped platform space displacement is (0.01 mm, 0.01 mm), which is used as the locking value of the X-axis and Y-axis. At the same time, it is read that the current Z-axis is in a frozen state, and its fixed height on the Z-axis is recorded as –15.02 mm. The three-axis position parameter values are combined into a coordinate vector (X = +0.01 mm, Y = +0.01 mm, Z = –15.02 mm). This value is the best focusing axial position of the TOF component in the current platform attitude, and the focus locking axial parameter value group in the assembled state is obtained.
[0097] The steps for obtaining the consistency evaluation information of the assembly structure are specifically as follows:
[0098] S501: According to the focus locking axial parameter value group in the assembled state, select the pixel coordinate points corresponding to the central spot in the image gray matrix. Divide the surrounding area into four equal-distance quadrant sub-blocks of upper left, upper right, lower left, and lower right with the center point as the origin. Respectively extract the pixel gray value sets in the four quadrant areas to obtain the four-quadrant gray distribution data set;
[0099] According to the focus locking axial parameter value group in the assembled state, extract the corresponding central spot pixel coordinate points in the image gray matrix. First, through the functional relationship between the three-axis position value and the CCD imaging calibration, map the X-axis and Y-axis axial coordinates to the pixel space coordinate points of the image matrix. For example, X = 0.02 mm, Y = –0.01 mm corresponds to the coordinate point (643, 510) in the image. This point is used as the center point and used as the origin to divide the quadrant area of the image gray matrix. In the horizontal and vertical directions, expand 30 pixels to the left and right respectively from this center point to form four symmetric quadrant areas of upper left, upper right, lower left, and lower right. The size of each quadrant area is 30×30 pixels. Read the pixel gray value sets in each quadrant area respectively. The data of the four quadrants are respectively constructed in the form of a gray value list to form a quadrant gray structure data table. Set the upper left quadrant gray value set as [130, 132, …, 145], the upper right as [133, 134, …, 146], and so on. Extract all pixel points in each area through program instructions and store them in row and column order. This gray information set will be used as the basis for subsequent area consistency comparison to obtain the four-quadrant gray distribution data set.
[0100] S502: Call the four-quadrant gray-scale distribution data set, extract the gray-scale mean value of the quadrant area, calculate the difference with the gray-scale mean value of the central spot respectively, calculate the offset value of the quadrant area, determine whether it meets the range of the stable region of the focusing response, obtain the offset classification identification quantity through operation, and obtain the comparison result of the quadrant gray-scale offset;
[0101] The formula for calculating the offset value of the quadrant area is specifically:
[0102]
[0103] Among them, E j represents the gray-scale offset value of the j-th quadrant area, C represents the gray-scale mean value of the central spot area, and Q j represents the gray-scale mean value of the j-th quadrant sub-block, represents the sum of the gray-scale mean values of the four quadrants, k represents the index of the k-th quadrant in the sum of the quadrant gray-scale values, j represents the number of the target quadrant currently calculated, and Qk represents the gray-scale mean value of the k-th quadrant sub-block;
[0104] The physical meanings of "central gray-scale mean value C" and "sum of four-quadrant mean values" in the formula are used to measure the dual stability characteristics of symmetry and uniformity;
[0105] The meaning is the measurement of the gray-scale consistency between the center and the edge, and this item measures the degree of gray-scale difference between each quadrant area and the center of the spot;
[0106] The denominator uses normalization to enhance the sensitivity of the low-brightness area and avoid excessive influence of brightness level on the offset evaluation;
[0107] The physical meaning is that the center should be the area where the laser energy is most concentrated. If there is a significant difference in its gray-scale from the surrounding quadrants, it indicates that the focusing state is unstable or the spot is offset.
[0108] The meaning is the evaluation of the uniformity (symmetry) between quadrants, and this item measures the average gray-scale difference between this quadrant and the other quadrants as a whole;
[0109] The physical meaning is that under ideal focusing, the gray-scale distributions of the four quadrants should be symmetric and consistent; this difference reflects whether the spot is deformed or eccentrically skewed on the imaging plane.
[0110] E j The smaller the value, the better the alignment of the quadrant area with the center and the higher the consistency with other quadrants;
[0111] If multiple quadrants have low offset values, it indicates that the current assembly state is a good product with high symmetry and high focusing consistency.
[0112] Call the four - quadrant gray - scale distribution data set. First, average the gray - scale value sets within each quadrant area, and calculate the gray - scale means of the four quadrants Q1, Q2, Q3, and Q4 respectively. Set the gray - scale means of each quadrant to 137, 134, 135, and 139 respectively. Then read the gray - scale mean of the central spot area and set it as C = 141, and substitute it into the formula:
[0113]
[0114] Calculate the offset degree for each quadrant, where:
[0115]
[0116] Take the upper - left quadrant as an example,
[0117] Repeat the calculation for the remaining three quadrants to get E2 = 1.29, E3 = 1.14, E4 = 1.58. Judge whether each E j falls within the threshold range of the focus response stable region. Set the threshold B = 1.5. Then the first three quadrants meet the conditions, and only the fourth quadrant exceeds the range. Mark its offset state and generate a quadrant offset judgment label. Obtain the quadrant gray - scale offset comparison result. When the four - quadrant gray - scale offset degree ≤ 1.5, the ranging accuracy is improved by 30%.
[0118] S503: According to the quadrant gray - scale offset comparison result, count the number of quadrants that meet the condition that the offset degree value does not exceed the focus response stable region range. Judge whether it belongs to the states of all - consistent, partial - boundary offset, or full - region focus deviation, and combine the good - product identification criteria to establish a classification mapping value corresponding to the state level. Perform dispensing and fixing on the brackets that meet the consistent conditions, record the assembly state, and obtain the consistency evaluation information of the assembly structure;
[0119] According to the quadrant gray - scale offset comparison result, judge whether the offset degree values in the four directions are within the threshold B respectively. Record the number of quadrants that meet the conditions. When the E values of the first three quadrants are lower than the threshold and only one quadrant is higher than the threshold, judge that the structure belongs to the "partial - boundary offset" state type, corresponding to the "critically adjustable" level in the good - product identification criteria. Then map the structure label status value at the assembly station with this label. If it meets the "response - consistent" level, perform the dispensing operation. The current state is marked as not meeting the gluing condition, record this status code and synchronously write it into the assembly record form, and obtain the consistency evaluation information of the assembly structure.
[0120] It should be understood that the term "and / or" in this text is merely a description of the associated relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Here, A and B can be singular or plural. Additionally, the character " / " in this text generally represents an "or" relationship between the associated objects before and after, but it may also represent an "and / or" relationship, which can be specifically understood by referring to the context before and after.
[0121] In the present invention, "at least one" means one or more, and "a plurality" means two or more. "At least one of the following" or its similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.
[0122] It should be understood that in various embodiments of the present invention, the magnitudes of the serial numbers of the above processes do not imply the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0123] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0124] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the devices, apparatuses, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0125] In several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.
[0126] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0127] In addition, each functional unit in various embodiments of the present invention may be integrated into a processing unit, may exist separately as individual physical units, or two or more units may be integrated into one unit.
[0128] If the described function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs and other various media that can store program codes.
[0129] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A ranging TOF lens assembly process, characterized in that It includes the following steps: S1: Obtain the signal reflection image generated when the TOF laser emission module is aligned with the reflection target surface in the preliminary adjustment state, screen the set of response points with energy higher than the average background noise in the four-quadrant region, and generate the coordinate set of effective response points in the TOF reflection region; S2: Based on the coordinate set of effective response points in the TOF reflection region, calculate the Euclidean distance difference between the edge maximum offset point and the center point within the pixel matrix according to the distribution intervals of the horizontal and vertical four-edge coordinates, determine whether there is a spot offset trend, and generate the reflection response boundary offset direction and amplitude identifier; S3: Based on the reflection response boundary offset direction and amplitude identifier, perform displacement adjustments with standard step sizes on the X direction and Y direction of the multi-degree-of-freedom motion mechanism respectively, and combine the four-direction data to determine whether there is an optical axis offset consistency problem, and generate the multi-directional focusing offset stable trend set; S4: Call the multi-directional focusing offset stable trend set, calculate the minimum perturbation block of the central focus on the imaging target surface, record the current X-axis and Y-axis positions of the multi-degree-of-freedom motion mechanism, keep the Z-axis constant, mark the three-axis numerical group as the target reference point, and generate the focus locking axial parameter value set in the assembled state.
2. The ranging TOF lens assembly process according to claim 1, characterized in that, The coordinate set of effective response points in the TOF reflection region includes the horizontal coordinate value of the edge response point, the vertical coordinate value of the edge response point, and the pixel distribution map of the effective response region. The reflection response boundary offset direction and amplitude identifier include the maximum pixel offset in the left-right direction, the minimum pixel offset in the up-down direction, and the pixel symmetry judgment result. The multi-directional focusing offset stable trend set includes the brightness change trend in the X direction, the brightness change trend in the Y direction, and the gray scale stable interval distribution characteristics. The focus locking axial parameter value set in the assembled state includes the X-axis position value in the locked state, the Y-axis position value in the locked state, and the imaging position index corresponding to the CCD image plane.
3. The ranging TOF lens assembly process according to claim 2, characterized in that, The specific steps for obtaining the coordinate set of effective response points in the TOF reflection region are as follows: S101: Obtain the signal reflection image generated when the TOF laser emission module is aligned with the reflection target surface in the preliminary adjustment state, collect the entire original image data of the current frame image of the photoelectric sensor, and establish a two-dimensional gray matrix in combination with the image size parameters to generate the image pixel gray scale distribution matrix; S102: According to the image pixel gray scale distribution matrix, take the horizontal edge pixel rows and vertical edge pixel columns in the edge region as the target regions, set the determination range of the gray scale concentration area according to the gray scale response characteristic curve of the CCD imaging chip, and perform index marking on the edge points with gray scale mean exceeding the range to generate the edge energy concentration coordinate point set; S103: Call the edge energy concentration coordinate point set, distribute it to the four-quadrant region constructed with the image center point as the origin, calculate the difference between the gray scale value and the average gray scale value of the image background region, and determine whether it exceeds the image background noise reference value, screen the edge response points that meet the conditions as the effective point set, and obtain the coordinate set of effective response points in the TOF reflection region.
4. The ranging TOF lens assembly process according to claim 3, wherein, The specific steps for obtaining the reflection response boundary offset direction and amplitude identifier are as follows: S201: Based on the coordinate set of valid response points in the TOF reflection region, extract the response coordinate value sets in the left and right boundary regions in the X-axis direction of the image, combine with the response coordinate value sets in the upper and lower boundary regions in the Y-axis direction, respectively determine the outermost edge coordinates on each side of the X-axis and Y-axis, record the row and column values of the image center point in the pixel matrix, and generate the image edge boundary coordinate interval; S202: Call the image edge boundary coordinate interval, take the center point coordinates as the symmetric reference axis, calculate the corresponding edge distance differences between the left and right boundaries and between the upper and lower boundaries, and use the Euclidean distance calculation method to convert the left and right boundary differences and the upper and lower boundary differences into pixel coordinate distance values respectively, and obtain the symmetric axis edge distance difference pair; S203: According to the symmetric axis edge distance difference pair, judge whether there is an item in the left and right boundary differences and the upper and lower boundary differences that exceeds the set reference gap threshold of the image, mark the corresponding direction as the offset direction, and combine the offset direction with the corresponding boundary Euclidean distance value into a parameter group to obtain the reflection response boundary offset direction and amplitude identifier.
5. The ranging TOF lens assembly process according to claim 4, characterized in that, The steps for obtaining the multi-directional focusing offset stable trend set are specifically as follows: S301: Based on the reflection response boundary offset direction and amplitude identifier, perform standard step displacement adjustment on the multi-degree-of-freedom motion mechanism respectively, collect TOF reflection images at each adjustment step position, extract the pixel gray values in the central region of the image, calculate the gray maximum value and gray mean value of the region, and obtain the central region gray feature value group; S302: According to the central region gray feature value group, extract the peak gray value and average gray value at the adjustment position, perform difference calculation on the change values of the peak gray value and average gray value at three consecutive step positions, obtain the gray change rate and average change rate respectively, calculate the comprehensive gray fluctuation amount, judge whether the comprehensive gray fluctuation amount falls within the set gray stability threshold, screen the positions that meet the conditions, obtain the position index set of the gray change stable section, and establish the multi-directional gray stable section interval value; S303: Call the multi-directional gray stable section interval value, sum up the number of stable point sets obtained in the positive and negative directions of the X-axis and the positive and negative directions of the Y-axis respectively, perform comparison operations on the number of gray sections in each direction, calculate the difference amount of the number of stable sections in each direction, and judge whether there is any direction among the four directions that deviates from the stable region by more than the difference threshold, and obtain the multi-directional focusing offset stable trend set.
6. The ranging TOF lens assembly process according to claim 5, characterized in that, The specific formula for calculating the comprehensive gray fluctuation amount is: Among them, S i represents the comprehensive amount of gray-scale fluctuation at the i-th adjustment step, and is used to determine whether the current point is in the stable region of gray-scale change. G i represents the peak gray-scale of the image in the central region at the i-th adjustment step. G i-1 represents the peak gray-scale of the image in the central region at the (i - 1)-th adjustment step. A i represents the average gray-scale of the image in the central region at the i-th adjustment step. A i-1 represents the average gray-scale of the image in the central region at the (i - 1)-th adjustment step. A i-2 represents the average gray-scale of the image in the central region at the (i - 2)-th adjustment step.
7. The ranging TOF lens assembly process according to claim 6, characterized in that, The steps for obtaining the focal point locking axial parameter value group in the assembled state are specifically as follows: S401: Call the multi-directional focusing offset stable trend set, according to the multi-directional gray stable section interval values in the four directions, identify the adjustment step position with the smallest gray difference in each direction, extract the position index values in the X direction and Y direction of the corresponding step, and use the step positions that appear crosswise in the four groups of index values as the common position section to obtain the minimum gray disturbance common step index set; S402: Extract the image coordinate blocks corresponding to the indexes in the CCD imaging image according to the minimum gray-scale perturbation common step index set, mark the pixel index values of the left boundary, right boundary, upper boundary, and lower boundary of the block in the image space, calculate the pixel value ranges of the region width and height respectively, determine whether a closed boundary is formed within the image matrix, and obtain the pixel perturbation range of the central focus region; S403: Map the corresponding X-axis and Y-axis position values on the multi-degree-of-freedom motion mechanism according to the pixel perturbation range of the central focus region in the horizontal and vertical ranges in the image plane coordinate system, record the Z-axis axial state value corresponding to the moment as a constant height coordinate, and form a spatial positioning coordinate group with the three axial position values to obtain the focus locking axial parameter value group in the assembled state.
8. The ranging TOF lens assembly process according to claim 7, characterized in that, The process further includes the following steps: S5: Perform a difference operation between the gray-scale mean value within each block and the central gray-scale mean value according to the focus locking axial parameter value group in the assembled state, determine whether the four-quadrant difference is within the range of the focus response stable region, classify the imaging state, perform glue dispensing and fixing on the lens brackets with consistent responses, and generate the consistency evaluation information of the assembled structure; The consistency evaluation information of the assembled structure is specifically a consistent response level label, a defocus critical level label, and a severe defocus level label.
9. The ranging TOF lens assembly process according to claim 8, characterized in that, The specific steps for obtaining the consistency evaluation information of the assembled structure are as follows: S501: Select the pixel coordinate points corresponding to the central light spot in the image gray-scale matrix according to the focus locking axial parameter value group in the assembled state, divide the surrounding area into four equal-distance quadrant sub-blocks of upper left, upper right, lower left, and lower right with the center point as the origin, extract the pixel gray-scale value sets within the four quadrant regions respectively, and obtain the four-quadrant gray-scale distribution data set; S502: Call the four-quadrant gray-scale distribution data set, extract the gray-scale mean value of the quadrant region, perform a difference calculation with the gray-scale mean value of the central light spot respectively, calculate the offset degree value of the quadrant region, determine whether it meets the range of the focus response stable region, perform an operation to obtain the offset classification identification quantity, and obtain the quadrant gray-scale offset comparison result; S503: According to the quadrant gray-scale offset comparison result, count the number of quadrants that meet the condition that the offset degree value does not exceed the range of the focus response stable region, determine whether it belongs to the states of all consistent, partial boundary offset, or full-region focus deviation, and combine with the good product identification standard to establish a classification mapping value corresponding to the state level, perform glue dispensing and fixing on the brackets that meet the consistent conditions, and record the assembled state to obtain the consistency evaluation information of the assembled structure.
10. The ranging TOF lens assembly process according to claim 9, wherein, The formula for calculating the offset degree value of the quadrant region is specifically: Among them, E j represents the gray-scale offset value of the j-th quadrant region, C represents the gray-scale mean value of the central spot region, Q j represents the gray-scale mean value of the j-th quadrant sub-block, Q k represents the gray-scale mean value of the k-th quadrant sub-block.
Citation Information
Cited By
Welding seam positioning and tracking method and system
CN121156436A