Optical detection device and compensation method therefor, storage medium
By adding a reference plate to the optical inspection equipment and calculating the compensation amount, the image deformation problem caused by thermal expansion of the CIS sensor was solved, the inspection accuracy was improved and the equipment was protected.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU VEGA TECH CO LTD
- Filing Date
- 2021-09-24
- Publication Date
- 2026-04-10
AI Technical Summary
When using a wide-field industrial camera to inspect the hole position accuracy of a PCB board, the image deformation caused by the thermal expansion of the CIS sensor affects the inspection accuracy, and the cooling process may lead to a decrease in camera image quality or damage.
A reference plate is added to the optical inspection equipment. The compensation amount is calculated by acquiring the image information of the reference plate, and the detection compensation is performed to improve the accuracy and avoid damage to the image acquisition device.
This improved detection accuracy, prevented damage to the image acquisition device, and ensured the accuracy of the detection and the integrity of the equipment.
Smart Images

Figure CN115854864B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of optical detection technology, and in particular to a compensation method of an optical detection device, an optical detection device and a computer readable storage medium. BACKGROUND
[0002] In a device for detecting PCB (Printed Circuit Board) hole position precision using a wide-format industrial camera, since the wide-format industrial camera adopts a CIS (Contact Image Sensor) sensor, and the CIS sensor is easily affected by thermal expansion and contraction, when the camera continuously works, the collected image will be deformed along the direction of the camera due to the thermal expansion of the CIS sensor, thereby affecting the detection precision.
[0003] In the related art, a water chiller is added to the camera to cool the camera by the water chiller to solve the problem of thermal expansion of the CIS sensor in the camera, thereby improving the detection precision. However, when this method is used, if the ambient temperature around the camera is relatively high, condensate water is easily formed on the camera, thereby affecting the camera imaging quality, and in severe cases, the camera may even be damaged due to water ingress. SUMMARY
[0004] The present application aims to at least solve one of the technical problems in the related art to some extent.
[0005] To this end, a first object of the present application is to provide a compensation method of an optical detection device, which acquires a compensation amount of an image acquisition device by adding a reference plate to the optical detection device and acquiring the compensation amount of the image acquisition device using the reference plate before detecting a to-be-detected plate, so as to not only improve the detection precision of the optical detection device, but also avoid damaging the image acquisition device.
[0006] A second object of the present application is to provide a computer readable storage medium.
[0007] A third object of the present application is to provide an optical detection device.
[0008] To achieve the above objects, a compensation method of an optical detection device is provided in an embodiment of the first aspect of the present application. The optical detection device includes an image acquisition device and a reference plate. The reference plate and a to-be-detected plate are located on the same side of the image acquisition device and do not overlap. The reference plate is provided with a plurality of positioning points. The method includes: before detecting the to-be-detected plate, controlling the image acquisition device to acquire first image information of the reference plate; acquiring actual coordinates of each positioning point in the plurality of positioning points and an offset amount between the actual coordinates and theoretical coordinates according to the first image information; and acquiring a compensation amount of the image acquisition device according to the actual coordinates of each positioning point and the offset amount.
[0009] The compensation method of the optical detection device according to the embodiment of the present application adds a reference plate to the optical detection device, controls the image acquisition device to acquire first image information of the reference plate before detecting the to-be-detected plate, acquires actual coordinates of each positioning point on the reference plate and an offset between the actual coordinates and theoretical coordinates according to the first image information, and acquires a compensation amount of the image acquisition device according to the actual coordinates of each positioning point and the offset to perform detection compensation, so that the detection precision of the optical detection device can be improved, and damage to the image acquisition device can be avoided.
[0010] According to an embodiment of the present application, the compensation amount of the image acquisition device according to the actual coordinates of each positioning point and the offset comprises: acquiring an X-direction actual coordinate and an X-direction offset of each positioning point; acquiring an X-direction average offset of the multiple positioning points according to the X-direction offset of each positioning point; and performing a straight line fitting operation according to the X-direction actual coordinate of each positioning point and a difference between the X-direction offset of each positioning point and the X-direction average offset to obtain a stretch-shrink compensation amount.
[0011] According to an embodiment of the present application, the compensation amount of the image acquisition device according to the actual coordinates of each positioning point and the offset further comprises: acquiring an X-direction actual coordinate and a Y-direction offset of each positioning point; acquiring a Y-direction average offset of the multiple positioning points according to the Y-direction offset of each positioning point; and performing a straight line fitting operation according to the X-direction actual coordinate of each positioning point and a difference between the Y-direction offset of each positioning point and the Y-direction average offset to obtain a rotation compensation amount.
[0012] According to an embodiment of the present application, the stretch-shrink compensation amount and the rotation compensation amount are both straight line slopes obtained after the straight line fitting operation.
[0013] According to an embodiment of the present application, after the compensation amount of the image acquisition device is obtained, the method further comprises: controlling the image acquisition device to acquire second image information of the to-be-detected plate to detect the to-be-detected plate; acquiring actual coordinates of a to-be-detected hole in the second image information; and compensating the actual coordinates of the to-be-detected hole according to the compensation amount.
[0014] According to an embodiment of the present application, the actual coordinates of the to-be-detected hole are compensated in the following manner:
[0015]
[0016] wherein (px, py) represents the actual coordinates of the to-be-detected hole before compensation, (px1, py1) represents the actual coordinates of the to-be-detected hole after compensation, a represents the stretch-shrink compensation amount, and a1 represents the rotation compensation amount.
[0017] According to one embodiment of the present application, the method for obtaining the offset between the actual coordinates and the theoretical coordinates of each positioning point according to the first image information comprises: obtaining the first theoretical coordinates and the actual coordinates of any two positioning points in the plurality of positioning points; obtaining the rotation offset and the translation offset of the plurality of positioning points according to the first theoretical coordinates and the actual coordinates of the two positioning points; obtaining the second theoretical coordinates of each positioning point according to the rotation offset, the translation offset and the first theoretical coordinates of each positioning point in the plurality of positioning points; and obtaining the offset between the actual coordinates and the theoretical coordinates of each positioning point according to the second theoretical coordinates and the actual coordinates of each positioning point in the plurality of positioning points.
[0018] To achieve the above object, the second aspect of the present application provides a computer readable storage medium, which stores an optical detection device compensation program, and the optical detection device compensation program is executed by a processor to implement the optical detection device compensation method described in the above embodiments.
[0019] The computer readable storage medium according to the embodiment of the present application stores the optical detection device compensation program, and the optical detection device compensation program is executed by a processor to implement the optical detection device compensation method described in the above embodiments, so that the detection accuracy of the optical detection device can be improved, and the image acquisition device can be prevented from being damaged.
[0020] To achieve the above object, the third aspect of the present application provides an optical detection device, which comprises: an image acquisition device, a reference plate and a processor, the reference plate and a to-be-detected plate are located on the same side of the image acquisition device and do not overlap, the reference plate is provided with a plurality of positioning points, and the processor is configured to implement the optical detection device compensation method described in the above embodiments.
[0021] The optical detection device according to the embodiment of the present application increases the reference plate on the optical detection device, and obtains the compensation amount of the image acquisition device by using the reference plate before detecting the to-be-detected plate, so that the detection accuracy of the optical detection device can be improved, and the image acquisition device can be prevented from being damaged.
[0022] According to one embodiment of the present application, the optical detection device further comprises: a lower cover plate for carrying the to-be-detected plate, the reference plate is arranged at the rear end of the lower cover plate, the image acquisition device is located below the lower cover plate and the reference plate, and the image acquisition device obtains the image of the reference plate before shooting the to-be-detected plate.
[0023] According to one embodiment of the present application, the reference plate is provided with a marking surface having the positioning points, the lower cover plate has a carrying surface for supporting the to-be-detected plate, and the marking surface and the carrying surface are at the same height.
[0024] According to one embodiment of the present application, the reference plate is embedded in the lower cover plate, or is placed on the lower cover plate, or is placed outside the lower cover plate through a connecting member. BRIEF DESCRIPTION OF DRAWINGS
[0025] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, including the references to the figures, in which:
[0026] Figure 1 Structure diagram of an optical detection device according to one embodiment of the present application;
[0027] Figure 2 Front view of a reference plate and a lower cover plate according to a first embodiment of the present application;
[0028] Figure 3 Front view of a reference plate and a lower cover plate according to a second embodiment of the present application;
[0029] Figure 4 Front view of a reference plate and a lower cover plate according to a third embodiment of the present application;
[0030] Figure 5 Top view of the reference plate and the lower cover plate shown in Figure 2
[0031] Figure 6 Schematic diagram of a reference plate according to one embodiment of the present application;
[0032] Figure 7 Flowchart of a compensation method of an optical detection device according to one embodiment of the present application;
[0033] Figure 8 Flowchart of compensating actual coordinates of a hole to be detected according to one embodiment of the present application. DETAILED DESCRIPTION
[0034] Embodiments of the present application are described in detail below with reference to the accompanying drawings, in which like reference numerals refer to like elements or elements having the same or similar function throughout. The embodiments described below by way of example are intended to explain the present application, and should not be understood as limiting the present application.
[0035] An optical detection device and a compensation method thereof, and a storage medium according to embodiments of the present application are described below with reference to the accompanying drawings.
[0036] It should be noted that in the present application, the optical detection device includes an image acquisition device and a reference plate, the reference plate and a to-be-detected plate are located on the same side of the image acquisition device and do not overlap, and a plurality of positioning points are arranged on the reference plate. The to-be-detected plate can be a PCB or the like.
[0037] As a specific example, as shown in Figure 1 , the optical detection device can include a machine table 110, a worktable 120, an image acquisition device 130 (such as a wide-format industrial camera), a lower cover plate 140, a reference plate 150, a backlight 160, and an upper cover plate 170. Among them, the worktable 120 is translatably arranged on the machine table 110; the image acquisition device 130 is fixed on the machine table 110 through a fine adjustment support and is located below the lower cover plate 140 and the reference plate 150; the lower cover plate 140 is arranged on the machine table 110 and is used to carry a to-be-detected plate; the reference plate 150 is arranged on the lower cover plate 140, and optionally, the reference plate 150 is arranged at the rear end of the lower cover plate 140, that is, one end of the lower cover plate 140 close to the image acquisition device 130, so that the image acquisition device 130 can obtain the image of the reference plate 150 before shooting the to-be-detected plate, so as to compensate the image acquisition device 130 based on the image; and the upper cover plate 170 is translatably and liftable arranged on the worktable 120. Further, the reference plate 150 is provided with a marking surface having a positioning point 151, and the lower cover plate 140 has a carrying surface for supporting the to-be-detected plate, and the marking surface and the carrying surface are at the same height.
[0038] As a first example, the reference plate 150 is embedded in the lower cover plate 140. Specifically, referring to Figure 2 and Figure 5 , the lower cover plate 140 includes an optical glass plate 142 and a frame 144, and the reference plate 150 is embedded in the frame 144 of the lower cover plate 140. For example, the size of the interval limited by the frame 144 is 700*800mm, wherein the size of the optical glass plate 142 can be 700*780mm, the size of the reference plate 150 can be 700*20mm, the reference plate 150 is provided with a plurality of positioning points 151, the plurality of positioning points 151 are located on the upper surface (i.e. the marking surface 152) of the reference plate 150, the to-be-detected plate is located on the upper surface (i.e. the carrying surface 146) of the optical glass plate 142, and the upper surface of the reference plate 150 and the upper surface of the optical glass plate 142 are at the same height, and the image acquisition device 130 is located below the lower cover plate 140 and the reference plate 150, so that the focal length of the image acquisition device 130 is the same when scanning the reference plate 150 and the to-be-detected plate, thereby ensuring the verification accuracy.
[0039] As a second example, the reference plate 150 is placed on the lower cover plate 140. Specifically, referring to Figure 3As shown, the lower cover plate 140 includes an optical glass plate 142. A reference plate 150 is located above the optical glass plate 142 of the lower cover plate 140. For example, the reference plate 150 is attached to the upper part of the optical glass plate 142 and close to one side of the optical glass plate 142. A plurality of positioning points 151 are provided on the reference plate 150. The plurality of positioning points 151 are located on the lower surface (i.e., the marking surface 152) of the reference plate 150. The plate to be tested is located on the upper surface (i.e., the bearing surface 146) of the optical glass plate 142. The lower surface (i.e., the marking surface 152) of the reference plate 150 is flush with the upper surface (i.e., the bearing surface 146) of the optical glass plate 142. The image acquisition device 130 is located on the lower surface of the lower cover plate 140. This can ensure that the focal length of the image acquisition device 130 is the same when scanning the reference plate 150 and the plate to be tested, thereby ensuring the verification accuracy.
[0040] As a third example, the reference plate 150 is disposed outside the lower cover plate 140 via a connector. Specifically, as... Figure 4 As shown, the lower cover plate 140 includes an optical glass plate (not specifically marked in the figure) and a frame 144. The reference plate 150 can be connected to one side of the frame 144 via a connector (not specifically marked in the figure). The reference plate 150 is provided with multiple positioning points 151, which are located on the lower surface (i.e., the marking surface 152) of the reference plate 150. The plate to be tested is located on the upper surface (i.e., the bearing surface 146) of the optical glass plate 142, and the lower surface (i.e., the marking surface 152) of the reference plate 150 is flush with the upper surface (i.e., the bearing surface 146) of the optical glass plate 142. The image acquisition device 130 is located on the lower surface of the lower cover plate 140. This can ensure that the focal length of the image acquisition device 130 is the same when scanning the reference plate 150 and the plate to be tested, thereby ensuring the verification accuracy.
[0041] Optionally, the reference plate 150 can be a hole positioning plate, such as... Figure 5 As shown, at this time, the multiple positioning points 151 of the reference plate 150 are the center points of the circular holes of the same diameter arranged in a certain position and pattern on the hole calibration plate; the reference plate 150 can also be a checkerboard pattern, such as... Figure 6 As shown, the multiple positioning points of the reference plate 150 at this time are the center points of the black and white squares arranged according to a certain pattern on the checkerboard calibration plate. In actual use, the reference plate 150 is not limited to this.
[0042] In use, the upper cover plate 170 is first controlled to be translated to be staggered with the lower cover plate 140 in horizontal direction by the electromagnetic valve, and then the operator places the to-be-detected plate on the lower cover plate 140, and then the upper cover plate 170 is controlled to be moved to overlap with the lower cover plate 140 and to be lowered to press the to-be-detected plate by the electromagnetic valve, and then the workbench 120 drives the upper cover plate 170, the lower cover plate 140 and the to-be-detected plate to be translated to pass above the image acquisition device 130, the image acquisition device 130 scans the image of the reference plate 150 first to obtain the corresponding compensation amount, and then scans the image of the to-be-detected plate, and the image is compensated according to the compensation amount.
[0043] Figure 7 A flowchart of a compensation method of an optical detection device according to an embodiment of the present application is shown in FIG. 1. As shown in the figure, the compensation method of the optical detection device can include the following steps: Figure 7
[0044] Step S1, before detecting the to-be-detected plate, the image acquisition device is controlled to acquire the first image information of the reference plate.
[0045] Specifically, before detecting the to-be-detected plate, as shown in FIG. 2, the workbench 120 is controlled to be moved, so that the workbench 120 drives the upper cover plate 170, the lower cover plate 140 and the to-be-detected plate to be translated, so that the reference plate 150 on the lower cover plate 140 passes above the image acquisition device 130, and the image acquisition device 130 is controlled to acquire the image information of the reference plate 150, which is recorded as the first image information. Figure 1
[0046] Step S2, the actual coordinates of each positioning point in the plurality of positioning points and the offset between the actual coordinates and the theoretical coordinates are acquired according to the first image information.
[0047] Specifically, after obtaining the first image information, the first image information can be analyzed to obtain the actual coordinates of each positioning point on the reference plate and the offset between the actual coordinates and the theoretical coordinates.
[0048] Optionally, in some embodiments, acquiring the offset between the actual coordinates and the theoretical coordinates includes: acquiring the first theoretical coordinates and the actual coordinates of any two positioning points in the plurality of positioning points of the reference plate; acquiring the rotation offset and the translation offset of the plurality of positioning points according to the first theoretical coordinates and the actual coordinates of the above two positioning points; acquiring the second theoretical coordinates of each positioning point in the plurality of positioning points according to the rotation offset, the translation offset and the first theoretical coordinates of each positioning point in the plurality of positioning points; and acquiring the offset between the actual coordinates and the theoretical coordinates of each positioning point according to the second theoretical coordinates and the actual coordinates of each positioning point in the plurality of positioning points.
[0049] For example, as shown in FIG. 3, the first theoretical coordinates and the actual coordinates of the two positioning points A and B in the plurality of positioning points of the reference plate are acquired, and then the rotation offset and the translation offset of the plurality of positioning points are acquired according to the first theoretical coordinates and the actual coordinates of the two positioning points A and B. Figure 2 As shown, the two positioning points at the leftmost and rightmost ends of the reference plate can be used as references to obtain the offset between the actual coordinates and theoretical coordinates of each positioning point among multiple positioning points on the reference plate. For ease of explanation, these two positioning points are denoted as M and N. Specifically, by analyzing the first image information, the actual coordinates of positioning point M can be obtained as (X... m ,Y m The actual coordinates of the positioning point N are (X... n ,Y n Meanwhile, based on the parameters of the reference plate in the software, the first theoretical coordinates of the positioning point M can be obtained as (X1) m Y1 m The first theoretical coordinate of the positioning point N is (X1) n Y1 n After obtaining the first theoretical and actual coordinates of positioning points M and N, the rotational offset θ and translational offset t of the reference plate can be calculated according to the following formula (1). x and t y :
[0050]
[0051] Where (X,Y) represents the actual coordinates and (X1,Y1) represents the first theoretical coordinates.
[0052] Next, based on the calculated rotation offset θ and translation offset t x and t y Calculate the second theoretical coordinates of each positioning point on the reference plate, that is, the first theoretical coordinates (X1) of each positioning point. i Y1 i Substitute the values into the following formula (2) to calculate the second theoretical coordinates (X2) of each positioning point. i Y2 i ):
[0053]
[0054] Among them, (X1) i Y1 i (X2) represents the first theoretical coordinate of the i-th positioning point. i Y2 i ) represents the second theoretical coordinate of the i-th positioning point.
[0055] Next, the offset (Dx) of each positioning point is calculated based on the actual coordinates and the second theoretical coordinates of each positioning point. i ,Dy i ), where i = 1, 2, ..., n, and n represents the total number of positioning points.
[0056] Step S3, obtaining the compensation amount of the image acquisition device according to the actual coordinates of each positioning point and the offset amount.
[0057] Specifically, after obtaining the actual coordinates of each positioning point and the offset amount, the compensation amount of the image acquisition device can be obtained according to the actual coordinates and the offset amount.
[0058] It should be noted that the CIS sensor in the image acquisition device expands due to heat, causing the collected image to deform in the direction of the image acquisition device, that is, to produce a swelling and shrinking deviation, so the swelling and shrinking deviation can be compensated to improve the detection accuracy; at the same time, the relative movement between the image acquisition device and the workbench will cause the image to produce a rotation offset, that is, to produce a rotation deviation, so the rotation deviation can be compensated to improve the detection accuracy, so in some embodiments of the present application, the image acquisition device can be compensated for swelling and shrinking deviation and rotation deviation to improve the detection accuracy from multiple aspects. Correspondingly, the compensation amount of the image acquisition device includes the swelling and shrinking compensation amount and the rotation compensation amount.
[0059] Wherein, the swelling and shrinking compensation amount is obtained, including: obtaining the X-direction actual coordinates of each positioning point and the X-direction offset amount; obtaining the X-direction average offset amount of the plurality of positioning points according to the X-direction offset amount of each positioning point; and performing a straight line fitting operation according to the difference between the X-direction actual coordinates of each positioning point and the X-direction offset amount and the X-direction average offset amount, to obtain the swelling and shrinking compensation amount.
[0060] It should be noted that the X-direction here refers to the direction along the image acquisition device. When obtaining the swelling and shrinking compensation amount, the X-direction actual coordinates of each positioning point on the reference plate are taken as the X-direction coordinates of the points in the two-dimensional coordinate system, and the X-direction offset amount of each positioning point on the reference plate minus the X-direction average offset amount is taken as the Y-direction coordinates of the points in the two-dimensional coordinate system, and a straight line fitting operation is performed to obtain the swelling and shrinking compensation amount. Wherein, the X-direction average offset amount is the sum of the X-direction offset amount of each positioning point on the reference plate divided by the total number of positioning points, that is, as shown in the following formula (3):
[0061]
[0062] Wherein, represents the X-direction average offset amount.
[0063] Correspondingly, the difference between the X-direction offset amount of each positioning point on the reference plate and the X-direction average offset amount is obtained, that is, as shown in the following formula (4):
[0064]
[0065] Wherein, dx i represents the difference between the X-direction offset amount of the i th positioning point and the X-direction average offset amount, Dxi represents the X-direction offset of the i-th positioning point.
[0066] Correspondingly, the points composed of (X i , dy i ) are subjected to linear fitting operation, to obtain a straight line y = ax + b, wherein the slope a of the straight line represents the expansion and contraction compensation amount of the image acquisition device.
[0067] Further, the rotation compensation amount of the image acquisition device is obtained, including: obtaining the X-direction actual coordinate and the Y-direction offset of each positioning point; obtaining the Y-direction average offset of the multiple positioning points according to the Y-direction offset of each positioning point; and performing linear fitting operation according to the X-direction actual coordinate of each positioning point and the difference between the Y-direction offset and the Y-direction average offset of each positioning point, to obtain the rotation compensation amount.
[0068] It should be noted that the Y-direction here refers to the direction along which the workbench moves. When obtaining the rotation compensation amount, the X-direction actual coordinate of each positioning point on the reference plate is taken as the X-direction coordinate of the point in the two-dimensional coordinate system, and the Y-direction offset of each positioning point on the reference plate minus the Y-direction average offset is taken as the Y-direction coordinate of the point in the two-dimensional coordinate system, to perform linear fitting operation, to obtain the rotation compensation amount. The Y-direction average offset is the sum of the Y-direction offsets of each positioning point on the reference plate divided by the total number of positioning points, that is, as shown in the following formula (5):
[0069]
[0070] wherein, represents the Y-direction average offset.
[0071] Correspondingly, the Y-direction offset of each positioning point on the reference plate minus the Y-direction average offset is taken to obtain the difference therebetween, that is, as shown in the following formula (6):
[0072]
[0073] wherein, dy i represents the difference between the Y-direction offset of the i-th positioning point and the Y-direction average offset, and Dy i represents the Y-direction offset of the i-th positioning point.
[0074] Correspondingly, the points composed of (X i , dy i ) are subjected to linear fitting operation, to obtain a straight line y1 = a1x + b1, wherein the slope a1 of the straight line represents the rotation compensation amount of the image acquisition device.
[0075] After the compensation amount of the image acquisition device is obtained, the optical detection equipment can be compensated according to the compensation amount. Thus, by adding the reference plate on the optical detection equipment, and using the reference plate to obtain the compensation amount of the image acquisition device to compensate before detecting the to-be-detected plate, not only the detection precision of the optical detection equipment can be improved, but also damage to the image acquisition device can be avoided. Moreover, the compensation amount can include expansion and contraction compensation amount and rotation compensation amount, the precision problem caused by the thermal expansion of the CIS sensor in the image acquisition device can be effectively avoided by the expansion and contraction compensation amount, and the precision problem caused by the angle deviation between the image acquisition device and the movement direction of the workbench can be effectively avoided by the rotation compensation amount.
[0076] Further, in some embodiments, as shown in Figure 8 After the compensation amount of the image acquisition device is obtained, the compensation method of the optical detection equipment further includes the following steps:
[0077] Step S31, control the image acquisition device to obtain the second image information of the to-be-detected plate, so as to detect the to-be-detected plate.
[0078] Specifically, after the image acquisition device completes the scanning of the reference plate, as shown in Figure 1 continue to control the workbench 120 to move, so that the workbench 120 drives the upper cover plate 170, the lower cover plate 140 and the to-be-detected plate to translate, so that the to-be-detected plate on the lower cover plate 140 passes above the image acquisition device 130, and control the image acquisition device 130 to obtain the image information of the to-be-detected plate, which is recorded as the second image information.
[0079] Step S32, obtain the actual coordinates of the to-be-detected hole in the second image information.
[0080] Specifically, after the second image information is obtained, the second image information can be analyzed to obtain the actual coordinates of the to-be-detected hole on the to-be-detected plate.
[0081] Step S33, compensate the actual coordinates of the to-be-detected hole according to the compensation amount.
[0082] Specifically, after the actual coordinates of the to-be-detected hole and the compensation amount of the image acquisition device are obtained, each to-be-detected hole is compensated according to the compensation amount. Optionally, when the compensation amount includes expansion and contraction compensation amount and rotation compensation amount, the actual coordinates of the to-be-detected hole can be compensated by the following formula (7):
[0083]
[0084] Wherein, (px, py) represents the actual coordinates of the hole to be detected before compensation, (px1, py1) represents the actual coordinates of the hole to be detected after compensation, a represents the expansion and contraction compensation amount, and a1 represents the rotation compensation amount. Thus, the detection accuracy can be improved from multiple aspects, and the entire compensation process will not damage the image acquisition device.
[0085] In summary, according to the compensation method of the optical detection device, the first image information of the reference plate is acquired by the image acquisition device before the detection of the to-be-detected plate, the actual coordinates of each positioning point on the reference plate and the offset between the actual coordinates and the theoretical coordinates are acquired according to the first image information, and the compensation amount of the image acquisition device is acquired according to the actual coordinates and the offset of each positioning point for detection compensation, so that the detection accuracy of the optical detection device can be improved, and damage to the image acquisition device can be avoided.
[0086] In some embodiments of the present application, a computer readable storage medium having a compensation program of an optical detection device stored thereon is also provided, and the compensation program of the optical detection device is executed by a processor to implement the compensation method of the optical detection device described in the above embodiments.
[0087] According to the computer readable storage medium of the present application, the compensation program of the optical detection device stored thereon is executed by a processor to implement the compensation method of the optical detection device described in the above embodiments, the first image information of the reference plate is acquired by the image acquisition device before the detection of the to-be-detected plate, the actual coordinates of each positioning point on the reference plate and the offset between the actual coordinates and the theoretical coordinates are acquired according to the first image information, and the compensation amount of the image acquisition device is acquired according to the actual coordinates and the offset of each positioning point for detection compensation, so that the detection accuracy of the optical detection device can be improved, and damage to the image acquisition device can be avoided.
[0088] In some embodiments of the present application, an optical detection device is also provided, as shown in the figure, which comprises an image acquisition device 130, a reference plate 150 and a processor (not specifically shown in the figure). Wherein, the reference plate 150 and the to-be-detected plate are located on the same side of the image acquisition device 130 and do not overlap, the reference plate 150 is provided with a plurality of positioning points, and the processor is used to implement the compensation method of the optical detection device described in the above embodiments. Figure 1
[0089] Further, the optical detection device further comprises a lower cover plate for carrying the to-be-detected plate, the reference plate is arranged at the rear end of the lower cover plate, and the image acquisition device is located below the lower cover plate and the reference plate and acquires the image of the reference plate before shooting the to-be-detected plate.
[0090] Optionally, in some embodiments of the present application, the reference plate is provided with a mark surface with a positioning point, and the lower cover plate is provided with a carrying surface for supporting the to-be-detected plate, and the mark surface and the carrying surface are at the same height.
[0091] Optionally, in some embodiments of the present application, the reference plate is embedded in the lower cover plate, or the reference plate is placed on the lower cover plate, or the reference plate is arranged outside the lower cover plate through a connecting piece.
[0092] It should be noted that the related description of the optical detection device can refer to the foregoing description of the compensation method of the optical detection device, and details are not repeated here.
[0093] According to the embodiments of the present application, by adding the reference plate on the optical detection device and acquiring the compensation amount of the image acquisition device by using the reference plate before detecting the to-be-detected plate to perform detection compensation, the detection precision of the optical detection device can be improved, and damage to the image acquisition device can be avoided.
[0094] In the description of the present application, the description of the terms “one embodiment”, “some embodiments”, “example”, “specific example”, or “some examples” means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the description of the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, the skilled in the art can combine and combine the different embodiments or examples described in the present application and the features of the different embodiments or examples without contradiction.
[0095] In addition, the terms “first”, “second” are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with “first”, “second” can explicitly or implicitly include at least one feature. In the description of the present application, the meaning of “multiple” is at least two, for example, two, three, etc., unless otherwise specifically limited.
[0096] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of the invention pertain.
[0097] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0098] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any of the following techniques known in the art, or a combination thereof: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0099] Those skilled in the art of the present technology can understand that all or part of the steps carried out by the above-mentioned embodiment method can be completed by programs instructing related hardware, and the programs can be stored in a computer readable storage medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0100] In addition, each functional unit in each embodiment of the present application can be integrated into one processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
[0101] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above-mentioned embodiments within the scope of the present application.
Claims
1. A compensation method of an optical detection device, characterized by, The optical detection device comprises an image acquisition device and a reference plate, the reference plate and the plate to be detected are located on the same side of the image acquisition device and do not overlap, a plurality of positioning points are arranged on the reference plate, and the method comprises the following steps: Before detecting the plate to be detected, the first image information of the reference plate is acquired by controlling the image acquisition device; The actual coordinates of each positioning point in the plurality of positioning points and the offset between the actual coordinates and the theoretical coordinates are acquired according to the first image information; The compensation amount of the image acquisition device is acquired according to the actual coordinates of each positioning point and the offset. The compensation amount of the image acquisition device according to the actual coordinates of each positioning point and the offset comprises the following steps: The X-direction actual coordinates and the X-direction offset of each positioning point are acquired; The X-direction average offset of the plurality of positioning points is acquired according to the X-direction offset of each positioning point; The X-direction actual coordinates of each positioning point and the difference between the X-direction offset of each positioning point and the X-direction average offset are subjected to linear fitting operation to obtain the expansion and contraction compensation amount.
2. The compensation method of an optical detection apparatus according to claim 1, wherein The compensation amount of the image acquisition device according to the actual coordinates of each positioning point and the offset further comprises the following steps: The X-direction actual coordinates and the Y-direction offset of each positioning point are acquired; The Y-direction average offset of the plurality of positioning points is acquired according to the Y-direction offset of each positioning point; The X-direction actual coordinates of each positioning point and the difference between the Y-direction offset of each positioning point and the Y-direction average offset are subjected to linear fitting operation to obtain the rotation compensation amount.
3. The compensation method of an optical detection apparatus according to claim 2, wherein, The expansion and contraction compensation amount and the rotation compensation amount are both the linear slope obtained after linear fitting operation.
4. The compensation method of an optical detection apparatus according to claim 3, wherein After the compensation amount of the image acquisition device is obtained, the method further comprises the following steps: The second image information of the plate to be detected is acquired by controlling the image acquisition device to detect the plate to be detected; The actual coordinates of the detection hole in the second image information are acquired; The actual coordinates of the detection hole are compensated according to the compensation amount.
5. The compensation method of an optical detection device according to claim 4, characterized in that, The coordinates of the detection hole are compensated in the following manner: wherein (px, py) represents the actual coordinates of the hole to be detected before compensation, (px1, py1) represents the actual coordinates of the hole to be detected after compensation, a represents the expansion / contraction compensation amount, represents the rotation compensation amount.
6. The compensation method of an optical detection device according to any one of claims 1-5, characterized in that, The offset between the actual coordinates and the theoretical coordinates of each positioning point in the plurality of positioning points is acquired according to the first image information, which comprises the following steps: The first theoretical coordinates and the actual coordinates of any two positioning points in the plurality of positioning points are acquired; The rotation offset and the translation offset of the plurality of positioning points are acquired according to the first theoretical coordinates and the actual coordinates of the two positioning points; The second theoretical coordinates of each positioning point in the plurality of positioning points are acquired according to the rotation offset, the translation offset and the first theoretical coordinates of each positioning point in the plurality of positioning points; The offset between the actual coordinates and the theoretical coordinates of each positioning point is acquired according to the second theoretical coordinates and the actual coordinates of each positioning point in the plurality of positioning points.
7. A computer readable storage medium characterized by A compensation program of an optical detection device is stored thereon, and the compensation program of the optical detection device is executed by a processor to implement the compensation method of the optical detection device according to any one of claims 1-6.
8. An optical detection device, characterized in that It comprises the following steps: The image acquisition device, the reference plate and the processor are located on the same side of the image acquisition device and do not overlap, the reference plate is provided with a plurality of positioning points, and the processor is used to realize the compensation method of the optical detection equipment according to any one of claims 1-6.
9. The optical detection device of claim 8, wherein, Further comprising: A lower cover plate for carrying the to-be-detected plate, the reference plate is arranged at the rear end of the lower cover plate, the image acquisition device is located below the lower cover plate and the reference plate, and the image acquisition device acquires the image of the reference plate before shooting the to-be-detected plate.
10. The optical detection device of claim 9, wherein, The reference plate is provided with a mark surface with positioning points, and the lower cover plate has a carrying surface for supporting the to-be-detected plate, and the mark surface and the carrying surface are at the same height.
11. The optical detection device of claim 10, wherein, The reference plate is embedded in the lower cover plate, or the reference plate is placed on the lower cover plate, or the reference plate is arranged outside the lower cover plate through a connecting piece.
Citation Information
Patent Citations
Bar code type levelling staff detection system and detection method
CN110296718A
Linear-scan camera, precision compensation method thereof and storage medium
CN112985265A