A three-dimensional coordinate calibration method for a plate-shaped workpiece
The method uses a camera with fixed focal length to capture multiple images and align axes for consistent imaging, addressing the challenge of precise positioning in machine vision measurement, ensuring reliable high-precision detection.
Patent Information
- Application Number
- CN201911302623.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-17
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2039-12-17
AI Technical Summary
Existing machine vision measurement technology requires a fixed magnification in high-precision detection, requiring a constant working distance between the object to be measured and the camera lens, and lacks economical and reliable three-dimensional coordinate calibration methods.
By moving a camera with a predetermined focal length from different starting positions, multiple images of the plate-shaped workpiece are captured, the reference position is determined according to the image clarity, the Z-axis direction is calibrated, and the X-axis and Y-axis directions are corrected by the deflection angle of the feature, and the calibrated three-dimensional coordinate system is constructed.
The working distance between the camera and the object to be measured is achieved in high-precision machine vision measurement, providing economical and reliable three-dimensional coordinate calibration, reducing the amount of image clarity analysis and speeding up the calibration speed.
Smart Images

Figure CN112985257B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of detection, and particularly to a three-dimensional coordinate calibration method for a plate-shaped workpiece. Background Art
[0002] With the development of electronic product technology, the trend of miniaturization of components is becoming more and more obvious, and the density of products is also increasing continuously. Therefore, in the manufacturing industry of electronic products, surface mount technology (SMT) is used for the manufacturing and assembly of PCBA (Printed Circuit Board Assembly), and automated machine vision measurement technology is used for the vision inspection of PCBA products.
[0003] The inventors found that there are at least the following problems in the prior art: Machine vision measurement technology can achieve high-precision defect detection. High-precision detection requires that the object to be measured has a fixed magnification during imaging. In vision measurement, a fixed-focus lens is usually used to achieve a fixed magnification. At this time, it is required that the object to be measured is accurately positioned with a positioning fixture to ensure that the working distance between the object to be measured and the camera lens is constant. Therefore, how to provide an economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement is a technical problem to be solved urgently. Summary of the Invention
[0004] The purpose of the embodiments of the present invention is to provide a three-dimensional coordinate calibration method for a plate-shaped workpiece, so as to provide an economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement.
[0005] To solve the above technical problems, the embodiments of the present invention provide a three-dimensional coordinate calibration method for a plate-shaped workpiece, including the following steps: moving a camera with a predetermined focal length f in the direction of approaching / leaving the plate-shaped workpiece from different starting positions, and taking multiple images of the plate-shaped workpiece by using the camera during each movement; determining three non-collinear reference positions at the same distance from the plate-shaped workpiece according to the sharpness of the multiple images, taking the plane determined by the three reference positions as a reference plane, and determining the Z-axis calibration direction according to the reference plane; moving the camera in the reference plane to capture a first predetermined feature on the plate-shaped workpiece, analyzing the image of the first predetermined feature, obtaining the deflection angle of the first predetermined feature, and determining the X-axis calibration direction and the Y-axis calibration direction according to the deflection angle; determining the axis directions of the calibration three-dimensional coordinate system where the plate-shaped workpiece is located according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction.
[0006] The embodiments of the present invention relative to the prior art are as follows:
[0007] 1. It takes pictures of the plate-shaped workpiece with a camera having a predetermined focal length to correct the Z-axis direction. Since the clarity of the captured images is different when the distance between the camera and the plate-shaped workpiece is different, in this way, at least three position points that are at the same distance from the plate-shaped workpiece and are not collinear can be determined according to the clarity of the images. And the at least three non-collinear position points can determine a plane parallel to the plate-shaped workpiece, that is, a reference plane parallel to the "XY plane" of the "three-dimensional coordinate system constructed with the plane where the plate-shaped workpiece is located as the XY plane", and then the Z-axis direction perpendicular to the reference plane can be determined;
[0008] 2. It corrects the X-axis and Y-axis directions by using the deflection angle of the first predetermined feature. Since the theoretical design angle of the first predetermined feature on the plate-shaped workpiece has a predetermined angular relationship with the "X-axis and Y-axis" of the "three-dimensional coordinate system constructed with the plane where the plate-shaped workpiece is located as the XY plane", in this way, after obtaining the deflection angle of the first predetermined feature on the plate-shaped workpiece, the torsion angles of the "X-axis and Y-axis" can be determined by referring to the theoretical design angle of the first predetermined feature and the predetermined angular relationship, so as to determine the X-axis and Y-axis directions;
[0009] In this way, in subsequent visual measurements, as long as it is ensured that the fixed-focus lens moves along a plane perpendicular to the Z-axis calibration direction (that is, the XY plane jointly formed by the X-axis calibration direction and the Y-axis calibration direction), it can be ensured that the working distance between the fixed-focus lens and the object to be measured during the movement is constant. The entire calibration process can be achieved only by using a monocular camera with a predetermined focal length, which can provide economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement.
[0010] In addition, the specific operation of taking multiple images of the plate-shaped workpiece with the camera during each movement is as follows: for each movement of a preset distance, an image of the plate-shaped workpiece is taken with the camera. Appropriately adjusting the preset distance with reference to the predetermined focal length f of the camera can appropriately reduce the number of captured images, reduce the computational amount of image clarity analysis, and speed up the calibration speed on the premise of ensuring a certain calibration accuracy.
[0011] In addition, the specific operation of determining three reference positions that are at the same distance from the plate-shaped workpiece and are not collinear according to the clarity of the multiple images specifically includes: obtaining multiple frames captured by the camera during each movement; analyzing the multiple frames captured during each movement and obtaining the frame with the highest clarity among the multiple frames captured during each movement; determining the position where the camera is located when the frame with the highest clarity is captured as the reference position.
[0012] In addition, before moving the camera with a predetermined focal length f from different starting positions in the direction of approaching / away from the plate-shaped workpiece, the following steps are included: fixing the plate-shaped workpiece on a fixed fixture and determining an initial three-dimensional coordinate system according to the fixed fixture; determining three non-collinear starting positions in the initial three-dimensional coordinate system. Among them, in the Z-axis direction of the initial three-dimensional coordinate system, the distance between each starting position and the plate-shaped workpiece is f + △E / f - △E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction. With such a setting, the assembly tolerance of the plate-shaped workpiece is taken into account to ensure that the camera can pass through the optimal imaging position during the movement in the direction of approaching / away from the plate-shaped workpiece, so that clear images at the optimal imaging position can be captured during each movement, facilitating the subsequent determination of the reference position at a distance of f from the plate-shaped workpiece using the clear images.
[0013] In addition, the movement of the camera with a predetermined focal length f from different starting positions in the direction of approaching / away from the plate-shaped workpiece is specifically as follows: starting from the three starting positions respectively, moving the camera with a predetermined focal length f in the Z-axis direction of the initial three-dimensional coordinate system in the direction of approaching / away from the plate-shaped workpiece. Since the Z-axis direction of the initial three-dimensional coordinate system is the direction closest to "perpendicular to" the plate-shaped workpiece, moving the camera along the direction perpendicular or approximately perpendicular to the plate-shaped workpiece can quickly traverse the reference position at a distance of f from the plate-shaped workpiece to obtain clear images and shorten the calibration time.
[0014] In addition, the movement of the camera in the reference plane to capture the first predetermined feature on the plate-shaped workpiece is specifically as follows: taking the direction parallel to the X-axis of the initial three-dimensional coordinate system in the reference plane as the first direction, and taking the direction parallel to the Y-axis of the initial three-dimensional coordinate system in the reference plane as the second direction; moving the camera in the reference plane along the first direction and the second direction respectively and taking images of the plate-shaped workpiece during the movement until the camera captures the first predetermined feature on the plate-shaped workpiece. Moving the camera sequentially along the X-axis direction and Y-axis direction of the initial three-dimensional coordinate system facilitates the gradual scanning of the plate-shaped workpiece by the camera and quickly captures the first predetermined feature.
[0015] In addition, determining the X-axis calibration direction and the Y-axis calibration direction according to the deflection angle specifically includes: obtaining the theoretically designed angle of the first predetermined feature on the plate-shaped workpiece, where the X-axis direction and the Y-axis direction of the three-dimensional coordinate system in which the plate-shaped workpiece is actually located have a predetermined relationship with the theoretically designed angle; obtaining the angular difference between the theoretically designed angle and the deflection angle; and determining the X-axis calibration direction and the Y-axis calibration direction according to the angular difference and the predetermined relationship. Since the theoretically designed angle of the first predetermined feature on the plate-shaped workpiece has a predetermined angular relationship with the "X-axis and Y-axis" of the "three-dimensional coordinate system constructed with the plane where the plate-shaped workpiece is located as the XY plane", in this way, after obtaining the deflection angle of the first predetermined feature on the plate-shaped workpiece, the torsion angles of the "X-axis and Y-axis" can be determined by referring to the theoretically designed angle of the first predetermined feature and the predetermined angular relationship, so as to determine the X-axis and Y-axis directions.
[0016] In addition, after determining the axis directions of the calibration three-dimensional coordinate system in which the plate-shaped workpiece is located according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction, it further includes: determining the origin position of the calibration three-dimensional coordinate system according to the theoretically designed position of the first predetermined feature on the plate-shaped workpiece, the predetermined focal length f, and the position where the camera captures the first predetermined feature. Since the theoretically designed position of the first predetermined feature on the plate-shaped workpiece has a predetermined positional relationship with the origin of the "three-dimensional coordinate system constructed with the plane where the plate-shaped workpiece is located as the XY plane", in this way, according to the theoretically designed position of the first predetermined feature and the predetermined focal length f, the positional relationship between the origin and the "position where the first predetermined feature is captured" can be determined, so as to deduce the position of the origin according to the "position where the first predetermined feature is captured".
[0017] In addition, after determining the origin position of the calibrated three-dimensional coordinate system based on the theoretical design position of the first predetermined feature on the plate-shaped workpiece, the predetermined focal length f, and the position where the camera captures the first predetermined feature, the following steps are further included: calculating the projection position of the second predetermined feature on the reference plane according to the theoretical design position of the second predetermined feature on the plate-shaped workpiece; using the camera to capture an image of the plate-shaped workpiece at the projection position; if the image of the plate-shaped workpiece captured at the projection position includes the second predetermined feature, then taking the calibrated three-dimensional coordinate system as the effective three-dimensional coordinate system of the plate-shaped workpiece. After determining the directions of each axis and the origin position of the calibrated three-dimensional coordinate system, the camera position (i.e., the projection position) where "the second predetermined feature on the plate-shaped workpiece can be captured" is determined according to the theoretical design position of the second predetermined feature on the plate-shaped workpiece, and then the camera is moved to the projection position to capture the plate-shaped workpiece. If the image of the plate-shaped workpiece captured includes the second predetermined feature, it indicates that the calibrated three-dimensional coordinate system obtained by calibration is accurate enough and can be used as the effective three-dimensional coordinate system for subsequent machine vision measurement.
[0018] In addition, after using the camera to capture an image of the plate-shaped workpiece at the projection position, the following steps are further included: if the image of the plate-shaped workpiece captured at the projection position does not include the second predetermined feature, then recalibrating the three-dimensional coordinates of the plate-shaped workpiece. If the image of the plate-shaped workpiece captured does not include the second predetermined feature, it indicates that there is an error in the calibrated three-dimensional coordinate system obtained by calibration. In this case, the previous steps are repeated to obtain an effective three-dimensional coordinate system. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] One or more embodiments are exemplarily illustrated by the pictures in the corresponding drawings. These exemplary illustrations do not limit the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the drawings in the figures do not constitute a proportional limitation.
[0020] Figure 1 is a flowchart of a method for calibrating the three-dimensional coordinates of a plate-shaped workpiece according to the first embodiment of the present invention;
[0021] Figure 2 is a schematic diagram of a method for calibrating the three-dimensional coordinates of a plate-shaped workpiece according to the first embodiment of the present invention;
[0022] Figure 3 is a flowchart of a method for calibrating the three-dimensional coordinates of a plate-shaped workpiece according to the second embodiment of the present invention;
[0023] Figure 4 is a front view of a fixing structure after fixing a plate-shaped workpiece according to the second embodiment of the present invention;
[0024] Figure 5 It is a top view of the fixing structure after fixing the plate-shaped workpiece according to the second embodiment of the present invention;
[0025] Figure 6 It is a schematic diagram of the three-dimensional coordinate calibration method of the plate-shaped workpiece provided according to the second embodiment of the present invention;
[0026] Figure 7 It is a flowchart of the three-dimensional coordinate calibration method of the plate-shaped workpiece provided according to the third embodiment of the present invention;
[0027] Figure 8 It is a flowchart of the three-dimensional coordinate calibration method of the plate-shaped workpiece provided according to the fourth embodiment of the present invention;
[0028] Figure 9 It is a flowchart of the three-dimensional coordinate calibration method of the plate-shaped workpiece provided according to the fifth embodiment of the present invention. Specific Embodiments
[0029] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the following will elaborate on each embodiment of the present invention with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that in each embodiment of the present invention, many technical details are proposed for the better understanding of the readers. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can still be implemented. The division of the following embodiments is for convenience of description and should not constitute any limitation to the specific implementation manners of the present invention. The various embodiments can be combined and cross-referenced with each other on the premise of no contradiction.
[0030] The first embodiment of the present invention relates to a three-dimensional coordinate calibration method for a plate-shaped workpiece, which can be applied to the three-dimensional coordinate calibration of plate-shaped workpieces such as PCBA. The core of the first embodiment of the present invention is as follows: move a camera with a predetermined focal length f from different starting positions along the direction of approaching / leaving the plate-shaped workpiece, and capture multiple images of the plate-shaped workpiece during each movement; determine three non-collinear reference positions at the same distance from the plate-shaped workpiece based on the sharpness of the multiple images, determine the plane determined by the three reference positions as the reference plane, and determine the Z-axis calibration direction according to the reference plane; move the camera within the reference plane to capture the first predetermined feature on the plate-shaped workpiece, analyze the image of the first predetermined feature, obtain the deflection angle of the first predetermined feature, and determine the X-axis calibration direction and the Y-axis calibration direction according to the deflection angle; determine the axis directions of the calibration three-dimensional coordinate system where the plate-shaped workpiece is located according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction.
[0031] In the first embodiment of the present invention, a plate-shaped workpiece is photographed by a camera with a predetermined focal length to correct the Z-axis direction, and the X-axis and Y-axis directions are corrected by using the deflection angle of the first predetermined feature.
[0032] 1. Since the clarity of the captured images is different when the distance between the camera and the plate-shaped workpiece is different, thus, at least three position points that are at the same distance from the plate-shaped workpiece and are not collinear can be determined according to the clarity of the images. And the at least three non-collinear position points can determine a plane parallel to the plate-shaped workpiece, that is, a reference plane parallel to the "XY plane" of the three-dimensional coordinate system constructed with the plane where the plate-shaped workpiece is located as the XY plane, and further determine the Z-axis direction perpendicular to the reference plane.
[0033] 2. Since the theoretical design angle of the first predetermined feature on the plate-shaped workpiece has a predetermined angular relationship with the "X-axis and Y-axis" of the three-dimensional coordinate system constructed with the plane where the plate-shaped workpiece is located as the XY plane, thus, after obtaining the deflection angle of the first predetermined feature on the plate-shaped workpiece, the torsion angles of the "X-axis and Y-axis" can be determined by referring to the theoretical design angle of the first predetermined feature and the predetermined angular relationship, thereby determining the X-axis and Y-axis directions.
[0034] In this way, in subsequent visual measurements, as long as it is ensured that the fixed-focus lens moves along a plane perpendicular to the Z-axis calibration direction (that is, the XY plane composed of the X-axis calibration direction and the Y-axis calibration direction), it can be guaranteed that the working distance between the fixed-focus lens and the object to be measured during the movement is constant. The entire calibration process can be achieved only by using a monocular camera with a predetermined focal length, and it can provide economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement.
[0035] The implementation details of the three-dimensional coordinate calibration method for the plate-shaped workpiece in this embodiment will be specifically described below. Since this method is applicable to plate-shaped workpieces such as PCBA, therefore, in this embodiment, the PCBA assembled into the chassis is taken as an example to illustrate the three-dimensional coordinate calibration method for the PCBA assembled into the chassis. It should be noted that the following content is only the implementation details provided for convenient understanding and is not necessary for implementing this solution. Refer to Figure 1 , the three-dimensional coordinate calibration method for the plate-shaped workpiece provided by the first embodiment of the present invention includes the following steps.
[0036] S101. Move the camera with a predetermined focal length f from different starting positions in the direction of approaching / leaving the plate-shaped workpiece, and take multiple images of the plate-shaped workpiece by using the camera during each movement.
[0037] Specifically, please refer to Figure 2, in step S101, three starting positions A, B, and C that are far from the PCBA2 and non-collinear can be pre-selected. The camera 4 is moved along the direction close to the PCBA2 ([ Figure 2 the direction of the arrow shown) respectively starting from the three starting positions A, B, and C. During the process of moving the camera 4 from the starting position A towards the PCBA, from the starting position B towards the PCBA2, and from the starting position C towards the PCBA2, multiple images of the plate-shaped workpiece are respectively taken by the camera.
[0038] It should be noted that in this embodiment, taking multiple images of the plate-shaped workpiece by the camera can be "continuously taking images during the movement" or "taking an image of the plate-shaped workpiece every time a preset distance is moved". It can be understood that in the scheme of "taking an image of the plate-shaped workpiece every time a preset distance is moved", the preset distance can be appropriately adjusted with reference to the predetermined focal length f of the camera, so as to appropriately reduce the number of taken images, reduce the calculation amount of image clarity analysis, and speed up the calibration speed on the premise of ensuring a certain calibration accuracy.
[0039] In addition, it can be understood that the process of moving the camera 4 is not limited to moving along the direction close to the PCBA2 from the starting point. Three starting positions A, B, and C that are close to the PCBA2 and non-collinear can also be pre-selected, and then the camera 4 is moved along the direction away from the PCBA2 ([ Figure 2 the opposite direction of the arrow shown) respectively starting from the three starting positions A, B, and C.
[0040] S102. Determine three reference positions that are non-collinear and at the same distance from the plate-shaped workpiece based on the clarity of the multiple images, take the plane determined by the three reference positions as the reference plane, and determine the Z-axis calibration direction according to the reference plane.
[0041] Since the clarity of the images taken by the camera 4 is different when the distance from the PCBA2 is different, in this way, during each movement process close to the PCBA2, the position where the camera 4 takes the clearest image must be the position at a distance of f from the PCBA2. Therefore, in step S102, multiple frames taken by the camera 4 during each movement process can be obtained first; then, analyze the multiple frames taken during each movement process, and obtain the frame with the highest clarity among the multiple frames taken during each movement process; determine the positions A', B', and C' of the camera 4 when the frame with the highest clarity is taken as the reference positions. Then, the plane determined by the three reference positions A', B', and C' can be taken as the reference plane 100, and the direction perpendicular to the reference plane 100 can be determined as the Z-axis calibration direction ([ Figure 2 shown by the dotted line).
[0042] S103. Move the camera within the reference plane to capture the first predetermined feature on the plate-shaped workpiece, analyze the image of the first predetermined feature, obtain the deflection angle of the first predetermined feature, and determine the X-axis calibration direction and the Y-axis calibration direction according to the deflection angle.
[0043] Specifically, the camera 4 can be reciprocally moved along the roughly determined XY plane within the reference plane 100, so that the viewing angle of the camera 4 sweeps across each area of the PCBA 2, and multiple images of the PCBA 2 are taken during the movement of the camera 4. When the image of the first predetermined feature 201 on the PCBA 2 is captured, the image of the first predetermined feature 201 is analyzed to obtain the deflection angle of the first predetermined feature 201. Since the theoretical design angle of the first predetermined feature 201 on the PCBA 2 has a predetermined included angle relationship with the "X-axis and Y-axis" of the "three-dimensional coordinate system constructed with the plane where the PCBA is located as the XY plane", in this way, after obtaining the deflection angle of the first predetermined feature 201 on the PCBA 2, the torsion angles of the "X-axis and Y-axis" can be determined by referring to the theoretical design angle of the first predetermined feature 201 and the predetermined included angle relationship, thereby determining the X-axis and Y-axis directions.
[0044] For example, when the first predetermined feature 201 is a rectangle and its theoretical design angle is "the long side of the rectangle is parallel to the X-axis (i.e., perpendicular to the Y-axis)",
[0045] a. If it is detected that the deflection angle of the long side of the first predetermined feature 201 in the roughly determined XY plane is 0 degrees, since "the long side of the rectangle is parallel to the X-axis (i.e., perpendicular to the Y-axis)", it means that the X-axis direction in the current roughly determined XY plane is parallel to the X-axis calibration direction. Then, it can be determined that the X-axis calibration direction is parallel to the X-axis direction in the current roughly determined XY plane, and the Y-axis calibration direction is perpendicular to the X-axis direction in the current roughly determined XY plane.
[0046] b. If it is detected that the long side of the first predetermined feature 201 in the roughly determined XY plane is deflected by 5 degrees in the clockwise direction, since "the long side of the rectangle is parallel to the X-axis (i.e., perpendicular to the Y-axis)", it means that the X-axis direction in the current roughly determined XY plane is deflected by 5 degrees in the counterclockwise direction compared to the X-axis calibration direction. Thus, it can be determined that the X-axis calibration direction is the direction of the X-axis in the current roughly determined XY plane deflected by 5 degrees in the clockwise direction, and the Y-axis calibration direction is the direction of the X-axis in the current roughly determined XY plane deflected by 95 degrees in the clockwise direction.
[0047] S104. Determine the axis directions of the calibration three-dimensional coordinate system where the plate-shaped workpiece is located according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction.
[0048] Specifically, after obtaining the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction, it is possible to know the deflection angle of the PCBA in the current fixed position with respect to the "three-dimensional coordinate system established with the plane where PCBA2 is located as the XY plane" compared to the "crudely determined three-dimensional coordinate system established with the crudely determined XY plane", so as to calibrate the directions of each axis of the three-dimensional coordinates of the PCBA. When using machine vision measurement subsequently, the camera lens can be moved with reference to the XY plane of the calibrated three-dimensional coordinate system to ensure that the working distance between the PCBA to be measured and the camera lens is constant.
[0049] The second embodiment of the present invention provides a three-dimensional coordinate calibration method for a plate-shaped workpiece, which is generally the same as the three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the first embodiment. The difference is that the three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the second embodiment of the present invention additionally includes the preparation steps of fixing the plate-shaped workpiece and selecting the starting position. Specifically, referring to Figure 3 , the three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the second embodiment of the present invention includes the steps:
[0050] S201. Fix the plate-shaped workpiece on a fixed fixture and determine the initial three-dimensional coordinate system according to the fixed fixture;
[0051] S202. Determine three non-collinear starting positions in the initial three-dimensional coordinate system. Among them, in the Z-axis direction of the initial three-dimensional coordinate system, the distance between each starting position and the plate-shaped workpiece is f + △E / f - △E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
[0052] S203. Move the camera with a predetermined focal length f in the direction of approaching / leaving the plate-shaped workpiece from different starting positions, and capture multiple images of the plate-shaped workpiece during each movement;
[0053] S204. Determine three non-collinear reference positions at the same distance from the plate-shaped workpiece according to the sharpness of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine the Z-axis calibration direction according to the reference plane;
[0054] S205. Move the camera within the reference plane to capture the first predetermined feature on the plate-shaped workpiece, analyze the image of the first predetermined feature to obtain the deflection angle of the first predetermined feature, and determine the X-axis calibration direction and the Y-axis calibration direction according to the deflection angle;
[0055] S206. Determine the axis directions of the calibrated three-dimensional coordinate system where the plate-shaped workpiece is located according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction.
[0056] Regarding step S201, refer to Figure 4 and Figure 5 . Specifically, first fix the chassis 1 equipped with the PCBA2 on the fixing fixture 3. Since the PCBA2 to be calibrated is assembled inside the chassis 1, the PCBA2 is indirectly fixed on the fixing fixture 3, as shown in Figure 4 and Figure 5 .
[0057] Under ideal conditions, a well-designed and manufactured fixing fixture 3 can accurately hold the PCBA2 in the XY plane perpendicular to the drawing plane shown in Figure 4 (also perpendicular to the drawing plane shown in Figure 5 ). However, in actual situations, when the PCBA2 is assembled into the chassis 1 and other tests are completed, when performing visual inspection, the PCBA2 cannot be disassembled for inspection. At this time, precise positioning of the chassis 1 is required. However, when the chassis 1 is large in size and heavy in weight, the implementation method of positioning the chassis 1 itself will be more difficult and the implementation cost will be higher. In addition, when the PCBA2 is assembled into the chassis 1, the existence of assembly tolerances inside the chassis 1 results in that even if the chassis 1 can be accurately positioned, precise positioning of the PCBA2 still cannot be achieved. Therefore, a method is needed to achieve precise positioning of the PCBA2 inside the chassis 1 alone. After fixing the PCBA2 on the fixing fixture 3, determine the initial three-dimensional coordinate system XYZ according to the fixing fixture 3, as shown in Figure 6 . The so-called "initial three-dimensional coordinate system" refers to the ideal three-dimensional coordinate system determined with the plane where the PCBA2 is located as the XY plane under the ideal condition where there is no assembly tolerance between the PCBA2 and the chassis 1. However, in fact, for the three-dimensional coordinate system determined with the plane where the assembled PCBA2 is located, the directions of its X-axis, Y-axis, and Z-axis are all affected by the assembly tolerance between the PCBA2 and the chassis 1, and there are differences from the X-axis, Y-axis, and Z-axis directions of the aforementioned initial three-dimensional coordinate system (i.e., the ideal three-dimensional coordinate system).
[0058] Regarding step S202, determine three non-collinear starting positions A, B, and C in the initial three-dimensional coordinate system, as shown in Figure 6 . In this embodiment, in the Z-axis direction of the initial three-dimensional coordinate system, the distance between each starting position and the plate-shaped workpiece is f + △E / f - △E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction. With such a setting, the assembly tolerance △E of the plate-shaped workpiece is taken into account,
[0059] a. If the position with a distance of f + △E from the plate-shaped workpiece is taken as the starting point of the movement, then the position with a distance of f - △E from the plate-shaped workpiece in the moving direction can be taken as the end point of the movement;
[0060] b. If the position with a distance of f - △E from the plate-shaped workpiece is taken as the starting point of the movement, then the position with a distance of f + △E from the plate-shaped workpiece in the moving direction can be taken as the end point of the movement.
[0061] Ensure that the camera can pass through the optimal imaging position during the movement in the direction of approaching / leaving the plate-shaped workpiece, so that clear images at the optimal imaging position can be captured during each movement, facilitating the subsequent determination of the reference position with a distance of f from the plate-shaped workpiece using the clear images.
[0062] It should be added that, as Figure 4 , Figure 5 shown, a robotic arm 5 is also provided on one side of the fixed fixture 3. A camera 4 is fixed at the end of the robotic arm 5. The camera 4 is a monocular camera with a predetermined focal length f. Driven by the robotic arm 5, the camera 4 can freely move in the X-axis direction, Y-axis direction, and Z-axis direction of the initial three-dimensional coordinate system.
[0063] Regarding step S203, specifically, the camera with a predetermined focal length f is moved in the direction of approaching / leaving the plate-shaped workpiece along the Z-axis direction of the initial three-dimensional coordinate system, taking the three starting positions A, B, and C as the starting points respectively.
[0064] Regarding step 204, since the clarity of the images captured by the camera 4 is different when the distance from the PCBA 2 is different, in this way, during each movement closer to the PCBA 2, the position where the camera 4 captures the clearest image must be the position with a distance of f from the PCBA 2. Therefore, in step S102, multiple frames captured by the camera 4 during each movement can be obtained first; then, analyze the multiple frames captured during each movement and obtain the frame with the highest clarity among the multiple frames captured during each movement; determine the positions A', B', and C' where the camera 4 is located when the frame with the highest clarity is captured, as the reference positions. Then, the plane determined by the three reference positions A', B', and C' can be taken as the reference plane 100, and the direction perpendicular to the reference plane 100 can be determined as the Z-axis calibration direction ( Figure 6 indicated by the dotted line).
[0065] Steps S204 to S206 are substantially the same as steps S102 to S104 of the first embodiment, and will not be elaborated here.
[0066] The three-dimensional coordinate calibration method for the plate-shaped workpiece provided by the second embodiment of the present invention can obtain the deflection angle of the PCBA in the current fixed position, where the three-dimensional coordinate system established with the plane where PCBA2 is located as the XY plane is compared with the roughly determined three-dimensional coordinate system established with the roughly determined XY plane, after obtaining the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction, so as to achieve three-dimensional coordinate calibration of the PCBA.
[0067] The third embodiment of the present invention provides a three-dimensional coordinate calibration method for a plate-shaped workpiece, which is generally the same as the three-dimensional coordinate calibration method for the plate-shaped workpiece provided by the second embodiment. The difference is that the three-dimensional coordinate calibration method for the plate-shaped workpiece provided by the third embodiment of the present invention further specifically refines step S205 of the second embodiment. Specifically, see Figure 7 The three-dimensional coordinate calibration method for the plate-shaped workpiece provided by the third embodiment of the present invention includes the steps:
[0068] S301. Fix the plate-shaped workpiece on a fixed fixture and determine the initial three-dimensional coordinate system according to the fixed fixture;
[0069] S302. Determine three non-collinear starting positions in the initial three-dimensional coordinate system. Among them, in the Z-axis direction of the initial three-dimensional coordinate system, the distance between each starting position and the plate-shaped workpiece is f + △E / f - △E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
[0070] S303. Move the camera with a predetermined focal length f from different starting positions in the direction of approaching / leaving the plate-shaped workpiece, and take multiple images of the plate-shaped workpiece with the camera during each movement;
[0071] S304. Determine three non-collinear reference positions at the same distance from the plate-shaped workpiece according to the sharpness of the multiple images, take the plane determined by the three reference positions as the reference plane, and determine the Z-axis calibration direction according to the reference plane;
[0072] S305. Take the direction parallel to the X-axis of the initial three-dimensional coordinate system in the reference plane as the first direction, and take the direction parallel to the Y-axis of the initial three-dimensional coordinate system in the reference plane as the second direction; move the camera along the first direction and the second direction respectively in the reference plane and take images of the plate-shaped workpiece during the movement until the camera captures the first predetermined feature on the plate-shaped workpiece;
[0073] S306. Obtain the theoretically designed angle of the first predetermined feature on the plate-shaped workpiece, where the X-axis direction and Y-axis direction of the three-dimensional coordinate system in which the plate-shaped workpiece actually lies have a predetermined relationship with the theoretically designed angle; obtain the angular difference between the theoretically designed angle and the deflection angle; determine the X-axis calibration direction and Y-axis calibration direction according to the angular difference and the predetermined relationship;
[0074] S307. Determine the axis directions of the calibrated three-dimensional coordinate system in which the plate-shaped workpiece lies according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction.
[0075] Steps S301 to S304 are substantially the same as steps S201 to S204 of the second embodiment, and step S307 is substantially the same as step S206 of the second embodiment, which will not be elaborated here.
[0076] The three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the third embodiment of the present invention moves the camera sequentially along the X-axis direction and Y-axis direction of the initial three-dimensional coordinate system. On the basis of the advantages of the second embodiment, it also has the advantages of facilitating the camera to gradually scan the plate-shaped workpiece and quickly capturing the first predetermined feature.
[0077] The fourth embodiment of the present invention provides a three-dimensional coordinate calibration method for a plate-shaped workpiece, which is substantially the same as the three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the third embodiment. The difference is that the three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the fourth embodiment of the present invention additionally determines the origin position of the calibrated three-dimensional coordinate system. Specifically, see Figure 8 , the three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the fourth embodiment of the present invention includes steps.
[0078] S401. Fix the plate-shaped workpiece on a fixed fixture and determine the initial three-dimensional coordinate system according to the fixed fixture;
[0079] S402. Determine three non-collinear starting positions in the initial three-dimensional coordinate system. Among them, in the Z-axis direction of the initial three-dimensional coordinate system, the distance between each starting position and the plate-shaped workpiece is f + △E / f - △E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
[0080] S403. Move the camera with a predetermined focal length f from different starting positions along the direction of approaching / leaving the plate-shaped workpiece, and take multiple images of the plate-shaped workpiece by using the camera during each movement;
[0081] S404. Determine three non - collinear reference positions at the same distance from the plate - shaped workpiece based on the sharpness of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine the Z - axis calibration direction according to the reference plane;
[0082] S405. Use the direction parallel to the X - axis of the initial three - dimensional coordinate system within the reference plane as the first direction, and use the direction parallel to the Y - axis of the initial three - dimensional coordinate system within the reference plane as the second direction; Move the camera along the first direction and the second direction respectively within the reference plane and take images of the plate - shaped workpiece during the movement until the camera captures the first predetermined feature on the plate - shaped workpiece;
[0083] S406. Obtain the theoretical design angle of the first predetermined feature on the plate - shaped workpiece, where there is a predetermined relationship between the X - axis direction and the Y - axis direction of the actual three - dimensional coordinate system in which the plate - shaped workpiece is located and the theoretical design angle; Obtain the angular difference between the theoretical design angle and the deflection angle; Determine the X - axis calibration direction and the Y - axis calibration direction according to the angular difference and the predetermined relationship;
[0084] S407. Determine the axis directions of the calibrated three - dimensional coordinate system in which the plate - shaped workpiece is located according to the X - axis calibration direction, the Y - axis calibration direction, and the Z - axis calibration direction;
[0085] S408. Determine the origin position of the calibrated three - dimensional coordinate system according to the theoretical design position of the first predetermined feature on the plate - shaped workpiece, the predetermined focal length f, and the position where the camera captures the first predetermined feature.
[0086] Steps S401 - S407 are substantially the same as steps S301 - S307 of the third embodiment and will not be elaborated here.
[0087] Regarding step S408, since the theoretical design position of the first predetermined feature on the plate - shaped workpiece has a predetermined positional relationship with the origin of the three - dimensional coordinate system constructed with the plane where the plate - shaped workpiece is located as the XY plane, in this way, according to the theoretical design position of the first predetermined feature and the predetermined focal length f, the positional relationship between the origin and the position where the first predetermined feature is captured can be determined, and thus the position of the origin can be deduced based on the position where the first predetermined feature is captured.
[0088] The three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the fourth embodiment of the present invention determines the origin position of the calibration three-dimensional coordinate system according to the theoretical design position of the first predetermined feature on the plate-shaped workpiece, the predetermined focal length f, and the position where the camera captures the first predetermined feature. On the basis of the advantages of the third embodiment, it can also additionally determine the origin position of the calibration three-dimensional coordinate system.
[0089] The fifth embodiment of the present invention provides a three-dimensional coordinate calibration method for a plate-shaped workpiece, which is substantially the same as the three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the fourth embodiment. The difference is that the three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the fifth embodiment of the present invention additionally provides a verification means for the calibration three-dimensional coordinate system. Specifically, see Figure 9 , the three-dimensional coordinate calibration method for a plate-shaped workpiece provided by the fifth embodiment of the present invention includes steps.
[0090] S501. Fix the plate-shaped workpiece on a fixed fixture and determine the initial three-dimensional coordinate system according to the fixed fixture;
[0091] S502. Determine three non-collinear starting positions in the initial three-dimensional coordinate system. Among them, in the Z-axis direction of the initial three-dimensional coordinate system, the distance between each starting position and the plate-shaped workpiece is f + △E / f - △E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
[0092] S503. Move the camera with a predetermined focal length f in the direction of approaching / leaving the plate-shaped workpiece from different starting positions, and capture multiple images of the plate-shaped workpiece during each movement.
[0093] S504. Determine three non-collinear reference positions at the same distance from the plate-shaped workpiece according to the sharpness of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine the Z-axis calibration direction according to the reference plane.
[0094] S505. Take the direction parallel to the X-axis of the initial three-dimensional coordinate system in the reference plane as the first direction, and take the direction parallel to the Y-axis of the initial three-dimensional coordinate system in the reference plane as the second direction; move the camera along the first direction and the second direction respectively in the reference plane and capture images of the plate-shaped workpiece during the movement until the camera captures the first predetermined feature on the plate-shaped workpiece.
[0095] S506. Obtain the theoretically designed angle of the first predetermined feature on the plate-shaped workpiece, where the X-axis direction and Y-axis direction of the three-dimensional coordinate system in which the plate-shaped workpiece actually lies have a predetermined relationship with the theoretically designed angle; obtain the angular difference between the theoretically designed angle and the deflection angle; determine the X-axis calibration direction and Y-axis calibration direction according to the angular difference and the predetermined relationship.
[0096] S507. Determine the axis directions of the calibrated three-dimensional coordinate system in which the plate-shaped workpiece lies according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction.
[0097] S508. Determine the origin position of the calibrated three-dimensional coordinate system according to the theoretically designed position of the first predetermined feature on the plate-shaped workpiece, the predetermined focal length f, and the position where the camera captures the first predetermined feature.
[0098] S509. According to the theoretically designed position of the second predetermined feature on the plate-shaped workpiece, calculate the projected position of the second predetermined feature on the reference plane, and use the camera to capture an image of the plate-shaped workpiece at the projected position;
[0099] If the image of the plate-shaped workpiece captured at the projected position includes the second predetermined feature, then use the calibrated three-dimensional coordinate system as the effective three-dimensional coordinate system of the plate-shaped workpiece;
[0100] If the image of the plate-shaped workpiece captured at the projected position does not include the second predetermined feature, then recalibrate the three-dimensional coordinates of the plate-shaped workpiece.
[0101] Steps S501 to S508 are substantially the same as steps S501 to S508 in the fourth embodiment, and will not be elaborated here.
[0102] Specifically, regarding step S509, after determining the axis directions and origin position of the calibrated three-dimensional coordinate system, the camera position (i.e., the projected position) where "the second predetermined feature on the plate-shaped workpiece can be captured" is determined according to the theoretically designed position of the second predetermined feature on the plate-shaped workpiece, and then the camera is moved to the projected position to capture the plate-shaped workpiece. If the image of the plate-shaped workpiece captured includes the second predetermined feature, it means that the calibrated three-dimensional coordinate system obtained by calibration is accurate enough and can be used as the effective three-dimensional coordinate system for subsequent machine vision measurement; if the image of the plate-shaped workpiece captured does not include the second predetermined feature, it means that there is an error in the calibrated three-dimensional coordinate system obtained by calibration. In this case, the above-mentioned steps S501 to S508 can be re-performed to obtain an effective three-dimensional coordinate system.
[0103] The three-dimensional coordinate calibration method for plate-shaped workpieces provided by the fifth embodiment of the present invention, on the basis of the advantages of the fourth embodiment, can additionally verify the accuracy of the calibrated three-dimensional coordinate system. If it is inaccurate, it will be recalibrated, improving the reliability of the three-dimensional coordinate calibration of plate-shaped workpieces.
[0104] Those of ordinary skill in the art can understand that the above embodiments are specific examples for implementing the present invention. The step divisions of the above various methods are only for clear description. When implemented, they can be combined into one step or some steps can be split into multiple steps. In actual applications, various changes can be made in form and details without departing from the spirit and scope of the present invention, as long as the same logical relationship is included, and they are all within the protection scope of this patent.
Claims
1. A three-dimensional coordinate calibration method for a plate-shaped workpiece, characterized in that Including: Moving a camera with a predetermined focal length f from different starting positions in a direction close to / away from the plate-shaped workpiece, and taking multiple images of the plate-shaped workpiece with the camera during each movement; Determining three non-collinear reference positions at the same distance from the plate-shaped workpiece based on the sharpness of the multiple images, taking the plane determined by the three reference positions as the reference plane, and determining the Z-axis calibration direction according to the reference plane; Moving the camera within the reference plane to capture a first predetermined feature on the plate-shaped workpiece, analyzing the image of the first predetermined feature to obtain the deflection angle of the first predetermined feature, and determining the X-axis calibration direction and the Y-axis calibration direction according to the deflection angle, wherein the X-axis calibration direction and the Y-axis calibration direction are determined by the angular difference between the theoretical design angle of the plate-shaped workpiece and the deflection angle; Determining the axis directions of the calibration three-dimensional coordinate system in which the plate-shaped workpiece is located according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction.
2. The three-dimensional coordinate calibration method for the plate-shaped workpiece according to claim 1, characterized in that The step of taking multiple images of the plate-shaped workpiece with the camera during each movement specifically is: Taking an image of the plate-shaped workpiece with the camera every time it moves a preset distance.
3. The three-dimensional coordinate calibration method for the plate-shaped workpiece according to claim 1, characterized in that, The step of determining three non-collinear reference positions at the same distance from the plate-shaped workpiece based on the sharpness of the multiple images specifically includes: Obtaining multiple frames captured by the camera during each movement; Analyzing the multiple frames captured during each movement to obtain the frame with the highest sharpness among the multiple frames captured during each movement; Determining the position of the camera when the frame with the highest sharpness is captured as the reference position.
4. The three-dimensional coordinate calibration method for the plate-shaped workpiece according to claim 3, characterized in that, Before moving the camera with a predetermined focal length f from different starting positions in a direction close to / away from the plate-shaped workpiece, it includes: Fixing the plate-shaped workpiece on a fixed fixture and determining an initial three-dimensional coordinate system according to the fixed fixture; Determining three non-collinear starting positions in the initial three-dimensional coordinate system, wherein in the Z-axis direction of the initial three-dimensional coordinate system, the distance between each starting position and the plate-shaped workpiece is f + △E / f - △E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction.
5. The three-dimensional coordinate calibration method for the plate-shaped workpiece according to claim 4, characterized in that, The step of moving the camera with a predetermined focal length f from different starting positions in a direction close to / away from the plate-shaped workpiece specifically is: Moving the camera with a predetermined focal length f from the three starting positions respectively in the Z-axis direction of the initial three-dimensional coordinate system in a direction close to / away from the plate-shaped workpiece.
6. The three-dimensional coordinate calibration method for the plate-shaped workpiece according to claim 4, characterized in that The step of moving the camera within the reference plane to capture a first predetermined feature on the plate-shaped workpiece specifically is: Taking the direction within the reference plane and parallel to the X-axis of the initial three-dimensional coordinate system as the first direction, and taking the direction within the reference plane and parallel to the Y-axis of the initial three-dimensional coordinate system as the second direction; Moving the camera within the reference plane respectively along the first direction and the second direction and taking images of the plate-shaped workpiece during the movement until the camera captures the first predetermined feature on the plate-shaped workpiece.
7. The three-dimensional coordinate calibration method for the plate-shaped workpiece according to claim 4, characterized in that Determining the X-axis calibration direction and the Y-axis calibration direction according to the deflection angle specifically includes: Obtaining the theoretically designed angle of the first predetermined feature on the plate-shaped workpiece, wherein the X-axis direction and the Y-axis direction of the three-dimensional coordinate system in which the plate-shaped workpiece actually locates have a predetermined relationship with the theoretically designed angle; Obtaining the angular difference between the theoretically designed angle and the deflection angle; Determining the X-axis calibration direction and the Y-axis calibration direction according to the angular difference and the predetermined relationship.
8. The three-dimensional coordinate calibration method for the plate-shaped workpiece according to claim 7, characterized in that, After determining the axis directions of the calibration three-dimensional coordinate system of the plate-shaped workpiece according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction, it further includes: Determining the origin position of the calibration three-dimensional coordinate system according to the theoretically designed position of the first predetermined feature on the plate-shaped workpiece, the predetermined focal length f, and the position where the camera captures the first predetermined feature.
9. The three-dimensional coordinate calibration method for the plate-shaped workpiece according to claim 8, characterized in that After determining the origin position of the calibration three-dimensional coordinate system according to the theoretically designed position of the first predetermined feature on the plate-shaped workpiece, the predetermined focal length f, and the position where the camera captures the first predetermined feature, it further includes: Calculating the projected position of the second predetermined feature on the reference plane according to the theoretically designed position of the second predetermined feature on the plate-shaped workpiece; Using the camera to capture an image of the plate-shaped workpiece at the projected position; If the image of the plate-shaped workpiece captured at the projected position includes the second predetermined feature, then taking the calibration three-dimensional coordinate system as the effective three-dimensional coordinate system of the plate-shaped workpiece.
10. The three-dimensional coordinate calibration method for the plate-shaped workpiece according to claim 9, wherein After using the camera to capture an image of the plate-shaped workpiece at the projected position, it further includes: If the image of the plate-shaped workpiece captured at the projected position does not include the second predetermined feature, then recalibrating the three-dimensional coordinates of the plate-shaped workpiece.
Citation Information
Patent Citations
Robot and robot system
US20180243911A1