WO2021120911A1 - Three-dimensional coordinate calibration method for plate-like workpiece - Google Patents

Three-dimensional coordinate calibration method for plate-like workpiece Download PDF

Info

Publication number
WO2021120911A1
WO2021120911A1 PCT/CN2020/126585 CN2020126585W WO2021120911A1 WO 2021120911 A1 WO2021120911 A1 WO 2021120911A1 CN 2020126585 W CN2020126585 W CN 2020126585W WO 2021120911 A1 WO2021120911 A1 WO 2021120911A1
Authority
WO
WIPO (PCT)
Prior art keywords
plate
shaped workpiece
dimensional coordinate
camera
axis
Prior art date
Application number
PCT/CN2020/126585
Other languages
French (fr)
Chinese (zh)
Inventor
李海秋
周善荣
袁春林
黄睿
贺建兰
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2021120911A1 publication Critical patent/WO2021120911A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/002Measuring arrangements characterised by the use of optical techniques for measuring two or more coordinates
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques

Definitions

  • the embodiments of the present application relate to the field of detection technology, and in particular to a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece.
  • SMT surface mount technology
  • PCBA Printed Circuit Board Assembly
  • the embodiment of the present application provides a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece, which includes the following steps: moving a camera with a predetermined focal length f from different starting positions and in a direction closer to/away from the plate-shaped workpiece.
  • the camera is used to take multiple images of the plate-shaped workpiece; according to the definition of the multiple images, three non-collinear reference positions that are the same distance from the plate-shaped workpiece are determined, and the three reference positions are determined
  • the plane is used as a reference plane, and the Z-axis calibration direction is determined according to the reference plane; the camera is moved in the reference plane to grab the first predetermined feature on the plate-shaped workpiece, and the first predetermined feature is analyzed.
  • Image acquiring 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; according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration
  • the direction determines the coordinate axis direction of the calibration three-dimensional coordinate system where the plate-shaped workpiece is located.
  • Fig. 1 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a first embodiment of the present application
  • FIG. 2 is a schematic diagram of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to the first embodiment of the present application
  • FIG. 3 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a second embodiment of the present application
  • FIG. 4 is a front view of the fixing structure after fixing the plate-shaped workpiece according to the second embodiment of the present application;
  • FIG. 5 is a top view of the fixing structure after fixing the plate-shaped workpiece according to the second embodiment of the present application.
  • Fig. 6 is a schematic diagram of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a second embodiment of the present application
  • Fig. 7 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a third embodiment of the present application.
  • Fig. 8 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a fourth embodiment of the present application.
  • Fig. 9 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a fifth embodiment of the present application.
  • machine vision measurement technology can realize high-precision defect detection.
  • High-precision detection requires the measured object to be at a fixed magnification during imaging.
  • a fixed-focus lens is usually used to achieve a fixed magnification.
  • the measured object is required to be positioned with a positioning fixture to ensure high-precision positioning.
  • the working distance between camera lenses is constant. Therefore, how to provide economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement is an urgent technical problem to be solved.
  • the purpose of the embodiments of the present application is to provide a three-dimensional coordinate calibration method for a plate-shaped workpiece, which provides economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement.
  • the first embodiment of the present application relates to a method for calibrating three-dimensional coordinates of plate-shaped workpieces, 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 application is: Move a camera with a predetermined focal length f in the direction close to/away from the plate-shaped workpiece, and use the camera to take multiple images of the plate-shaped workpiece during each movement; determine the distance to the plate-shaped workpiece according to the sharpness of the multiple images
  • the same three non-collinear reference positions, the plane determined by the three reference positions is used as the reference plane, and the Z-axis calibration direction is determined according to the reference plane; the camera is moved in the reference plane to grasp Take 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 coordinate
  • the 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.
  • the captured images have different definitions.
  • at least three positions that are the same distance from the plate-shaped workpiece and are not collinear can be determined according to the sharpness of the image.
  • the at least three non-collinear position points can determine a plane parallel to the plate-shaped workpiece, that is, parallel to the "XY plane" of the "three-dimensional coordinate system constructed with the plane of the plate-shaped workpiece as the XY plane" Reference plane, and then determine the Z-axis direction perpendicular to the reference plane;
  • the torsion angle of the "X-axis, Y-axis" can be determined by referring to the relationship between the theoretical design angle of the first predetermined feature and the predetermined included angle.
  • the fixed focus lens in the subsequent visual measurement, as long as the fixed focus lens is moved along the 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 ensure that the fixed focus lens is in The working distance between the object and the measured object is constant during the movement.
  • the entire calibration process only needs to be achieved with a monocular camera with a predetermined focal length, which can provide economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement. .
  • the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece includes the following steps.
  • step S101 three starting positions A, B, and C that are far away from PCBA2 and are not collinear can be preselected.
  • the camera 4 is moved in the direction close to PCBA2 (the arrow direction shown in FIG. 2) with the three starting positions A, B, and C as starting points, respectively.
  • the camera captures multiple images of a plate-shaped workpiece.
  • the use of the camera to capture multiple images of the plate-shaped workpiece can be “continuously captured images during the movement” or “every time a preset distance is moved, all images The camera takes an image of a plate-shaped workpiece”. Understandably, in the solution of “using the camera to take an image of a plate-shaped workpiece every time a preset distance is moved”, the preset distance can be appropriately adjusted with reference to the preset focal length f of the camera, so as to ensure a certain calibration accuracy. , Appropriately reduce the number of images taken, reduce the amount of calculation for image definition analysis, and speed up the calibration.
  • the process of moving the camera 4 is not limited to moving from the starting point in a direction close to PCBA2.
  • Three starting positions A, B, and C that are closer to PCBA2 and not collinear can also be selected in advance.
  • S102 Determine three non-collinear reference positions that are the same distance from the plate-shaped workpiece according to the definition of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine Z according to the reference plane.
  • Axis calibration direction
  • step S102 it is possible to first obtain multiple pictures taken by the camera 4 during each movement; then analyze the multiple pictures taken during each movement, and obtain the clearness of the multiple pictures taken during each movement.
  • the picture with the highest degree of resolution; the positions A', B', C'where the camera 4 is located when the picture with the highest definition is taken are determined as the reference positions.
  • the plane determined by the three reference positions A', B', and C' can be used as the reference plane 100, and the direction perpendicular to the reference plane 100 can be determined as the Z-axis calibration direction (shown by the dotted line in FIG. 2) .
  • the camera 4 can be moved back and forth along the rough XY plane in the reference plane 100, so that the angle of view of the camera 4 sweeps through various areas of the PCBA2, and multiple images of the PCBA2 are taken during the movement of the camera 4, And 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.
  • the torsion angle of the "X axis, Y axis" can be determined by referring to the theoretical design angle of the first predetermined feature 201 and the predetermined included angle, thereby determining the X axis , Y axis direction.
  • 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 (that is, perpendicular to the Y axis)"
  • the deflection angle of the long side of the first predetermined feature 201 in the rough XY plane is 0 degrees, because "the long side of the rectangle is parallel to the X axis (that is, perpendicular to the Y axis)", then the current The X-axis direction in the rough XY plane is parallel to the X-axis calibration direction, you can determine that the X-axis calibration direction is parallel to the X-axis direction in the currently rough XY plane, and the Y-axis calibration direction is in the current rough XY plane.
  • X axis direction is vertical;
  • the deflection angle of the long side of the first predetermined feature 201 in the rough XY plane is 5 degrees in the clockwise direction, because "the long side of the rectangle is parallel to the X axis (that is, perpendicular to the Y axis) ", then it means that the X-axis direction in the current rough XY plane is deviated by 5 degrees in the counterclockwise direction compared to the X-axis calibration direction.
  • the X-axis calibration direction can be determined to be the X in the current rough XY plane.
  • the axis direction is the direction deviated by 5 degrees in the clockwise direction
  • the Y-axis calibration direction is the direction where the X axis direction in the current rough XY plane is deviated by 95 degrees in the clockwise direction.
  • the PCBA is in the current fixed position, and "the three-dimensional coordinate system established with PCBA2 as the XY plane" is compared with The deflection angle of the "coarsely defined three-dimensional coordinate system established by the rough XY plane", so as to achieve the calibration of each axis direction of the three-dimensional coordinates of the PCBA, which is convenient for subsequent use of machine vision to measure, refer to the XY plane of the calibration three-dimensional coordinate system to move the camera lens , To ensure that the working distance between the PCBA under test and the camera lens is constant.
  • the second embodiment of the present application provides a three-dimensional coordinate calibration method of a plate-shaped workpiece, which is substantially the same as the three-dimensional coordinate calibration method of a plate-shaped workpiece provided in the first embodiment.
  • the difference is that the method provided in the second embodiment of the present application
  • the three-dimensional coordinate calibration method of the plate-shaped workpiece additionally includes the preparation steps of fixing the plate-shaped workpiece and selecting the starting position.
  • the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided by the second embodiment of the present application includes the following steps:
  • S202 Determine three non-collinear starting positions in the initial initial three-dimensional coordinate system, wherein, in the Z-axis direction of the initial three-dimensional coordinate system, each of the starting positions and the plate-shaped workpiece The distance between is f+ ⁇ E/f- ⁇ E, where ⁇ E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
  • step S201 referring to FIG. 4 and FIG. 5, specifically, the chassis 1 equipped with the PCBA 2 is fixed on the fixing fixture 3 first. Since the PCBA2 to be calibrated is assembled in the chassis 1, the PCBA2 is indirectly fixed on the fixing fixture 3, as shown in Figs. 4 and 5.
  • a well-designed fixing fixture 3 can accurately hold the PCBA2 in the XY plane perpendicular to the drawing surface shown in Figure 4 (also perpendicular to the drawing surface shown in Figure 5).
  • the PCBA2 cannot be disassembled and then inspected during the visual inspection.
  • the chassis 1 needs to be accurately positioned.
  • the chassis 1 is large in size and weight, it will be more difficult to implement the positioning of the chassis 1 itself, and the implementation cost will be higher.
  • the internal assembly tolerances of chassis 1 make it impossible to accurately locate PCBA2 even if chassis 1 can be accurately positioned.
  • the initial three-dimensional coordinate system XYZ is determined according to the fixing fixture 3, as shown in FIG. 6.
  • the so-called "initial three-dimensional coordinate system” refers to an ideal three-dimensional coordinate system determined by taking the plane of PCBA2 as the XY plane in an ideal state where there is no assembly tolerance between PCBA2 and chassis 1. But in fact, the three-dimensional coordinate system determined by the plane where the assembled PCBA2 is located, its X-axis, Y-axis, and Z-axis directions will all be affected by the assembly tolerance between PCBA2 and the chassis 1, which is different from the aforementioned initial three-dimensional coordinate system.
  • the X-axis, Y-axis, and Z-axis directions of the system are different.
  • step S202 three non-collinear starting positions A, B, and C are determined in the initial three-dimensional coordinate system, as shown in FIG. 6.
  • the distance between each of the initial positions 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.
  • This setting takes into account the assembly tolerance ⁇ E of the plate-shaped workpiece,
  • the camera can pass through the optimal imaging position when moving in the direction close to/away from the plate-shaped workpiece, so that a clear image at the optimal imaging position can be captured during each movement, which is convenient for subsequent use of clear images to determine and
  • the distance of the plate-shaped workpiece is the reference position of f.
  • a mechanical arm 5 is also provided on one side of the fixing jig 3.
  • a camera 4 is fixed at the end of the mechanical arm 5, and the camera 4 is a monocular camera with a predetermined focal length f. Driven by the robotic arm 5, the camera 4 can move freely in the X-axis direction, the Y-axis direction, and the Z-axis direction of the initial three-dimensional coordinate system.
  • step S203 specifically, the three starting positions A, B, and C are used as starting points, and the Z-axis direction of the initial three-dimensional coordinate system is moved toward/away from the plate-shaped workpiece with a predetermined focal length f. camera. Since the Z-axis direction of the initial three-dimensional coordinate system is the closest to the direction "perpendicular to" the plate-shaped workpiece, moving the camera along the direction perpendicular or nearly perpendicular to the plate-shaped workpiece can quickly traverse to the reference with a distance of f from the plate-shaped workpiece Obtain a clear image based on the location and shorten the calibration time.
  • step S102 the multiple pictures taken by the camera 4 during each movement can be obtained first; then the multiple pictures taken during each movement are analyzed, and the sharpness of the multiple pictures taken during each movement can be obtained.
  • the picture with the highest degree of resolution; the positions A', B', C'where the camera 4 is located when the picture with the highest definition is taken are determined as the reference positions.
  • the plane determined by the three reference positions A', B', C' can be used as the reference plane 100, and the direction perpendicular to the reference plane 100 can be determined as the Z-axis calibration direction (shown by the dotted line in FIG. 6) .
  • Step S204 to step S206 are substantially the same as step S102 to step S104 of the first embodiment, and will not be repeated here.
  • the PCBA is at the current fixed position, "with PCBA2 in The deflection angle of the "three-dimensional coordinate system established by the XY plane” compared to the "coarse three-dimensional coordinate system established by the rough XY plane", so as to achieve the three-dimensional coordinate calibration of PCBA.
  • the third embodiment of the present application provides a three-dimensional coordinate calibration method of a plate-shaped workpiece, which is substantially the same as the three-dimensional coordinate calibration method of a plate-shaped workpiece provided in the second embodiment, except that the third embodiment of the present application provides
  • the method for calibrating the three-dimensional coordinates of a plate-shaped workpiece further specifically refines step S205 of the second embodiment.
  • the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided by the third embodiment of the present application includes the following steps:
  • S302. Determine three non-collinear starting positions in the initial initial three-dimensional coordinate system, wherein, in the Z-axis direction of the initial three-dimensional coordinate system, each of the starting positions and the plate-shaped workpiece The distance between is f+ ⁇ E/f- ⁇ E, where ⁇ E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
  • 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, and will not be repeated here.
  • the third embodiment of the present application provides a method for calibrating the three-dimensional coordinates of a plate-shaped workpiece, which moves the camera along the X-axis and Y-axis directions of the initial three-dimensional coordinate system. Based on the advantages of the second embodiment, it also has the advantages of facilitating the camera The advantage of scanning the plate-shaped workpiece step by step and grabbing the first predetermined feature as soon as possible.
  • the fourth embodiment of the present application provides a three-dimensional coordinate calibration method of a plate-shaped workpiece, which is substantially the same as the three-dimensional coordinate calibration method of a plate-shaped workpiece provided in the third embodiment, except that the method provided by the fourth embodiment of the present application
  • the three-dimensional coordinate calibration method of the plate-shaped workpiece additionally determines the origin of the calibration three-dimensional coordinate system.
  • the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided by the fourth embodiment of the present application includes steps.
  • S402. Determine three non-collinear starting positions in the initial initial three-dimensional coordinate system, wherein, in the Z-axis direction of the initial three-dimensional coordinate system, each of the starting positions and the plate-shaped workpiece The distance between is f+ ⁇ E/f- ⁇ E, where ⁇ E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
  • Steps S401 to S407 are substantially the same as steps S301 to S307 of the third embodiment, and will not be repeated here.
  • 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 on which 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 can determine the positional relationship between the origin and "the position at which the first predetermined feature is captured", so that the positional relationship between the "first predetermined feature is captured” "The position of the object in time” deduces the position of the origin.
  • the method for calibrating the three-dimensional coordinates of a plate-shaped workpiece is based on the theoretical design position of the first predetermined feature on the plate-shaped workpiece, the predetermined focal length f, and the location when the camera grabs the first predetermined feature.
  • the position of determines the origin position of the calibration three-dimensional coordinate system, which can additionally determine the origin position of the calibration three-dimensional coordinate system based on the advantages of the third embodiment.
  • the fifth embodiment of the present application provides a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece, which is substantially the same as the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided in the fourth embodiment.
  • the difference is that the fifth embodiment of the present application provides
  • the three-dimensional coordinate calibration method of the plate-shaped workpiece additionally provides a verification method for calibrating the three-dimensional coordinate system.
  • the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided by the fifth embodiment of the present application includes steps.
  • S504. Determine three non-collinear reference positions that are the same distance from the plate-shaped workpiece according to the definition of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine Z according to the reference plane. Axis calibration direction.
  • the calibrated three-dimensional coordinate system is used as the effective three-dimensional coordinate system of the plate-shaped workpiece
  • the three-dimensional coordinates of the plate-shaped workpiece are recalibrated.
  • Steps S501 to S508 are substantially the same as steps S501 to S508 of the fourth embodiment, and will not be repeated here.
  • step S509 after determining the axis directions and origin positions of the calibration three-dimensional coordinate system, according to the theoretical design position of the second predetermined feature on the plate-shaped workpiece, it is determined that "the second predetermined feature can be photographed on the plate-shaped workpiece. Then move the camera to the projection position to shoot the plate-shaped workpiece.
  • the calibrated three-dimensional coordinate system obtained by calibration is sufficiently accurate and can be used as an effective three-dimensional coordinate system for subsequent machine vision measurement; if the captured image of the plate-shaped workpiece does not contain the second predetermined feature, the calibrated three-dimensional coordinate system obtained by calibration If there is an error, it can be re-calibrated according to the aforementioned steps S501 to S508 to obtain a valid three-dimensional coordinate system.
  • the method for calibrating the three-dimensional coordinates of a plate-shaped workpiece provided by the fifth embodiment of the present application can additionally verify the accuracy of the calibration of the three-dimensional coordinate system. The reliability of the three-dimensional coordinate calibration of the shaped workpiece.

Abstract

A three-dimensional coordinate calibration method for a plate-like workpiece, comprising: moving a camera (4) having a predetermined focal length f from different starting positions, and taking a plurality of images of the plate-like workpiece by using the camera (4); determining three non-collinear reference positions with the same distance from the plate-like workpiece according to the definition of the plurality of images, taking a plane determined by the three reference positions as a reference plane (100), and determining a Z-axis calibration direction; moving the camera (4) in the reference plane (100) to capture a first predetermined feature (201) on the plate-like workpiece, obtaining a deflection angle of the first predetermined feature (201), and determining X-axis and Y-axis calibration directions according to the deflection angle; and determining the coordinate axis direction of a three-dimensional coordinate system where the plate-like workpiece is located.

Description

一种板状工件的三维坐标校准方法Three-dimensional coordinate calibration method of plate-shaped workpiece
相关申请的交叉引用Cross-references to related applications
本申请基于申请号为201911302623.3、申请日为2019年12月17日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。This application is based on a Chinese patent application with application number 201911302623.3 and an application date of December 17, 2019, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby incorporated into this application by way of introduction.
技术领域Technical field
本申请实施例涉及检测技术领域,特别涉及一种板状工件的三维坐标校准方法。The embodiments of the present application relate to the field of detection technology, and in particular to a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece.
背景技术Background technique
随着电子产品技术的发展,元器件的小型化趋势越来越明显,产品的密度也不断增加,因此,电子产品的制造产业中,采用表面贴装技术(Surface Mount Technology,SMT)进行PCBA(Printed Circuit Board Assembly)的制造和组装、采用自动化机器视觉测量技术进行PCBA产品的视觉检测。With the development of electronic product technology, the trend of miniaturization of components has become more and more obvious, and the density of products has also increased. Therefore, in the manufacturing industry of electronic products, surface mount technology (SMT) is used for PCBA ( Printed Circuit Board Assembly) manufacturing and assembly, using automated machine vision measurement technology for the visual inspection of PCBA products.
发明内容Summary of the invention
本申请的实施方式提供了一种板状工件的三维坐标校准方法,包括以下步骤:自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机,在每次移动过程中利用所述相机拍摄板状工件的多张图像;依据所述多张图像的清晰度确定与板状工件距离相同的、不共线的三个参考位置,将所述三个参考位置确定的平面作为参考平面,根据所述参考平面确定Z轴校准方向;在所述参考平面内移动所述相机、以抓取板状工件上的第一预定特征物,分析所述第一预定特征物的图像、获取所述第一预定特征物的偏转角度,根据所述偏转角度确定X轴校准方向、Y轴校准方向;根据所述X轴校准方向、所述Y轴校准方向以及所述Z轴校准方向确定所述板状工件所处的校准三维坐标系的坐标轴方向。The embodiment of the present application provides a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece, which includes the following steps: moving a camera with a predetermined focal length f from different starting positions and in a direction closer to/away from the plate-shaped workpiece. The camera is used to take multiple images of the plate-shaped workpiece; according to the definition of the multiple images, three non-collinear reference positions that are the same distance from the plate-shaped workpiece are determined, and the three reference positions are determined The plane is used as a reference plane, and the Z-axis calibration direction is determined according to the reference plane; the camera is moved in the reference plane to grab the first predetermined feature on the plate-shaped workpiece, and the first predetermined feature is analyzed. Image, acquiring 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; according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration The direction determines the coordinate axis direction of the calibration three-dimensional coordinate system where the plate-shaped workpiece is located.
附图说明Description of the drawings
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings. These exemplified descriptions do not constitute a limitation on the embodiments. The elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the attached drawings do not constitute a scale limitation.
图1是根据本申请第一实施例提供的板状工件的三维坐标校准方法的流程图;Fig. 1 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a first embodiment of the present application;
图2是根据本申请第一实施例提供的板状工件的三维坐标校准方法的示意图;2 is a schematic diagram of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to the first embodiment of the present application;
图3是根据本申请第二实施例提供的板状工件的三维坐标校准方法的流程图;3 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a second embodiment of the present application;
图4是根据本申请第二实施例对板状工件进行固定后的固定结构正视图;4 is a front view of the fixing structure after fixing the plate-shaped workpiece according to the second embodiment of the present application;
图5是根据本申请第二实施例对板状工件进行固定后的固定结构俯视图;5 is a top view of the fixing structure after fixing the plate-shaped workpiece according to the second embodiment of the present application;
图6是根据本申请第二实施例提供的板状工件的三维坐标校准方法的示意图;Fig. 6 is a schematic diagram of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a second embodiment of the present application;
图7是根据本申请第三实施例提供的板状工件的三维坐标校准方法的流程图;Fig. 7 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a third embodiment of the present application;
图8是根据本申请第四实施例提供的板状工件的三维坐标校准方法的流程图;Fig. 8 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a fourth embodiment of the present application;
图9是根据本申请第五实施例提供的板状工件的三维坐标校准方法的流程图。Fig. 9 is a flowchart of a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to a fifth embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本申请各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本申请的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。In order to make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the various embodiments of the present application will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that in each embodiment of the present application, many technical details are proposed in order to enable readers to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solution claimed in this application can be realized. The following divisions of the various embodiments are for convenience of description, and should not constitute any limitation on the specific implementation manners of the present application, and the various embodiments may be combined with each other without contradiction.
发明人发现现有技术中至少存在如下问题:机器视觉测量技术可以实现高精度的缺陷检测。高精度检测要求被测物在成像时是固定的放大倍率,视觉测量中通常使用定焦镜头实现固定放大倍率,这时就要求被测物用定位夹具做到高精确定位,保证被测物与相机镜头间的工作距离是恒定的,因此,如何为高精度的机器视觉测量提供经济、可靠的三维坐标校准是一个亟待解决的技术问题。The inventor found that there are at least the following problems in the prior art: machine vision measurement technology can realize high-precision defect detection. High-precision detection requires the measured object to be at a fixed magnification during imaging. In visual measurement, a fixed-focus lens is usually used to achieve a fixed magnification. At this time, the measured object is required to be positioned with a positioning fixture to ensure high-precision positioning. The working distance between camera lenses is constant. Therefore, how to provide economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement is an urgent technical problem to be solved.
基于此,本申请实施方式的目的在于提供一种板状工件的三维坐标校准方法,为高精度的机器视觉测量提供经济、可靠的三维坐标校准。Based on this, the purpose of the embodiments of the present application is to provide a three-dimensional coordinate calibration method for a plate-shaped workpiece, which provides economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement.
本申请的第一实施方式涉及一种板状工件的三维坐标校准方法,其可应用于PCBA等板状工件的三维坐标校准,本申请的第一实施方式核心在于:自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机,在每次移动过程中利用所述相机拍摄板状工件的多张图像;依据所述多张图像的清晰度确定与板状工件距离相同的、不共线的三个参考位置,将所述三个参考位置确定的平面作为参考平面,根据所述参考平面确定Z轴校准方向;在所述参考平面内移动所述相机、以抓取板状工件上的第一预定特征物,分析所述第一预定特征物的图像、获取所述第一预定特征物的偏转角度,根据所述偏转角度确定X轴校准方向、Y轴校准方向;根据所述X轴校准方向、所述Y轴校准方向以及所述Z轴校准方向确定所述板状工件所处的校准三维坐标系的坐标轴方向。The first embodiment of the present application relates to a method for calibrating three-dimensional coordinates of plate-shaped workpieces, 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 application is: Move a camera with a predetermined focal length f in the direction close to/away from the plate-shaped workpiece, and use the camera to take multiple images of the plate-shaped workpiece during each movement; determine the distance to the plate-shaped workpiece according to the sharpness of the multiple images The same three non-collinear reference positions, the plane determined by the three reference positions is used as the reference plane, and the Z-axis calibration direction is determined according to the reference plane; the camera is moved in the reference plane to grasp Take 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 coordinate axis direction 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.
本申请的第一实施方式通过具有预定焦距的相机对板状工件进行拍照以校正Z轴方向、通过利用第一预定特征物的偏转角度校正X轴、Y轴方向,In the first embodiment of the present application, the 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.
1.由于相机与板状工件距离不同时、拍摄到的图像清晰度不同,如此以来,便可以根据图像的清晰度确定出至少三个与板状工件距离相同、且不共线的位置点,而该至少三个不共线的位置点可以确定出与板状工件平行的平面,也即与“以板状工件所处平面为XY平面而构建的三维坐标系”的“XY平面”平行的参考平面,进而确定出与参考平面垂直的Z轴方向;1. As the camera and the plate-shaped workpiece are at different distances, the captured images have different definitions. In this way, at least three positions that are the same distance from the plate-shaped workpiece and are not collinear can be determined according to the sharpness of the image. The at least three non-collinear position points can determine a plane parallel to the plate-shaped workpiece, that is, parallel to the "XY plane" of the "three-dimensional coordinate system constructed with the plane of the plate-shaped workpiece as the XY plane" Reference plane, and then determine the Z-axis direction perpendicular to the reference plane;
2.由于板状工件上第一预定特征物的理论设计角度是与“以板状工件所处平面为XY平面而构建的三维坐标系”的“X轴、Y轴”具有预定夹角关系的,如此以来,当获取板状工件上第一预定特征物的偏转角度之后,便可以参考第一预定特征物的理论设计角度与预定夹角关系确定出“X轴、Y轴”的扭转角度,从而确定出X轴、Y轴方向;2. Because the theoretical design angle of the first predetermined feature on the plate-shaped workpiece has a predetermined angle relationship with the "X-axis, Y-axis" of the "three-dimensional coordinate system constructed with the plane of the plate-shaped workpiece as the XY plane" In this way, after the deflection angle of the first predetermined feature on the plate-shaped workpiece is obtained, the torsion angle of the "X-axis, Y-axis" can be determined by referring to the relationship between the theoretical design angle of the first predetermined feature and the predetermined included angle. To determine the X-axis and Y-axis directions;
如此以来,后续视觉测量中,只要确保定焦镜头沿着与Z轴校准方向垂直的平面(也即X轴校准方向和Y轴校准方向共同组成的XY平面)移动,便能保证定焦镜头在移动过程中与被测物之间间隔的工作距离是恒定的,整个校准过程只需要利用具有预定焦距的单目相机即可达成,能够为高精度的机器视觉测量提供经济、可靠的三维坐标校准。In this way, in the subsequent visual measurement, as long as the fixed focus lens is moved along the 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 ensure that the fixed focus lens is in The working distance between the object and the measured object is constant during the movement. The entire calibration process only needs to be achieved with a monocular camera with a predetermined focal length, which can provide economical and reliable three-dimensional coordinate calibration for high-precision machine vision measurement. .
下面对本实施方式的板状工件的三维坐标校准方法的实现细节进行具体的说明,由于该种方法适用于类似PCBA一类的板状工件,因此,本实施方式中以组装入机箱的PCBA为例,对装配入机箱内的PCBA的三维坐标校准方法进行说明。需要说明的是,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。参见图1,本申请第一实施方式提供的板状工件的三维坐标校准方法包括以下步骤。The implementation details of the three-dimensional coordinate calibration method of the plate-shaped workpiece of this embodiment will be described in detail below. Since this method is suitable for plate-shaped workpieces like PCBA, the PCBA assembled into the chassis is taken as an example in this embodiment. , Explain the three-dimensional coordinate calibration method of PCBA assembled in the chassis. It should be noted that the following content is only the implementation details provided for ease of understanding, and is not necessary for the implementation of this solution. Referring to FIG. 1, the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided by the first embodiment of the present application includes the following steps.
S101.自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机,在每 次移动过程中利用所述相机拍摄板状工件的多张图像。S101. Move a camera with a predetermined focal length f from different starting positions in a direction close to/away from the plate-shaped workpiece, and use the camera to take multiple images of the plate-shaped workpiece during each movement.
具体的,请一并参见图2,在步骤S101中,可以预先选定距离PCBA2较远、并不共线的三个起始位置A、B、C。分别以三个所述起始位置A、B、C为起点、沿靠近PCBA2的方向(图2所示箭头方向)移动相机4。在从起始位置A朝靠近PCBA的方向移动的过程中、从起始位置B朝靠近PCBA2的方向移动的过程中、以及从起始位置C朝靠近PCBA的方向移动的过程中,分别利用所述相机拍摄板状工件的多张图像。Specifically, please refer to FIG. 2 together. In step S101, three starting positions A, B, and C that are far away from PCBA2 and are not collinear can be preselected. The camera 4 is moved in the direction close to PCBA2 (the arrow direction shown in FIG. 2) with the three starting positions A, B, and C as starting points, respectively. In the process of moving from the starting position A in the direction close to PCBA, in the process of moving from the starting position B in the direction close to PCBA2, and in the process of moving from the starting position C in the direction close to PCBA, use all The camera captures multiple images of a plate-shaped workpiece.
需要说明的是,本实施方式中,利用所述相机拍摄板状工件的多张图像,可以是“在移动过程中连续不断的拍摄图像”,也可以是“每移动一预设距离,利用所述相机拍摄一张板状工件的图像”。可以理解地,“每移动一预设距离,利用所述相机拍摄一张板状工件的图像”方案中,可以参考相机的预定焦距f适当调整预设距离,从而在确保一定校准精度的前提下,适当减少图像的拍摄数量,降低图像清晰度分析的计算量,并加快校准速度。It should be noted that, in this embodiment, the use of the camera to capture multiple images of the plate-shaped workpiece can be “continuously captured images during the movement” or “every time a preset distance is moved, all images The camera takes an image of a plate-shaped workpiece". Understandably, in the solution of “using the camera to take an image of a plate-shaped workpiece every time a preset distance is moved”, the preset distance can be appropriately adjusted with reference to the preset focal length f of the camera, so as to ensure a certain calibration accuracy. , Appropriately reduce the number of images taken, reduce the amount of calculation for image definition analysis, and speed up the calibration.
另外,可以理解地,移动相机4的过程,并不局限于自起点沿靠近PCBA2的方向移动,也可以预先选定距离PCBA2较近、并不共线的三个起始位置A、B、C,然后分别以三个所述起始位置A、B、C为起点、沿远离PCBA2的方向(图2所示箭头方向的反方向)移动相机4。In addition, it is understandable that the process of moving the camera 4 is not limited to moving from the starting point in a direction close to PCBA2. Three starting positions A, B, and C that are closer to PCBA2 and not collinear can also be selected in advance. , And then move the camera 4 in the direction away from the PCBA2 (the direction opposite to the arrow direction shown in FIG. 2) with the three starting positions A, B, and C as the starting points.
S102.依据所述多张图像的清晰度确定与板状工件距离相同的、不共线的三个参考位置,将所述三个参考位置确定的平面作为参考平面,根据所述参考平面确定Z轴校准方向。S102. Determine three non-collinear reference positions that are the same distance from the plate-shaped workpiece according to the definition of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine Z according to the reference plane. Axis calibration direction.
由于相机4与PCBA2距离不同时、拍摄到的图像清晰度不同,如此以来,每次靠近PCBA2的移动过程中,相机4拍摄到最清晰的图像时所处的位置,必定是与PCBA2的相距f的位置。因此,在步骤S102中,可以先获取相机4在每次移动过程中拍摄的多个画面;然后分析每次移动过程中拍摄的多个画面、获取每次移动过程中拍摄的多个画面中清晰度最高的画面;确定拍摄出清晰度最高的画面时、相机4所处的位置A’、B’、C’,作为所述参考位置。接着,可以将三个参考位置A’、B’、C’确定的平面作为参考平面100,将垂直于所述参考平面100的方向,确定为Z轴校准方向(图2点划线所示)。Since the camera 4 and PCBA2 are at different distances, the captured images have different definitions. Therefore, each time the camera 4 moves closer to the PCBA2, the position where the camera 4 takes the clearest image must be the distance f from the PCBA2. s position. Therefore, in step S102, it is possible to first obtain multiple pictures taken by the camera 4 during each movement; then analyze the multiple pictures taken during each movement, and obtain the clearness of the multiple pictures taken during each movement. The picture with the highest degree of resolution; the positions A', B', C'where the camera 4 is located when the picture with the highest definition is taken are determined as the reference positions. Then, the plane determined by the three reference positions A', B', and C'can be used as the reference plane 100, and the direction perpendicular to the reference plane 100 can be determined as the Z-axis calibration direction (shown by the dotted line in FIG. 2) .
S103.在所述参考平面内移动所述相机、以抓取板状工件上的第一预定特征物,分析所述第一预定特征物的图像、获取所述第一预定特征物的偏转角度,根据所述偏转角度确定X轴校准方向、Y轴校准方向。S103. Move the camera in the reference plane to grab the first predetermined feature on the plate-shaped workpiece, analyze the image of the first predetermined feature, and obtain the deflection angle of the first predetermined feature, The X-axis calibration direction and the Y-axis calibration direction are determined according to the deflection angle.
具体的,可以在所述参考平面100内沿着粗定的XY平面往返移动相机4,使得相机4的视角扫过PCBA2的各个区域,并在相机4的移动过程中拍摄PCBA2的多个图像,并在抓取到PCBA2上的第一预定特征物201的图像时,分析第一预定特征物201的图像,以获取第 一预定特征物201的偏转角度。由于PCBA2上第一预定特征物201的理论设计角度是与“以PCBA所处平面为XY平面而构建的三维坐标系”的“X轴、Y轴”具有预定夹角关系的,如此以来,当获取PCBA2上第一预定特征物201的偏转角度之后,便可以参考第一预定特征物201的理论设计角度与预定夹角关系确定出“X轴、Y轴”的扭转角度,从而确定出X轴、Y轴方向。Specifically, the camera 4 can be moved back and forth along the rough XY plane in the reference plane 100, so that the angle of view of the camera 4 sweeps through various areas of the PCBA2, and multiple images of the PCBA2 are taken during the movement of the camera 4, And 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 PCBA2 is in a predetermined angle relationship with the "X-axis, Y-axis" of the "3D coordinate system constructed with the PCBA as the XY plane", in this way, when After obtaining the deflection angle of the first predetermined feature 201 on the PCBA2, the torsion angle of the "X axis, Y axis" can be determined by referring to the theoretical design angle of the first predetermined feature 201 and the predetermined included angle, thereby determining the X axis , Y axis direction.
例如,当第一预定特征物201为矩形、且其理论设计角度为“矩形长边与X轴平行(也即与Y轴垂直)”时,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 (that is, perpendicular to the Y axis)",
a.如若检测到第一预定特征物201的长边在粗定的XY平面中的偏转角度为0度,由于“矩形长边与X轴平行(也即与Y轴垂直)”,那么说明当前粗定的XY平面中X轴方向是与X轴校准方向平行的,便可以确定X轴校准方向与当前粗定的XY平面中X轴方向平行、Y轴校准方向与当前粗定的XY平面中X轴方向垂直;a. If it is detected that the deflection angle of the long side of the first predetermined feature 201 in the rough XY plane is 0 degrees, because "the long side of the rectangle is parallel to the X axis (that is, perpendicular to the Y axis)", then the current The X-axis direction in the rough XY plane is parallel to the X-axis calibration direction, you can determine that the X-axis calibration direction is parallel to the X-axis direction in the currently rough XY plane, and the Y-axis calibration direction is in the current rough XY plane. X axis direction is vertical;
b.如若检测到第一预定特征物201的长边在粗定的XY平面中的偏转角度为顺时针方向上偏转5度,由于“矩形长边与X轴平行(也即与Y轴垂直)”,那么说明当前粗定的XY平面中X轴方向相较于X轴校准方向、在逆时针方向上偏转5度,如此,便可以确定定X轴校准方向为当前粗定的XY平面中X轴方向沿顺时针方向偏转5度后的方向、Y轴校准方向则为当前粗定的XY平面中X轴方向沿顺时针方向偏转95度后的方向。b. If it is detected that the deflection angle of the long side of the first predetermined feature 201 in the rough XY plane is 5 degrees in the clockwise direction, because "the long side of the rectangle is parallel to the X axis (that is, perpendicular to the Y axis) ", then it means that the X-axis direction in the current rough XY plane is deviated by 5 degrees in the counterclockwise direction compared to the X-axis calibration direction. In this way, the X-axis calibration direction can be determined to be the X in the current rough XY plane. The axis direction is the direction deviated by 5 degrees in the clockwise direction, and the Y-axis calibration direction is the direction where the X axis direction in the current rough XY plane is deviated by 95 degrees in the clockwise direction.
S104.根据所述X轴校准方向、所述Y轴校准方向以及所述Z轴校准方向确定所述板状工件所处的校准三维坐标系的坐标轴方向。S104. Determine the coordinate axis direction 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.
具体的,在获取X轴校准方向、Y轴校准方向以及Z轴校准方向后,便可以获悉PCBA在当前固定位置下、“以PCBA2所处平面为XY平面而确立的三维坐标系”相较于“以粗定的XY平面建立的粗定三维坐标系”的偏转角度,从而对PCBA达成三维坐标的各轴方向校准,便于后续使用机器视觉测量时,参考校准三维坐标系的XY平面移动相机镜头,确保被测PCBA与相机镜头间的工作距离是恒定的。Specifically, after acquiring the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction, it can be learned that the PCBA is in the current fixed position, and "the three-dimensional coordinate system established with PCBA2 as the XY plane" is compared with The deflection angle of the "coarsely defined three-dimensional coordinate system established by the rough XY plane", so as to achieve the calibration of each axis direction of the three-dimensional coordinates of the PCBA, which is convenient for subsequent use of machine vision to measure, refer to the XY plane of the calibration three-dimensional coordinate system to move the camera lens , To ensure that the working distance between the PCBA under test and the camera lens is constant.
本申请第二实施方式提供一种板状工件的三维坐标校准方法,其与第一实施方式提供的板状工件的三维坐标校准方法大体相同,不同之处在于,本申请第二实施方式提供的板状工件的三维坐标校准方法,额外包括固定板状工件和选定起始位置的准备步骤。具体的,参见图3,本申请第二实施方式提供的板状工件的三维坐标校准方法包括步骤:The second embodiment of the present application provides a three-dimensional coordinate calibration method of a plate-shaped workpiece, which is substantially the same as the three-dimensional coordinate calibration method of a plate-shaped workpiece provided in the first embodiment. The difference is that the method provided in the second embodiment of the present application The three-dimensional coordinate calibration method of the plate-shaped workpiece additionally includes the preparation steps of fixing the plate-shaped workpiece and selecting the starting position. Specifically, referring to FIG. 3, the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided by the second embodiment of the present application includes the following steps:
S201.将板状工件固定在固定夹具上,根据固定夹具确定初始三维坐标系;S201. Fix the plate-shaped workpiece on the fixed fixture, and determine the initial three-dimensional coordinate system according to the fixed fixture;
S202.在所述初始初始三维坐标系下确定三个不共线的起始位置,其中,在所述初始三 维坐标系的Z轴方向上、每个所述起始位置与所述板状工件之间的距离为f+△E/f-△E,其中,△E为所述板状工件在Z轴方向上的装配公差;S202. Determine three non-collinear starting positions in the initial initial three-dimensional coordinate system, wherein, in the Z-axis direction of the initial three-dimensional coordinate system, each of the starting positions and the plate-shaped workpiece The distance between is f+△E/f-△E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
S203.自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机,在每次移动过程中利用所述相机拍摄板状工件的多张图像;S203. Move a camera with a predetermined focal length f from different starting positions in a direction close to/away from the plate-shaped workpiece, and use the camera to take multiple images of the plate-shaped workpiece during each movement;
S204.依据所述多张图像的清晰度确定与板状工件距离相同的、不共线的三个参考位置,将所述三个参考位置确定的平面作为参考平面,根据所述参考平面确定Z轴校准方向;S204. Determine three non-collinear reference positions that are the same distance from the plate-shaped workpiece according to the definition of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine Z according to the reference plane. Axis calibration direction;
S205.在所述参考平面内移动所述相机、以抓取板状工件上的第一预定特征物,分析所述第一预定特征物的图像、获取所述第一预定特征物的偏转角度,根据所述偏转角度确定X轴校准方向、Y轴校准方向;S205. Move the camera in the reference plane to grab the first predetermined feature on the plate-shaped workpiece, analyze the image of the first predetermined feature, and obtain the deflection angle of the first predetermined feature, Determine the X-axis calibration direction and the Y-axis calibration direction according to the deflection angle;
S206.根据所述X轴校准方向、所述Y轴校准方向以及所述Z轴校准方向确定所述板状工件所处的校准三维坐标系的坐标轴方向。S206. Determine the coordinate axis direction 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.
关于步骤S201,参见图4及图5,具体的,先将装配有PCBA2的机箱1固定在固定夹具3上。由于待校准的PCBA2装配在机箱1之内,所以PCBA2被间接地固定在固定夹具3上,如图4、图5所示。Regarding step S201, referring to FIG. 4 and FIG. 5, specifically, the chassis 1 equipped with the PCBA 2 is fixed on the fixing fixture 3 first. Since the PCBA2 to be calibrated is assembled in the chassis 1, the PCBA2 is indirectly fixed on the fixing fixture 3, as shown in Figs. 4 and 5.
在理想状态下,设计制作良好的固定夹具3可以将PCBA2精准地固持在与图4所示图面垂直(也与图5所示图面垂直)的XY平面内,但是,在实际情况下,当PCBA2装配到机箱1中完成其他测试后,再进行视觉检测时不能将PCBA2拆卸后再做检测,这时需要对机箱1进行精确定位。但是,当机箱1尺寸大、重量大时,通过定位机箱1本身的实现方式会更加困难,实现成本更高。另外,当PCBA2装配到机箱1中,机箱1内部装配公差的存在导致即便能够精准定位机箱1,仍无法实现对PCBA2的精确定位,所以需要一种方法实现对机箱1内部的PCBA2单独进行精确定位。在将PCBA2固定在固定夹具3上之后,根据固定夹具3确定初始三维坐标系XYZ,如图6所示。所谓“初始三维坐标系”是指在PCBA2与机箱1不存在装配公差的理想状态下、以PCBA2所处的平面为XY平面而确定的理想三维坐标系。但实际上,以装配后的PCBA2所处的平面而确定的三维坐标系,其X轴、Y轴、Z轴方向均会受到PCBA2与机箱1之间的装配公差影响,而与前述初始三维坐标系(也即理想三维坐标系)的X轴、Y轴、Z轴方向存在差异。In an ideal state, a well-designed fixing fixture 3 can accurately hold the PCBA2 in the XY plane perpendicular to the drawing surface shown in Figure 4 (also perpendicular to the drawing surface shown in Figure 5). However, in actual situations, After the PCBA2 is assembled in the chassis 1 to complete other tests, the PCBA2 cannot be disassembled and then inspected during the visual inspection. At this time, the chassis 1 needs to be accurately positioned. However, when the chassis 1 is large in size and weight, it will be more difficult to implement the positioning of the chassis 1 itself, and the implementation cost will be higher. In addition, when PCBA2 is assembled in chassis 1, the internal assembly tolerances of chassis 1 make it impossible to accurately locate PCBA2 even if chassis 1 can be accurately positioned. Therefore, a method is needed to achieve precise positioning of PCBA2 inside chassis 1 alone. . After fixing the PCBA2 on the fixing fixture 3, the initial three-dimensional coordinate system XYZ is determined according to the fixing fixture 3, as shown in FIG. 6. The so-called "initial three-dimensional coordinate system" refers to an ideal three-dimensional coordinate system determined by taking the plane of PCBA2 as the XY plane in an ideal state where there is no assembly tolerance between PCBA2 and chassis 1. But in fact, the three-dimensional coordinate system determined by the plane where the assembled PCBA2 is located, its X-axis, Y-axis, and Z-axis directions will all be affected by the assembly tolerance between PCBA2 and the chassis 1, which is different from the aforementioned initial three-dimensional coordinate system. The X-axis, Y-axis, and Z-axis directions of the system (that is, the ideal three-dimensional coordinate system) are different.
关于步骤S202,在所述初始三维坐标系下确定三个不共线的起始位置A、B、C,如图6所示。本实施方式中,在所述初始三维坐标系的Z轴方向上、每个所述起始位置与所述板状工件之间的距离为f+△E/f-△E,其中,△E为所述板状工件在Z轴方向上的装配公差。如此设置,将板状工件的装配公差△E考虑在内,Regarding step S202, three non-collinear starting positions A, B, and C are determined in the initial three-dimensional coordinate system, as shown in FIG. 6. In this embodiment, in the Z-axis direction of the initial three-dimensional coordinate system, the distance between each of the initial positions 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. This setting takes into account the assembly tolerance △E of the plate-shaped workpiece,
a.如果以“与所述板状工件之间的距离为f+△E”的位置为移动的起点,那么可以将移动方向上“与所述板状工件之间的距离为f-△E”的位置作为移动的终点;a. If the position where "the distance to the plate-shaped workpiece is f+△E" is taken as the starting point of the movement, then the "distance from the plate-shaped workpiece is f-△E" in the moving direction. As the end of the movement;
b.如果以“与所述板状工件之间的距离为f-△E”的位置为移动的起点,那么可以将移动方向上“与所述板状工件之间的距离为f+△E”的位置作为移动的终点,b. If the position where "the distance from the plate-shaped workpiece is f-△E" is the starting point of the movement, then the "distance from the plate-shaped workpiece is f+△E" in the moving direction. As the end of the movement,
确保相机在沿靠近/远离板状工件的方向移动过程中能够经过最佳成像位置,从而每次移动过程中都能拍摄到位于最佳成像位置时的清晰图像,便于后续利用清晰图像确定出与板状工件距离为f的参考位置。Ensure that the camera can pass through the optimal imaging position when moving in the direction close to/away from the plate-shaped workpiece, so that a clear image at the optimal imaging position can be captured during each movement, which is convenient for subsequent use of clear images to determine and The distance of the plate-shaped workpiece is the reference position of f.
需要补充的是,如图4、图5所示,在固定夹具3的一侧还设置有机械臂5,机械臂5的末端固定有相机4,相机4为具有预定焦距f的单目相机,在机械臂5的带动下,相机4可以在初始三维坐标系的X轴方向、Y轴方向、Z轴方向自由移动。It needs to be supplemented that, as shown in Figs. 4 and 5, a mechanical arm 5 is also provided on one side of the fixing jig 3. A camera 4 is fixed at the end of the mechanical arm 5, and the camera 4 is a monocular camera with a predetermined focal length f. Driven by the robotic arm 5, the camera 4 can move freely in the X-axis direction, the Y-axis direction, and the Z-axis direction of the initial three-dimensional coordinate system.
关于步骤S203,具体的,分别以三个所述起始位置A、B、C为起点、沿所述初始三维坐标系的Z轴方向朝靠近/远离板状工件的方向移动具有预定焦距f的相机。由于初始三维坐标系的Z轴方向是最接近于“垂直于”板状工件的方向,沿着垂直或近似垂直板状工件的方向移动相机,能够尽快遍历到与板状工件距离为f的参考位置而获取清晰图像,缩短校准时间。Regarding step S203, specifically, the three starting positions A, B, and C are used as starting points, and the Z-axis direction of the initial three-dimensional coordinate system is moved toward/away from the plate-shaped workpiece with a predetermined focal length f. camera. Since the Z-axis direction of the initial three-dimensional coordinate system is the closest to the direction "perpendicular to" the plate-shaped workpiece, moving the camera along the direction perpendicular or nearly perpendicular to the plate-shaped workpiece can quickly traverse to the reference with a distance of f from the plate-shaped workpiece Obtain a clear image based on the location and shorten the calibration time.
关于步骤204,由于相机4与PCBA2距离不同时、拍摄到的图像清晰度不同,如此以来,每次靠近PCBA2的移动过程中,相机4拍摄到最清晰的图像时所处的位置,必定是与PCBA2的相距f的位置。因此,在步骤S102中,可以先获取相机4在每次移动过程中拍摄的多个画面;然后分析每次移动过程中拍摄的多个画面、获取每次移动过程中拍摄的多个画面中清晰度最高的画面;确定拍摄出清晰度最高的画面时、相机4所处的位置A’、B’、C’,作为所述参考位置。接着,可以将三个参考位置A’、B’、C’确定的平面作为参考平面100,将垂直于所述参考平面100的方向,确定为Z轴校准方向(图6点划线所示)。Regarding step 204, since the camera 4 and PCBA2 are at different distances from each other, the captured images have different definitions. Therefore, each time the camera 4 moves closer to the PCBA2, the position where the camera 4 takes the clearest image must be the same The position of PCBA2 away from f. Therefore, in step S102, the multiple pictures taken by the camera 4 during each movement can be obtained first; then the multiple pictures taken during each movement are analyzed, and the sharpness of the multiple pictures taken during each movement can be obtained. The picture with the highest degree of resolution; the positions A', B', C'where the camera 4 is located when the picture with the highest definition is taken are determined as the reference positions. Then, the plane determined by the three reference positions A', B', C'can be used as the reference plane 100, and the direction perpendicular to the reference plane 100 can be determined as the Z-axis calibration direction (shown by the dotted line in FIG. 6) .
步骤S204~步骤S206与第一实施方式的步骤S102~步骤S104大体相同,在此不再赘述。Step S204 to step S206 are substantially the same as step S102 to step S104 of the first embodiment, and will not be repeated here.
本申请第二实施方式提供的板状工件的三维坐标校准方法,在获取X轴校准方向、Y轴校准方向以及Z轴校准方向后,便可以获悉PCBA在当前固定位置下、“以PCBA2所处平面为XY平面而确立的三维坐标系”相较于“以粗定的XY平面建立的粗定三维坐标系”的偏转角度,从而对PCBA达成三维坐标校准。In the method for calibrating the three-dimensional coordinates of a plate-shaped workpiece provided by the second embodiment of the present application, after obtaining the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction, it can be learned that the PCBA is at the current fixed position, "with PCBA2 in The deflection angle of the "three-dimensional coordinate system established by the XY plane" compared to the "coarse three-dimensional coordinate system established by the rough XY plane", so as to achieve the three-dimensional coordinate calibration of PCBA.
本申请第三实施方式提供一种板状工件的三维坐标校准方法,其与第二实施方式提供的板状工件的三维坐标校准方法大体相同,不同之处在于,本申请第三实施方式提供的板状工件的三维坐标校准方法,对第二实施方式的步骤S205进行了进一步的具体细化.。具体的, 参见图7,本申请第三实施方式提供的板状工件的三维坐标校准方法包括步骤:The third embodiment of the present application provides a three-dimensional coordinate calibration method of a plate-shaped workpiece, which is substantially the same as the three-dimensional coordinate calibration method of a plate-shaped workpiece provided in the second embodiment, except that the third embodiment of the present application provides The method for calibrating the three-dimensional coordinates of a plate-shaped workpiece further specifically refines step S205 of the second embodiment. Specifically, referring to FIG. 7, the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided by the third embodiment of the present application includes the following steps:
S301.将板状工件固定在固定夹具上,根据固定夹具确定初始三维坐标系;S301. Fix the plate-shaped workpiece on the fixed fixture, and determine the initial three-dimensional coordinate system according to the fixed fixture;
S302.在所述初始初始三维坐标系下确定三个不共线的起始位置,其中,在所述初始三维坐标系的Z轴方向上、每个所述起始位置与所述板状工件之间的距离为f+△E/f-△E,其中,△E为所述板状工件在Z轴方向上的装配公差;S302. Determine three non-collinear starting positions in the initial initial three-dimensional coordinate system, wherein, in the Z-axis direction of the initial three-dimensional coordinate system, each of the starting positions and the plate-shaped workpiece The distance between is f+△E/f-△E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
S303.自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机,在每次移动过程中利用所述相机拍摄板状工件的多张图像;S303. Move a camera with a predetermined focal length f from different starting positions in a direction close to/away from the plate-shaped workpiece, and use the camera to take multiple images of the plate-shaped workpiece during each movement;
S304.依据所述多张图像的清晰度确定与板状工件距离相同的、不共线的三个参考位置,将所述三个参考位置确定的平面作为参考平面,根据所述参考平面确定Z轴校准方向;S304. Determine three non-collinear reference positions that are the same distance from the plate-shaped workpiece according to the definition of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine Z according to the reference plane. Axis calibration direction;
S305.将位于所述参考平面内、且平行于所述初始三维坐标系X轴的方向作为第一方向,将位于所述参考平面内、且平行于所述初始三维坐标系Y轴的方向作为第二方向;在所述参考平面内、分别沿所述第一方向和所述第二方向移动所述相机、并在移动过程中拍摄板状工件的图像,直至所述相机抓取到板状工件上的第一预定特征物;S305. Use a direction located in the reference plane and parallel to the X axis of the initial three-dimensional coordinate system as the first direction, and use a direction located in the reference plane and parallel to the Y axis of the initial three-dimensional coordinate system as the first direction. The second direction; within the reference plane, move the camera along the first direction and the second direction, and take images of the plate-shaped workpiece during the movement until the camera captures the plate-shaped The first predetermined feature on the workpiece;
S306.获取所述第一预定特征物在板状工件上的理论设计角度,其中,所述板状工件实际所处三维坐标系的X轴方向、Y轴方向与所述理论设计角度具有预定关系;获取所述理论设计角度与所述偏转角度之间的角度差异;根据所述角度差异以及所述预定关系,确定X轴校准方向、Y轴校准方向;S306. Acquire the theoretical design angle of the first predetermined feature on the plate-shaped workpiece, wherein the X-axis direction and Y-axis direction of the three-dimensional coordinate system where the plate-shaped workpiece is actually located have a predetermined relationship with 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;
S307.根据所述X轴校准方向、所述Y轴校准方向以及所述Z轴校准方向确定所述板状工件所处的校准三维坐标系的坐标轴方向。S307. Determine the coordinate axis direction 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.
步骤S301~步骤S304与第二实施方式的步骤S201~步骤S204大体相同,步骤S307与第二实施方式的步骤S206大体相同,在此不再赘述。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, and will not be repeated here.
本申请第三实施方式提供的板状工件的三维坐标校准方法,沿着初始三维坐标系X轴方向、Y轴方向依次移动相机,其在第二实施方式的优点基础上,还具有能够便于相机对板状工件逐步扫描、尽快抓取到第一预定特征物的优点。The third embodiment of the present application provides a method for calibrating the three-dimensional coordinates of a plate-shaped workpiece, which moves the camera along the X-axis and Y-axis directions of the initial three-dimensional coordinate system. Based on the advantages of the second embodiment, it also has the advantages of facilitating the camera The advantage of scanning the plate-shaped workpiece step by step and grabbing the first predetermined feature as soon as possible.
本申请第四实施方式提供一种板状工件的三维坐标校准方法,其与第三实施方式提供的板状工件的三维坐标校准方法大体相同,不同之处在于,本申请第四实施方式提供的板状工件的三维坐标校准方法,额外确定了校准三维坐标系的原点位置。具体的,参见图8,本申请第四实施方式提供的板状工件的三维坐标校准方法包括步骤。The fourth embodiment of the present application provides a three-dimensional coordinate calibration method of a plate-shaped workpiece, which is substantially the same as the three-dimensional coordinate calibration method of a plate-shaped workpiece provided in the third embodiment, except that the method provided by the fourth embodiment of the present application The three-dimensional coordinate calibration method of the plate-shaped workpiece additionally determines the origin of the calibration three-dimensional coordinate system. Specifically, referring to FIG. 8, the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided by the fourth embodiment of the present application includes steps.
S401.将板状工件固定在固定夹具上,根据固定夹具确定初始三维坐标系;S401. Fix the plate-shaped workpiece on the fixed fixture, and determine the initial three-dimensional coordinate system according to the fixed fixture;
S402.在所述初始初始三维坐标系下确定三个不共线的起始位置,其中,在所述初始三 维坐标系的Z轴方向上、每个所述起始位置与所述板状工件之间的距离为f+△E/f-△E,其中,△E为所述板状工件在Z轴方向上的装配公差;S402. Determine three non-collinear starting positions in the initial initial three-dimensional coordinate system, wherein, in the Z-axis direction of the initial three-dimensional coordinate system, each of the starting positions and the plate-shaped workpiece The distance between is f+△E/f-△E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
S403.自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机,在每次移动过程中利用所述相机拍摄板状工件的多张图像;S403. Move a camera with a predetermined focal length f from different starting positions in a direction close to/away from the plate-shaped workpiece, and use the camera to take multiple images of the plate-shaped workpiece during each movement;
S404.依据所述多张图像的清晰度确定与板状工件距离相同的、不共线的三个参考位置,将所述三个参考位置确定的平面作为参考平面,根据所述参考平面确定Z轴校准方向;S404. Determine three non-collinear reference positions that are the same distance from the plate-shaped workpiece according to the definition of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine Z according to the reference plane. Axis calibration direction;
S405.将位于所述参考平面内、且平行于所述初始三维坐标系X轴的方向作为第一方向,将位于所述参考平面内、且平行于所述初始三维坐标系Y轴的方向作为第二方向;在所述参考平面内、分别沿所述第一方向和所述第二方向移动所述相机、并在移动过程中拍摄板状工件的图像,直至所述相机抓取到板状工件上的第一预定特征物;S405. Use a direction located in the reference plane and parallel to the X axis of the initial three-dimensional coordinate system as the first direction, and use a direction located in the reference plane and parallel to the Y axis of the initial three-dimensional coordinate system as the first direction. The second direction; within the reference plane, move the camera along the first direction and the second direction, and take images of the plate-shaped workpiece during the movement until the camera captures the plate-shaped The first predetermined feature on the workpiece;
S406.获取所述第一预定特征物在板状工件上的理论设计角度,其中,所述板状工件实际所处三维坐标系的X轴方向、Y轴方向与所述理论设计角度具有预定关系;获取所述理论设计角度与所述偏转角度之间的角度差异;根据所述角度差异以及所述预定关系,确定X轴校准方向、Y轴校准方向;S406. Acquire the theoretical design angle of the first predetermined feature on the plate-shaped workpiece, wherein the X-axis direction and Y-axis direction of the three-dimensional coordinate system where the plate-shaped workpiece is actually located have a predetermined relationship with 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;
S407.根据所述X轴校准方向、所述Y轴校准方向以及所述Z轴校准方向确定所述板状工件所处的校准三维坐标系的坐标轴方向;S407. Determine the coordinate axis direction 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;
S408.根据所述第一预定特征物在板状工件上的理论设计位置、所述预定焦距f、以及所述相机抓取到第一预定特征物时所处的位置确定所述校准三维坐标系的原点位置。S408. Determine 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 at which the camera captures the first predetermined feature The origin position.
步骤S401~步骤S407与第三实施方式的步骤S301~步骤S307大体相同,在此不再赘述。Steps S401 to S407 are substantially the same as steps S301 to S307 of the third embodiment, and will not be repeated here.
关于步骤S408,由于板状工件上第一预定特征物的理论设计位置是与“以板状工件所处平面为XY平面而构建的三维坐标系”的原点具有预定位置关系的,如此以来,根据第一预定特征物的理论设计位置、以及预定焦距f可以确定出原点与“抓取到第一预定特征物时所处的位置”之间的位置关系,从而根据“抓取到第一预定特征物时所处的位置”反推出原点的位置。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 on which 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 can determine the positional relationship between the origin and "the position at which the first predetermined feature is captured", so that the positional relationship between the "first predetermined feature is captured" "The position of the object in time" deduces the position of the origin.
本申请第四实施方式提供的板状工件的三维坐标校准方法,根据第一预定特征物在板状工件上的理论设计位置、预定焦距f、以及相机抓取到第一预定特征物时所处的位置确定校准三维坐标系的原点位置,其在第三实施方式的优点基础上,还能够额外确定出校准三维坐标系的原点位置。The method for calibrating the three-dimensional coordinates of a plate-shaped workpiece provided by the fourth embodiment of the present application is based on the theoretical design position of the first predetermined feature on the plate-shaped workpiece, the predetermined focal length f, and the location when the camera grabs the first predetermined feature. The position of determines the origin position of the calibration three-dimensional coordinate system, which can additionally determine the origin position of the calibration three-dimensional coordinate system based on the advantages of the third embodiment.
本申请第五实施方式提供一种板状工件的三维坐标校准方法,其与第四实施方式提供的板状工件的三维坐标校准方法大体相同,不同之处在于,本申请第五实施方式提供的板状工 件的三维坐标校准方法,额外提供了校准三维坐标系的验证手段。具体的,参见图9,本申请第五实施方式提供的板状工件的三维坐标校准方法包括步骤。The fifth embodiment of the present application provides a method for calibrating a three-dimensional coordinate of a plate-shaped workpiece, which is substantially the same as the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided in the fourth embodiment. The difference is that the fifth embodiment of the present application provides The three-dimensional coordinate calibration method of the plate-shaped workpiece additionally provides a verification method for calibrating the three-dimensional coordinate system. Specifically, referring to FIG. 9, the method for calibrating a three-dimensional coordinate of a plate-shaped workpiece provided by the fifth embodiment of the present application includes steps.
S501.将板状工件固定在固定夹具上,根据固定夹具确定初始三维坐标系;S501. Fix the plate-shaped workpiece on the fixed fixture, and determine the initial three-dimensional coordinate system according to the fixed fixture;
S502.在所述初始初始三维坐标系下确定三个不共线的起始位置,其中,在所述初始三维坐标系的Z轴方向上、每个所述起始位置与所述板状工件之间的距离为f+△E/f-△E,其中,△E为所述板状工件在Z轴方向上的装配公差;S502. Determine three non-collinear starting positions in the initial initial three-dimensional coordinate system, wherein, in the Z-axis direction of the initial three-dimensional coordinate system, each of the starting positions and the plate-shaped workpiece The distance between is f+△E/f-△E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction;
S503.自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机,在每次移动过程中利用所述相机拍摄板状工件的多张图像。S503. Move a camera with a predetermined focal length f from different starting positions in a direction close to/away from the plate-shaped workpiece, and use the camera to take multiple images of the plate-shaped workpiece during each movement.
S504.依据所述多张图像的清晰度确定与板状工件距离相同的、不共线的三个参考位置,将所述三个参考位置确定的平面作为参考平面,根据所述参考平面确定Z轴校准方向。S504. Determine three non-collinear reference positions that are the same distance from the plate-shaped workpiece according to the definition of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine Z according to the reference plane. Axis calibration direction.
S505.将位于所述参考平面内、且平行于所述初始三维坐标系X轴的方向作为第一方向,将位于所述参考平面内、且平行于所述初始三维坐标系Y轴的方向作为第二方向;在所述参考平面内、分别沿所述第一方向和所述第二方向移动所述相机、并在移动过程中拍摄板状工件的图像,直至所述相机抓取到板状工件上的第一预定特征物。S505. Use a direction located in the reference plane and parallel to the X axis of the initial three-dimensional coordinate system as the first direction, and use a direction located in the reference plane and parallel to the Y axis of the initial three-dimensional coordinate system as the first direction. The second direction; within the reference plane, move the camera along the first direction and the second direction, and take images of the plate-shaped workpiece during the movement until the camera captures the plate-shaped The first predetermined feature on the workpiece.
S506.获取所述第一预定特征物在板状工件上的理论设计角度,其中,所述板状工件实际所处三维坐标系的X轴方向、Y轴方向与所述理论设计角度具有预定关系;获取所述理论设计角度与所述偏转角度之间的角度差异;根据所述角度差异以及所述预定关系,确定X轴校准方向、Y轴校准方向。S506. Acquire the theoretical design angle of the first predetermined feature on the plate-shaped workpiece, wherein the X-axis direction and Y-axis direction of the three-dimensional coordinate system where the plate-shaped workpiece is actually located have a predetermined relationship with 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.
S507.根据所述X轴校准方向、所述Y轴校准方向以及所述Z轴校准方向确定所述板状工件所处的校准三维坐标系的坐标轴方向。S507. Determine the coordinate axis direction 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.
S508.根据所述第一预定特征物在板状工件上的理论设计位置、所述预定焦距f、以及所述相机抓取到第一预定特征物时所处的位置确定所述校准三维坐标系的原点位置。S508. Determine 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 at which the camera captures the first predetermined feature The origin position.
S509.根据板状工件上第二预定特征物的理论设计位置、计算所述第二预定特征物在所述参考平面上的投影位置,利用所述相机在所述投影位置处拍摄板状工件的图像;S509. Calculate 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, and use the camera to photograph the plate-shaped workpiece at the projection position image;
若在所述投影位置处拍摄的板状工件的图像包含所述第二预定特征物,则将所述校准三维坐标系作为板状工件的有效三维坐标系;If the image of the plate-shaped workpiece taken at the projection position includes the second predetermined feature, the calibrated three-dimensional coordinate system is used as the effective three-dimensional coordinate system of the plate-shaped workpiece;
若在所述投影位置处拍摄的板状工件的图像不包含所述第二预定特征物,则重新校准板状工件的三维坐标。If the image of the plate-shaped workpiece taken at the projection position does not include the second predetermined feature, the three-dimensional coordinates of the plate-shaped workpiece are recalibrated.
步骤S501~步骤S508与第四实施方式的步骤S501~步骤S508大体相同,在此不再赘述。Steps S501 to S508 are substantially the same as steps S501 to S508 of the fourth embodiment, and will not be repeated here.
具体的,关于步骤S509,其在确定校准三维坐标系的各轴方向和原点位置后,依据板状 工件上第二预定特征物的理论设计位置确定出“可以拍摄到板状工件上第二预定特征物”的相机位置(即所述投影位置),再将相机移至所述投影位置、对板状工件进行拍摄,如若拍摄的板状工件的图像包含所述第二预定特征物,则说明校准得到的校准三维坐标系足够准确,可以做为后续机器视觉测量的有效三维坐标系;如若拍摄的板状工件的图像不包含所述第二预定特征物,则说明校准得到的校准三维坐标系存在误差,如此以来,则可重新按照前述的步骤S501~S508重新校准,以期获得有效的三维坐标系。Specifically, with regard to step S509, after determining the axis directions and origin positions of the calibration three-dimensional coordinate system, according to the theoretical design position of the second predetermined feature on the plate-shaped workpiece, it is determined that "the second predetermined feature can be photographed on the plate-shaped workpiece. Then move the camera to the projection position to shoot the plate-shaped workpiece. If the captured image of the plate-shaped workpiece contains the second predetermined feature, it will be explained The calibrated three-dimensional coordinate system obtained by calibration is sufficiently accurate and can be used as an effective three-dimensional coordinate system for subsequent machine vision measurement; if the captured image of the plate-shaped workpiece does not contain the second predetermined feature, the calibrated three-dimensional coordinate system obtained by calibration If there is an error, it can be re-calibrated according to the aforementioned steps S501 to S508 to obtain a valid three-dimensional coordinate system.
本申请第五实施方式提供的板状工件的三维坐标校准方法,其在第四实施方式的优点基础上,还能额外验证校准三维坐标系的准确度,如果不准确则重新校准,提升了板状工件的三维坐标校准的可靠性。Based on the advantages of the fourth embodiment, the method for calibrating the three-dimensional coordinates of a plate-shaped workpiece provided by the fifth embodiment of the present application can additionally verify the accuracy of the calibration of the three-dimensional coordinate system. The reliability of the three-dimensional coordinate calibration of the shaped workpiece.
本领域的普通技术人员可以理解,上述各实施方式是实现本申请的具体实施例,上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围,只要包括相同的逻辑关系,都在本专利的保护范围内。Those of ordinary skill in the art can understand that the above implementations are specific examples for realizing the present application. The steps of the various methods above are divided for clarity of description, and can be combined into one step or some steps can be split during implementation. , Decomposed into multiple steps, and in actual application, various changes can be made in form and details without departing from the spirit and scope of this application. As long as the same logical relationship is included, they are protected by this patent. Within range.

Claims (10)

  1. 一种板状工件的三维坐标校准方法,其中,包括:A method for calibrating three-dimensional coordinates of a plate-shaped workpiece, which includes:
    自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机,在每次移动过程中利用所述相机拍摄板状工件的多张图像;Move a camera with a predetermined focal length f from different starting positions in a direction close to/away from the plate-shaped workpiece, and use the camera to take multiple images of the plate-shaped workpiece during each movement;
    依据所述多张图像的清晰度确定与板状工件距离相同的、不共线的三个参考位置,将所述三个参考位置确定的平面作为参考平面,根据所述参考平面确定Z轴校准方向;Determine three non-collinear reference positions that are the same distance from the plate-shaped workpiece according to the definition of the multiple images, use the plane determined by the three reference positions as the reference plane, and determine the Z-axis calibration according to the reference plane direction;
    在所述参考平面内移动所述相机、以抓取板状工件上的第一预定特征物,分析所述第一预定特征物的图像、获取所述第一预定特征物的偏转角度,根据所述偏转角度确定X轴校准方向、Y轴校准方向;Move the camera in the reference plane to grab the first predetermined feature on the plate-shaped workpiece, analyze the image of the first predetermined feature, and obtain the deflection angle of the first predetermined feature, according to the The deflection angle determines the X-axis calibration direction and Y-axis calibration direction;
    根据所述X轴校准方向、所述Y轴校准方向以及所述Z轴校准方向确定所述板状工件所处的校准三维坐标系的坐标轴方向。Determine the coordinate axis direction 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.
  2. 根据权利要求1所述的板状工件的三维坐标校准方法,其中,所述在每次移动过程中利用所述相机拍摄板状工件的多张图像,为:The method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to claim 1, wherein the photographing multiple images of the plate-shaped workpiece with the camera during each movement is:
    每移动一预设距离,利用所述相机拍摄一张板状工件的图像。Every time a preset distance is moved, an image of a plate-shaped workpiece is taken by the camera.
  3. 根据权利要求1所述的板状工件的三维坐标校准方法,其中,所述依据所述多张图像的清晰度确定与板状工件距离相同的、不共线的三个参考位置,包括:The method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to claim 1, wherein the determining three non-collinear reference positions at the same distance from the plate-shaped workpiece according to the sharpness of the multiple images includes:
    获取所述相机在每次移动过程中拍摄的多个画面;Acquiring multiple pictures taken by the camera during each movement;
    分析每次移动过程中拍摄的所述多个画面、获取每次移动过程中拍摄的所述多个画面中清晰度最高的画面;Analyze the multiple pictures taken during each movement, and obtain the picture with the highest definition among the multiple pictures taken during each movement;
    确定拍摄出所述清晰度最高的画面时、所述相机所处的位置,作为所述参考位置。The position where the camera is located when the picture with the highest definition is taken is determined as the reference position.
  4. 根据权利要求3所述的板状工件的三维坐标校准方法,其中,所述自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机之前,包括:The method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to claim 3, wherein the step of moving the camera with a predetermined focal length f from different starting positions in a direction closer to/away from the plate-shaped workpiece includes:
    将板状工件固定在固定夹具上,根据固定夹具确定初始三维坐标系;Fix the plate-shaped workpiece on the fixed fixture, and determine the initial three-dimensional coordinate system according to the fixed fixture;
    在所述初始初始三维坐标系下确定三个不共线的起始位置,其中,在所述初始三维坐标系的Z轴方向上、每个所述起始位置与所述板状工件之间的距离为f+△E/f-△E,其中,△E为所述板状工件在Z轴方向上的装配公差。Determine three non-collinear starting positions in the initial initial three-dimensional coordinate system, wherein, in the Z-axis direction of the initial three-dimensional coordinate system, between each of the starting positions and the plate-shaped workpiece The distance of is f+△E/f-△E, where △E is the assembly tolerance of the plate-shaped workpiece in the Z-axis direction.
  5. 根据权利要求4所述的板状工件的三维坐标校准方法,其中,所述自不同起始位置、沿靠近/远离板状工件的方向移动具有预定焦距f的相机,为:The method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to claim 4, wherein the moving the camera with a predetermined focal length f from different starting positions in a direction closer to/away from the plate-shaped workpiece is:
    分别以三个所述起始位置为起点、沿所述初始三维坐标系的Z轴方向朝靠近/远离板状工件的方向移动具有预定焦距f的相机。Moving the camera with a predetermined focal length f along the Z-axis direction of the initial three-dimensional coordinate system in a direction approaching/away from the plate-shaped workpiece with the three starting positions as starting points, respectively.
  6. 根据权利要求4所述的板状工件的三维坐标校准方法,其中,所述在所述参考平面内移动所述相机、以抓取板状工件上的第一预定特征物,为:The method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to claim 4, wherein the moving the camera in the reference plane to grab the first predetermined feature on the plate-shaped workpiece is:
    将位于所述参考平面内、且平行于所述初始三维坐标系X轴的方向作为第一方向,将位于所述参考平面内、且平行于所述初始三维坐标系Y轴的方向作为第二方向;The direction located in the reference plane and parallel to the X axis of the initial three-dimensional coordinate system is taken as the first direction, and the direction located in the reference plane and parallel to the Y axis of the initial three-dimensional coordinate system is taken as the second direction. direction;
    在所述参考平面内、分别沿所述第一方向和所述第二方向移动所述相机、并在移动过程中拍摄板状工件的图像,直至所述相机抓取到板状工件上的第一预定特征物。In the reference plane, move the camera along the first direction and the second direction respectively, and take an image of the plate-shaped workpiece during the movement, until the camera grabs the first plate-shaped workpiece. A predetermined feature.
  7. 根据权利要求4所述的板状工件的三维坐标校准方法,其中,所述根据所述偏转角度确定X轴校准方向、Y轴校准方向,包括:The method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to claim 4, wherein the determining the X-axis calibration direction and the Y-axis calibration direction according to the deflection angle comprises:
    获取所述第一预定特征物在板状工件上的理论设计角度,其中,所述板状工件实际所处三维坐标系的X轴方向、Y轴方向与所述理论设计角度具有预定关系;Acquiring the theoretical design 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 where the plate-shaped workpiece is actually located have a predetermined relationship with the theoretical design angle;
    获取所述理论设计角度与所述偏转角度之间的角度差异;Acquiring the angular difference between the theoretical design angle and the deflection angle;
    根据所述角度差异以及所述预定关系,确定X轴校准方向、Y轴校准方向。According to the angle difference and the predetermined relationship, the X-axis calibration direction and the Y-axis calibration direction are determined.
  8. 根据权利要求7所述的板状工件的三维坐标校准方法,其中,所述根据所述X轴校准方向、所述Y轴校准方向以及所述Z轴校准方向确定所述板状工件所处的校准三维坐标系的坐标轴方向之后,还包括:The method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to claim 7, wherein the method for determining where the plate-shaped workpiece is located is determined according to the X-axis calibration direction, the Y-axis calibration direction, and the Z-axis calibration direction. After calibrating the coordinate axis direction of the three-dimensional coordinate system, it also includes:
    根据所述第一预定特征物在板状工件上的理论设计位置、所述预定焦距f、以及所述相机抓取到第一预定特征物时所处的位置确定所述校准三维坐标系的原点位置。Determine the origin 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 at which the camera captures the first predetermined feature position.
  9. 根据权利要求8所述的板状工件的三维坐标校准方法,其中,所述根据所述第一预定特征物在板状工件上的理论设计位置、所述预定焦距f、以及所述相机抓取到第一预定特征物时所处的位置确定所述校准三维坐标系的原点位置之后,还包括:The method for calibrating a three-dimensional coordinate of a plate-shaped workpiece according to claim 8, wherein the theoretically designed position on the plate-shaped workpiece according to the first predetermined feature, the predetermined focal length f, and the camera grabbing After the position of the first predetermined characteristic object is determined after the origin position of the calibrated three-dimensional coordinate system is determined, the method further includes:
    根据板状工件上第二预定特征物的理论设计位置、计算所述第二预定特征物在所述参考平面上的投影位置;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 take an image of the plate-shaped workpiece at the projection position;
    若在所述投影位置处拍摄的板状工件的图像包含所述第二预定特征物,则将所述校准三维坐标系作为板状工件的有效三维坐标系。If the image of the plate-shaped workpiece taken at the projection position includes the second predetermined feature, the calibrated three-dimensional coordinate system is used as the effective three-dimensional coordinate system of the plate-shaped workpiece.
  10. 根据权利要求9所述的板状工件的三维坐标校准方法,其中,所述利用所述相机在所述投影位置处拍摄板状工件的图像之后,还包括:9. The method for calibrating the three-dimensional coordinates of the plate-shaped workpiece according to claim 9, wherein after the use of the camera to take an image of the plate-shaped workpiece at the projection position, the method further comprises:
    若在所述投影位置处拍摄的板状工件的图像不包含所述第二预定特征物,则重新校准板状工件的三维坐标。If the image of the plate-shaped workpiece taken at the projection position does not include the second predetermined feature, the three-dimensional coordinates of the plate-shaped workpiece are recalibrated.
PCT/CN2020/126585 2019-12-17 2020-11-04 Three-dimensional coordinate calibration method for plate-like workpiece WO2021120911A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911302623.3 2019-12-17
CN201911302623.3A CN112985257A (en) 2019-12-17 2019-12-17 Three-dimensional coordinate calibration method for plate-shaped workpiece

Publications (1)

Publication Number Publication Date
WO2021120911A1 true WO2021120911A1 (en) 2021-06-24

Family

ID=76342295

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/126585 WO2021120911A1 (en) 2019-12-17 2020-11-04 Three-dimensional coordinate calibration method for plate-like workpiece

Country Status (2)

Country Link
CN (1) CN112985257A (en)
WO (1) WO2021120911A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114918737A (en) * 2022-04-20 2022-08-19 鸿富锦精密电子(成都)有限公司 Coordinate system correction method, industrial equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090196527A1 (en) * 2008-02-01 2009-08-06 Hiwin Mikrosystem Corp. Calibration method of image planar coordinate system for high-precision image measurement system
CN105091744A (en) * 2015-05-07 2015-11-25 中国科学院自动化研究所 Pose detection apparatus and method based on visual sensor and laser range finder
CN105631390A (en) * 2014-10-28 2016-06-01 佛山市顺德区美的电热电器制造有限公司 Spatial positioning method and spatial positioning system
CN107454377A (en) * 2016-05-31 2017-12-08 深圳市微付充科技有限公司 A kind of algorithm and system that three-dimensional imaging is carried out using camera
CN109541626A (en) * 2018-12-12 2019-03-29 华南农业大学 Objective plane normal direction amount detecting device and detection method
CN110170995A (en) * 2019-05-09 2019-08-27 广西安博特智能科技有限公司 A kind of quick teaching method of robot based on stereoscopic vision

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090196527A1 (en) * 2008-02-01 2009-08-06 Hiwin Mikrosystem Corp. Calibration method of image planar coordinate system for high-precision image measurement system
CN105631390A (en) * 2014-10-28 2016-06-01 佛山市顺德区美的电热电器制造有限公司 Spatial positioning method and spatial positioning system
CN105091744A (en) * 2015-05-07 2015-11-25 中国科学院自动化研究所 Pose detection apparatus and method based on visual sensor and laser range finder
CN107454377A (en) * 2016-05-31 2017-12-08 深圳市微付充科技有限公司 A kind of algorithm and system that three-dimensional imaging is carried out using camera
CN109541626A (en) * 2018-12-12 2019-03-29 华南农业大学 Objective plane normal direction amount detecting device and detection method
CN110170995A (en) * 2019-05-09 2019-08-27 广西安博特智能科技有限公司 A kind of quick teaching method of robot based on stereoscopic vision

Also Published As

Publication number Publication date
CN112985257A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN109859272B (en) Automatic focusing binocular camera calibration method and device
CN111263142B (en) Method, device, equipment and medium for testing optical anti-shake of camera module
EP2023081A2 (en) Method for repeatable optical determination of object geometry dimensions and deviations
JPH04287943A (en) Surfae mounting device having mutual flatness evaluation device of lead wires
JP2009156877A (en) Three-dimensional inspection system
CN108429908B (en) Camera module testing method, device, equipment and medium
CN111156899B (en) Vision measurement device and method and robot
US10535157B2 (en) Positioning and measuring system based on image scale
US9157874B2 (en) System and method for automated x-ray inspection
CN114714356A (en) Method for accurately detecting calibration error of hand eye of industrial robot based on binocular vision
CN110044266B (en) Photogrammetry system based on speckle projection
WO2021120911A1 (en) Three-dimensional coordinate calibration method for plate-like workpiece
CN113251953B (en) Mirror included angle measuring device and method based on stereo deflection technology
US20210382259A1 (en) Positioning system for components of optical systems
US20120056999A1 (en) Image measuring device and image measuring method
KR102124291B1 (en) Correction Method for Lens Measurement Error of Optical Precision Meter
CN212871124U (en) Parallelism measuring apparatus
JP2001124700A (en) Calibration method of inspection machine with line sensor camera
JP4969279B2 (en) Position detection method and position detection apparatus
CN209877942U (en) Image distance measuring instrument
CN114494460A (en) Calibration method, multi-camera probe device and flying probe tester
CN111879260A (en) Parallelism measuring apparatus and method
JPH09329440A (en) Coordinating method for measuring points on plural images
JPH11132735A (en) Ic lead floating inspection device and inspection method
CN218628125U (en) Calibration sheet

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20901099

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20901099

Country of ref document: EP

Kind code of ref document: A1