Optical device dispensing calibration method and system
By collecting and processing optical device dispensing images, calculating the parameters of the fitted circle and performing calibration, the problems of untimely and inefficient dispensing calibration are solved, real-time feedback and automatic calibration are achieved, and the timeliness and efficiency of calibration is improved.
Patent Information
- Application Number
- CN202510571521.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-05-06
AI Technical Summary
In the prior art, optical device dispensing is not timely and the calibration efficiency is low, resulting in inspection only after the bonding is completed, resulting in waste of working hours and material.
By collecting the dispensing images of the devices to be bonded, performing pre-processing and edge extraction, the center coordinates and radius of the fitted circle are calculated, and the dispensing movement coordinates and duration are calibrated based on these data.
Real-time feedback and automatic calibration of dispensing quality are achieved, timeliness and efficiency of dispensing calibration are improved, and waste of materials and labor hours is reduced.
Smart Images

Figure CN120079561A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical device bonding, and particularly to a method and system for dispensing calibration of optical devices. Background Art
[0002] In the production process of optical devices, an adhesive process is required to bond two parts together. To ensure the bonding quality, the related technology usually checks the glue amount and position manually after the bonding is completed, and then adjusts the parameters of the dispensing equipment according to the inspection results, so as to calibrate the glue amount and position of the dispensing. Since the inspection is carried out after the process is completed, when it is found that the glue amount and position are unqualified, the waste of man-hours and materials has already occurred.
[0003] It can be seen that since the dispensing quality cannot be obtained in real-time feedback and automatic calibration cannot be achieved, there are technical problems of untimely dispensing calibration and low calibration efficiency in the related technology. Summary of the Invention
[0004] The main purpose of the present invention is to provide a method and system for dispensing calibration of optical devices, aiming to solve the technical problems of untimely dispensing calibration and low calibration efficiency in the related technology.
[0005] To achieve the above object, the present invention provides a method for dispensing calibration of optical devices, and the method includes the following steps:
[0006] S1, collecting a dispensing image of the device to be bonded, and performing preprocessing to obtain a preprocessed image;
[0007] S2, marking the glue dot image in the preprocessed image, and performing edge extraction on the glue dot image to obtain the edge pixel points of the glue dot image;
[0008] S3, performing a fitting circle calculation based on the edge pixel points to obtain the center coordinates and radius of the final fitting circle;
[0009] S4, calibrating the dispensing movement coordinates based on the deviation between the center coordinates of the final fitting circle and the center coordinates of the preset standard circle; calibrating the dispensing duration based on the deviation between the radius of the final fitting circle and the radius of the preset standard circle.
[0010] In addition, to achieve the above object, the present invention also provides a system for dispensing calibration of optical devices, and the system includes:
[0011] An image acquisition module, configured to collect a dispensing image of the device to be bonded, and perform preprocessing to obtain a preprocessed image;
[0012] An edge extraction module, configured to mark the glue dot image in the preprocessed image, and perform edge extraction on the glue dot image to obtain the edge pixel points of the glue dot image;
[0013] A fitting calculation module, configured to perform a fitting circle calculation based on the edge pixel points to obtain the center coordinates and radius of the final fitting circle;
[0014] A dispensing calibration module, configured to calibrate the dispensing movement coordinates based on the deviation between the center coordinates of the final fitting circle and the center coordinates of a preset standard circle; and calibrate the dispensing duration based on the deviation between the radius of the final fitting circle and the radius of the preset standard circle.
[0015] In the present invention, by collecting the dispensing image of the device to be bonded and extracting the edge pixel points of the glue dot image in the dispensing image, the dispensing quality information of the device to be bonded can be obtained in a timely manner. On this basis, a fitting circle calculation is performed according to the edge pixel points to obtain the center coordinates and radius of the final fitting circle, so as to quantify the dispensing quality. Therefore, according to the deviation between the center coordinates and radius of the final fitting circle and the center coordinates and radius of the preset standard circle, the dispensing movement coordinates and the dispensing duration can be calibrated in a timely manner. Therefore, the present invention can effectively improve the timeliness and calibration efficiency of dispensing calibration as a whole. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic flowchart of an embodiment of the dispensing calibration method for an optical device of the present invention;
[0017] Figure 2 It is a schematic detailed flowchart of an embodiment of the dispensing calibration method for an optical device of the present invention;
[0018] Figure 3 It is a schematic flowchart of the fitting circle calculation of an embodiment of the dispensing calibration method for an optical device of the present invention.
[0019] The implementation, functional features, and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0021] The inventive concept of the present application will be further elaborated below with reference to some specific embodiments and specific implementation manners.
[0022] An embodiment of the present invention provides a dispensing calibration method for an optical device. Referring to Figure 1 , Figure 1 It is a schematic flowchart of the first embodiment of a dispensing calibration method for an optical device of the present invention.
[0023] In this embodiment, the dispensing calibration method for an optical device includes:
[0024] Step S1: Collect the dispensing image of the device to be bonded and perform preprocessing to obtain a preprocessed image.
[0025] As Figure 2 shown, step S1 specifically includes the following steps:
[0026] Step S11: Use an industrial camera to take pictures of the device to be bonded after dispensing to obtain a dispensing image.
[0027] Step S12: By means of ROI region extraction, intercept the rectangular region containing the glue dot image in the dispensing image to obtain a preprocessed image.
[0028] In the whole step S1, by timely collecting the dispensing images of the device to be bonded during the bonding process, it is beneficial to timely obtain the quality information during the dispensing process and feedback to calibrate the dispensing equipment, thereby avoiding a large number of devices with dispensing quality problems after bonding due to lagged feedback, greatly reducing material waste and man-hour waste.
[0029] Step S2: Mark the glue dot image in the preprocessed image and perform edge extraction on the glue dot image to obtain the edge pixel points of the glue dot image.
[0030] Continue to refer to Figure 2 , step S2 specifically includes the following steps:
[0031] Step S21: Smooth the preprocessed image through a Gaussian filter to highlight the edge information of the glue dot image and obtain a smoothed image.
[0032] Step S21 specifically includes the following steps:
[0033] Step S21-1: Establish a 3×3 filtering template, and set the coordinate points of the filtering template as follows:
[0034] ;
[0035] Step S21-2: Use the Gaussian function to calculate the weight values of the coordinate points in the filtering template to obtain a Gaussian convolution kernel.
[0036] The Gaussian function is:
[0037] ;
[0038] Among them, represents the weight value of the coordinate point ; represents the standard deviation of the Gaussian function, which controls the degree of blurring. The larger the value, the stronger the blurring effect.
[0039] For example, taking equal to 1, the following Gaussian convolution kernel can be obtained:
[0040] ;
[0041] Step S21-3: Convolve the preprocessed image with a Gaussian convolution kernel to obtain a smoothed image.
[0042] In the entire Step S21, smoothing the preprocessed image through a Gaussian filter can smooth the noise and details in the preprocessed image, reduce the interference of noise and details on the edge information of the glue dot image, facilitate the accurate extraction of the edge pixel points of the glue dot image, and thus improve the recognition accuracy of the glue dot image contour.
[0043] Step S22: Mark the glue dot image in the smoothed image as the foreground target, and use the GrabCut algorithm to segment the smoothed image to obtain a segmented image with optimal foreground and background segmentation.
[0044] Step S23: Process the segmented image using the Canny edge algorithm to obtain the edge pixel points of the glue dot image.
[0045] The specific steps of Step S23 include the following steps:
[0046] Step S23-1: Process the segmented image using a gradient calculation tool to obtain a gradient image.
[0047] Step S23-2: Use the non-maximum suppression method to detect the edges of the glue dot image in the gradient image along the gradient direction, delete non-edge pixels, and retain edge pixels.
[0048] Step S23-3: Use the double-threshold detection method to divide the edge pixels into strong edge pixels and weak edge pixels, discard isolated weak edge pixels, retain strong edge pixels and weak edge pixels connected to strong edge pixels, and obtain the edge pixel points of the glue dot image.
[0049] In the entire Step S23, accurately extracting the edge pixel points of the glue dot image through the Canny edge algorithm can more precisely obtain the contour information of the glue dot image, which is beneficial to the accurate feedback of the dispensing quality.
[0050] Step S3: Perform a fitting circle calculation based on the edge pixel points to obtain the center coordinates and radius of the final fitted circle.
[0051] Continue to refer to Figure 2 , the specific steps of Step S3 include the following steps:
[0052] Step S31: Divide every two pixel points within the 8-neighborhood of the edge pixel points into an edge chain until all the edge pixel points are divided. Remove the edge chains with less than 20 pixel points to obtain multiple groups of edge chains.
[0053] Step S32: Traverse each group of edge chains, perform circle fitting calculations based on the edge pixel points in each group of edge chains, and obtain the center coordinates and radius of the final fitted circle.
[0054] As Figure 3 shown, the step S32 specifically includes the following steps:
[0055] Step S32-1: Traverse all edge chains, and arbitrarily select an unfitted edge chain as the target edge chain.
[0056] Step S32-2: Set the initial value of the number of fitting points N to 20.
[0057] Step S32-3: Traverse the pixel points on the target edge chain, and arbitrarily select a pixel point as the target pixel point.
[0058] Step S32-4: Then select N - 1 pixel points closest to the target pixel point from the target edge chain, and jointly form fitting points with the target pixel point.
[0059] Step S32-5: Based on the fitting points, perform circle fitting calculations using the fitting calculation formula to obtain the first fitted circle and the center coordinates and radius of the first fitted circle:
[0060] ;
[0061] where represents the abscissa of the i-th fitting point corresponding to the first fitted circle; represents the ordinate of the i-th fitting point corresponding to the first fitted circle; represents the abscissa of the center of the first fitted circle; represents the ordinate of the center of the first fitted circle; represents the radius of the first fitted circle; C, D, F, a, b, and c represent intermediate variables in the calculation and have no actual meaning.
[0062] Step S32-6: According to the center coordinates and radius of the first fitted circle, determine whether the first fitted circle is reasonable; if not, discard the first fitted circle; if so, save the first fitted circle and calculate the average error of the first fitted circle.
[0063] Specifically, the judgment criteria for whether the first fitted circle is reasonable are as follows:
[0064] or or ;
[0065] where represents the abscissa of the center of the preset standard circle; represents the ordinate of the center of the preset standard circle; represents the radius of the preset standard circle; represents the adjustment threshold for the horizontal coordinate deviation of the center of the circle; represents the adjustment threshold for the vertical coordinate deviation of the center of the circle; represents the adjustment threshold for the radius deviation.
[0066] That is, when any one of the horizontal coordinate, vertical coordinate, and radius of the first fitted circle satisfies the above judgment condition, it is considered that the first fitted circle is unreasonable.
[0067] The calculation formula for the average error of the first fitted circle is:
[0068] .
[0069] Step S32-7: The number of fitting points N is incremented by one, and step S32-3 is executed again until all pixel points on the target edge chain are traversed, obtaining multiple first fitted circles and their corresponding average errors.
[0070] Step S32-8: Select the first fitted circle with the smallest average error from multiple first fitted circles as the second fitted circle.
[0071] Return to execute step S32-2 until the number of fitting points N is greater than the total number of pixel points in the target edge chain, obtaining multiple second fitted circles and their corresponding average errors.
[0072] Step S32-9: Denote the smallest average error among multiple second fitted circles as Emin, and select the second fitted circle with the average error between Emin and 1.2Emin and the largest number of fitting points N from multiple second fitted circles as the third fitted circle.
[0073] Return to execute step S32-1 until all edge chains are traversed, obtaining multiple third fitted circles.
[0074] Step S32-10: Select the third fitted circle with the largest number of fitting points N from multiple third fitted circles as the final fitted circle, and obtain the center coordinates and radius of the final fitted circle.
[0075] It is worth mentioning that the final fitted circle is the fitted circle closest to the image contour of the glue dot. The center coordinates of the final fitted circle are also the center coordinates of the glue dot image, which can represent the position coordinates of the glue application by the glue application device this time; the radius of the final fitted circle can reflect the area size of the glue dot image, and the area size of the glue dot image reflects the amount of glue applied. Therefore, the radius of the final fitted circle indirectly reflects the glue application duration of this glue application. Thus, the center coordinates and radius of the final fitted circle can most reflect the quality of glue application.
[0076] During the entire step S32, through a nested loop structure, each edge pixel point of the glue dot image is fully utilized for fitting circle calculation, and then an optimization operation is performed based on the average error of the fitted circle. The final fitted circle closest to the actual contour of the glue dot image can be obtained, significantly improving the fitting accuracy of the fitting circle calculation, and thus enabling more accurate feedback and quantification of the dispensing quality.
[0077] Step S4: Calibrate the dispensing movement coordinates based on the deviation between the center coordinates of the final fitted circle and the center coordinates of the preset standard circle; calibrate the dispensing duration based on the deviation between the radius of the final fitted circle and the radius of the preset standard circle.
[0078] Specifically, if the center coordinates and radius of the final fitted circle simultaneously meet the following conditions, there is no need to calibrate the dispensing movement coordinates and the dispensing duration. Otherwise, calibrate the dispensing movement coordinates according to the deviation of the center coordinates or calibrate the dispensing duration according to the deviation of the radius:
[0079] ;
[0080] Among them, represents the qualified threshold for the deviation of the center abscissa, less than ; represents the qualified threshold for the deviation of the center ordinate, less than ; represents the qualified threshold for the radius deviation, less than .
[0081] In this embodiment, by collecting the dispensing image of the device to be bonded and extracting the edge pixel points of the glue dot image in the dispensing image, the dispensing quality information of the device to be bonded can be obtained in a timely manner. On this basis, a fitting circle calculation is performed according to the edge pixel points to obtain the center coordinates and radius of the final fitted circle, and the dispensing quality can be quantified. Thus, according to the deviation of the center coordinates and radius of the final fitted circle compared with the center coordinates and radius of the preset standard circle, the dispensing movement coordinates and the dispensing duration can be calibrated in a timely manner. Therefore, the present invention can effectively improve the timeliness and calibration efficiency of dispensing calibration as a whole.
[0082] Furthermore, to achieve the above object, the present invention also provides an optical device dispensing calibration system, which may include.
[0083] An image acquisition module, configured to collect the dispensing image of the device to be bonded and perform preprocessing to obtain a preprocessed image;
[0084] An edge extraction module, configured to mark the glue dot image in the preprocessed image and perform edge extraction on the glue dot image to obtain the edge pixel points of the glue dot image;
[0085] A fitting calculation module, configured to perform fitting circle calculation based on the edge pixel points to obtain the center coordinates and radius of the final fitting circle;
[0086] A dispensing calibration module, configured to calibrate the dispensing movement coordinates based on the deviation between the center coordinates of the final fitting circle and the center coordinates of a preset standard circle; and calibrate the dispensing duration based on the deviation between the radius of the final fitting circle and the radius of the preset standard circle.
[0087] It should be noted that the functions that can be realized by each module in the optical device dispensing calibration system provided in this embodiment and the corresponding technical effects achieved can refer to the descriptions of the specific implementation manners in the various embodiments of the optical device dispensing calibration method of the present invention. For the sake of simplicity of the specification, they will not be elaborated here.
[0088] The serial numbers of the embodiments of the present invention above are only for description and do not represent the superiority or inferiority of the embodiments.
[0089] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structural or equivalent process transformations made by using the contents of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, are equally included in the patent protection scope of the present invention.
Claims
1. A method for calibrating optical device dispensing, characterized in that: The method comprises the following steps: S1, collecting the dispensing image of the device to be bonded, and performing preprocessing to obtain a preprocessing image; S2, marking the glue point image in the preprocessed image, and performing edge extraction on the glue point image to obtain edge pixel points of the glue point image; S3, performing fitting circle calculation based on the edge pixel points to obtain the center coordinates and radius of the final fitting circle; S4, based on the deviation between the center coordinates of the final fitting circle and the center coordinates of the preset standard circle, calibrate the dispensing movement coordinates; based on the deviation between the radius of the final fitting circle and the radius of the preset standard circle, calibrate the dispensing duration.
2. The optical device dispensing calibration method according to claim 1, characterized in that: The S1 specifically includes: S11, using an industrial camera to photograph the device to be bonded after dispensing glue to obtain a dispensing glue image; S12, using a ROI region extraction method, intercepting a rectangular region containing the glue spot image in the glue dispensing image to obtain a preprocessed image.
3. The optical device dispensing calibration method according to claim 1, characterized in that: The S2 specifically includes: S21, smoothing the preprocessed image by using a Gaussian filter to highlight edge information of the glue point image to obtain a smoothed image; S22, marking the glue point image in the smooth image as a foreground target, and using the GrabCut algorithm to segment the smooth image to obtain a segmented image with optimal foreground and background segmentation; S23, using the Canny edge algorithm to process the segmented image to obtain edge pixel points of the glue point image.
4. The optical device dispensing calibration method according to claim 3, characterized in that: The S21 specifically includes: S21-1, establish a 3×3 filter template, and set the coordinate points of the filter template as follows: ; S21-2, using a Gaussian function to calculate the weight value of each coordinate point in the filter template to obtain a Gaussian convolution kernel; S21-3, using the Gaussian convolution kernel to perform convolution processing on the preprocessed image to obtain the smoothed image.
5. The optical device dispensing calibration method according to claim 3, characterized in that: The S23 specifically includes: S23-1, using a gradient calculation tool to process the segmented image to obtain a gradient image; S23-2, using a non-maximum suppression method to detect the edge of the glue point image in the gradient image along the gradient direction, deleting non-edge pixels and retaining edge pixels; S23-3: Use a dual threshold detection method to divide the edge pixels into strong edge pixels and weak edge pixels, discard isolated weak edge pixels, retain strong edge pixels and weak edge pixels connected to the strong edge pixels, and obtain edge pixel points of the glue point image.
6. The optical device dispensing calibration method according to claim 1, characterized in that: The S3 specifically includes: S31, dividing every two pixel points in the 8-neighborhood of the edge pixel points into an edge chain, until all edge pixel points are divided, removing edge chains with less than 20 pixels, and obtaining multiple groups of edge chains; S32, traversing each group of edge chains, performing fitting circle calculation based on edge pixel points in each group of edge chains, and obtaining the center coordinates and radius of the final fitting circle.
7. The optical device dispensing calibration method according to claim 6, characterized in that: The S32 specifically includes: S32-1, traverse all edge chains and arbitrarily select a group of unfitted edge chains as target edge chains; S32-2, setting the initial value of the number of fitting points N to 20; S32-3, traverse the pixel points on the target edge chain and arbitrarily select a pixel point as the target pixel point; S32-4, selecting N-1 pixel points closest to the target pixel point from the target edge chain, and forming a fitting point together with the target pixel point; S32-5, based on the fitting points, using a fitting calculation formula to perform fitting circle calculation, to obtain a first fitting circle and the center coordinates and radius of the first fitting circle; S32-6, judging whether the first fitting circle is reasonable according to the center coordinates and radius of the first fitting circle; if it is unreasonable, discarding the first fitting circle; if it is reasonable, saving the first fitting circle, and calculating the average error of the first fitting circle; S32-7, the number of fitting points N is incremented by one, and the process returns to execute S32-3 until all pixel points on the target edge chain are traversed to obtain a plurality of first fitting circles and corresponding average errors; S32-8, selecting a first fitting circle with the smallest average error from the plurality of first fitting circles as a second fitting circle; returning to execute S32-2 until the number of fitting points N is greater than the total number of pixel points in the target edge chain, and obtaining a plurality of second fitting circles and corresponding average errors; S32-9, record the minimum average error among the plurality of second fitting circles as Emin, select the second fitting circle with the average error between Emin and 1.2Emin and the largest number of fitting points N from the plurality of second fitting circles as the third fitting circle; return to execute S32-1 until all edge chains are traversed to obtain a plurality of third fitting circles; S32-10, selecting a third fitting circle with the largest number of fitting points N from the multiple third fitting circles as a final fitting circle, and obtaining the center coordinates and radius of the final fitting circle.
8. An optical device dispensing calibration system, characterized in that: The system comprises: An image acquisition module is used to acquire the dispensing image of the device to be bonded and perform preprocessing to obtain a preprocessed image; An edge extraction module is used to mark the glue point image in the preprocessed image and perform edge extraction on the glue point image to obtain edge pixel points of the glue point image; A fitting calculation module, used to calculate a fitting circle based on the edge pixels to obtain the center coordinates and radius of the final fitting circle; The dispensing calibration module is used to calibrate the dispensing movement coordinates based on the deviation between the center coordinates of the final fitting circle and the center coordinates of the preset standard circle; and to calibrate the dispensing duration based on the deviation between the radius of the final fitting circle and the radius of the preset standard circle.
Citation Information
Patent Citations
Image edge detection method based on fuzzy set
CN106097339A
A hub contour detection method based on improved Hough transform
CN108986038A
Glass gluing method and device, electronic equipment and storage medium
CN111369593A
Method for correcting collimation light path of multi-channel high-speed device
CN113534349A
Image enhancement and feature extraction method for automatic welding
CN115147448A
Cited By
Water-based adhesive coating control method and system based on artificial intelligence optimization
CN120630740A