Calibration method and device for needle head of dispensing system and guide camera, and electronic equipment
By determining the coordinates of the center of the guide camera's field of view and the center of the needle tip in the dispensing system, the problem of the accuracy of the relative position between the vision system and the dispensing path is solved, enabling precise distance calculation and avoiding human error.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies struggle to ensure the accuracy of association between multiple feature points when determining the relative positions of the vision system and the dispensing path, affecting calibration and distance accuracy.
By determining when the distance deviation between the center of the guide camera's field of view and the center of the feature's front end is less than a first deviation threshold, and when the distance deviation between the center of the needle's front end and the center of the feature's front end is less than a second deviation threshold, first and second coordinate points are determined respectively, and the distance between the guide camera and the needle is calculated based on these coordinate points.
This ensures the accuracy of the distance between the guide camera and the needle, avoids human error, and improves calibration accuracy.
Smart Images

Figure CN117036495B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of dispensing technology, and in particular relates to a method, apparatus, electronic device, and computer-readable storage medium for calibrating the needle and guide camera of a dispensing system. Background Technology
[0002] In a dispensing system, the relative position between the vision system and the dispensing path needs to be determined first. Then, based on this relative position and the position information detected by the vision system, the dispensing path is guided to achieve dispensing.
[0003] Currently, the relative position between the vision system and the dispensing path can be determined as follows: Multiple feature points are created directly from the dispensing needle through methods such as poking and dispensing. The vision system then calibrates these feature points and correlates them with the needle's coordinate system to obtain the relative position between the vision system and the dispensing path. This method requires that all feature points have a strong correlation with the needle and be accurate; otherwise, the calibration accuracy will be affected, consequently impacting the coordinate accuracy. Summary of the Invention
[0004] This application provides a calibration method, apparatus, and electronic device for the needle and guide camera of a dispensing system. It can solve the problem that existing methods have difficulty in ensuring the accuracy of the association between the vision system and multiple feature points when determining the relative position of the vision system and the dispensing path, and thus have difficulty in ensuring the accuracy of the determined distance.
[0005] In a first aspect, embodiments of this application provide a calibration method for the needle and guide camera of a dispensing system, comprising:
[0006] When the distance deviation from the center of the field of view of the guide camera is less than a preset first deviation threshold, the current front end center of the preset feature is located at the coordinate point of the dispensing system, and the first coordinate point is obtained. The initial position of the front end center of the preset feature is determined according to the preset target position coordinates.
[0007] When the distance deviation from the tip center of the needle is less than a preset second deviation threshold, the current tip center of the feature is located at the coordinate point of the dispensing system, and the second coordinate point is obtained. The initial position of the preset tip center of the feature is determined based on the target position coordinates.
[0008] The distance between the guide camera and the needle is determined based on the first coordinate point and the second coordinate point.
[0009] Secondly, embodiments of this application provide a calibration device for a dispensing system needle and a guide camera, comprising:
[0010] The first coordinate point determination module is used to determine the coordinate point of the current front end center of the preset feature in the dispensing system when the distance deviation from the center of the field of view of the guiding camera is less than a preset first deviation threshold, thereby obtaining the first coordinate point. The initial position of the front end center of the preset feature is determined according to the preset target position coordinates.
[0011] The second coordinate point determination module is used to determine the coordinate point of the current front end center of the feature in the dispensing system when the distance deviation from the front end center of the needle is less than a preset second deviation threshold, thereby obtaining the second coordinate point. The initial position of the preset front end center of the feature is determined according to the target position coordinates.
[0012] The distance determination module is used to determine the distance between the guide camera and the needle based on the first coordinate point and the second coordinate point.
[0013] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0015] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the method described in the first aspect above.
[0016] The beneficial effects of the embodiments in this application compared with the prior art are:
[0017] In this embodiment, the first coordinate point is the coordinate point of the dispensing system when the distance deviation between the center of the field of view of the guide camera and the center of the front end of the preset feature is less than a preset first deviation threshold, and the second coordinate point is the coordinate point of the dispensing system when the distance deviation between the center of the front end of the needle and the center of the front end of the preset feature is less than a preset second deviation threshold. Therefore, the first and second coordinate points can respectively reflect the positions of the center of the field of view of the guide camera and the center of the front end of the needle in the dispensing system. At the same time, since the determination of the first and second coordinate points is related to the initial position of the center of the front end of the feature, and the initial position of the center of the front end of the feature is determined according to the preset target position coordinates, that is, the determination of the first and second coordinate points is based on the same position information, the accuracy of the determined distance can be guaranteed when the distance between the guide camera and the needle is determined according to the first and second coordinate points. Furthermore, since it is not necessary to determine the coordinates of the guide camera and the needle separately when determining the distance between the guide camera and the needle, and there is no need for manual operation (such as no need to control the needle dispensing), that is, no human error is introduced. Therefore, the accuracy of the determined distance can be further guaranteed, that is, the accuracy of the calibration of the field of view center of the needle and the guide camera can be guaranteed. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0019] Figure 1 This is a schematic diagram showing the relative positions of the guide camera and the needle in a dispensing system provided in an embodiment of this application;
[0020] Figure 2 This is a schematic flowchart illustrating a calibration method for a dispensing system needle and a guide camera according to an embodiment of this application.
[0021] Figure 3 This is a schematic diagram of the structure of a dispensing system provided in one embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the structure of a needle and a calibration device for a guide camera in a dispensing system according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation
[0024] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0025] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0026] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0027] Furthermore, in the description of this application and the appended claims, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0028] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0029] Example 1:
[0030] like Figure 1 As shown, in the dispensing system, the guide camera 12 (which is a camera with a shooting function) and the needle 13 are both on the same axis. The lens of the guide camera 12 faces downwards, and the tip of the needle 13 also faces downwards. Assume the axis on which the guide camera 12 and the needle 13 are located is the Y-axis (i.e.,...). Figure 1 (The axis indicated by label 11 in the figure) During the dispensing process, the guide camera 12 and the needle 13 can move left and right along the Y-axis, and the guide front end is also a needle pointing downwards to achieve dispensing.
[0031] Since the guide camera 12 and the needle 13 are both independent devices, there will be a certain distance between the guide camera 12 and the needle 13. Only by accurately determining this distance can we ensure that the needle 13 can dispense glue at the accurate position according to the guidance of the guide camera 12.
[0032] To improve the accuracy of determining the distance between the guide camera and the needle, this application provides a calibration method for the needle and guide camera in a dispensing system. In this calibration method, based on preset target position coordinates, the projection points of the center of the guide camera's field of view and the center of the needle's tip are determined respectively. Then, the distance between the center of the guide camera's field of view and the center of the needle's tip is determined based on the distance between these two projection points.
[0033] The calibration method for the needle and guide camera of the dispensing system provided in this application embodiment will be described below with reference to the accompanying drawings.
[0034] Figure 2 A schematic flowchart illustrating a calibration method for a dispensing system needle and guide camera according to an embodiment of this application is shown. This calibration method can be applied to the processor of the dispensing system, and is described in detail below:
[0035] S21, when the distance deviation from the center of the field of view of the above-mentioned guiding camera is less than the preset first deviation threshold, the current front end center of the preset feature is located at the coordinate point of the above-mentioned dispensing system, and the first coordinate point is obtained, wherein the initial position of the front end center of the preset feature is determined according to the preset target position coordinates.
[0036] The preset feature is an object selected by the user to help determine the distance between the guide camera and the needle. For example, the preset feature can be an object whose material, length, shape, etc. are the same as or similar to the needle.
[0037] The initial position of the center of the front end of the preset feature is determined based on preset target position coordinates. These preset target position coordinates are known coordinates, which can be determined based on the position of the object in the coordinate system of the dispensing system, such as the position of the preset feature in the coordinate system of the dispensing system; in some embodiments, the target position coordinates can also be determined based on the position selected by the user, which is not limited here.
[0038] In this embodiment, the feature can be moved, or the receiving device containing the feature can be moved, meaning the coordinates of the front end center of the feature in the dispensing system can change; and the guide camera can move along its axis, meaning the coordinates of the guide camera's field of view center in the dispensing system can also change. Specifically, the feature is placed according to the target position coordinates (e.g., so that the coordinates of the front end center of the placed feature are the target position coordinates). When the front end shape of the feature is a regular shape, the center of the regular shape can be determined first (e.g., when the regular shape is a circle, the front end center is the center of the circle). Then, the distance deviation between the field of view center of the guide camera and the front end center of the feature is calculated. If the calculated distance deviation meets the preset first deviation condition, the coordinate point of the current field of view center of the guide camera (or the current front end center of the feature) in the dispensing system is determined as the first coordinate point.
[0039] In some embodiments, the unit of the first deviation threshold is millimeters, which is set according to the required accuracy. For example, when the required accuracy is 0.01 millimeters, the first deviation threshold can be set to 0.01 millimeters. It should be noted that the aforementioned distance deviation may include distance deviations on multiple coordinate axes. For example, assuming that the axis where the guide camera and the needle are located is the Y-axis, and the axis where the feature is located is the X-axis, then the first deviation threshold is the deviation threshold on these multiple coordinate axes. That is, the first deviation threshold may be: the distance deviation on the X-axis is less than 0.01 millimeters, and the distance deviation on the Y-axis is less than 0.01 millimeters.
[0040] S22, when the distance deviation from the center of the tip of the needle is less than the preset second deviation threshold, the current center of the tip of the feature is located at the coordinate point of the dispensing system, and the second coordinate point is obtained. The initial position of the preset center of the tip of the feature is determined according to the preset target position coordinates.
[0041] The shape of the tip of the needle includes regular shapes. For example, when the tip of the needle is circular, the center of the tip of the needle is the center of the circle.
[0042] In this embodiment of the application, the front end of the feature is placed according to the target position coordinates (e.g., the coordinates of the center of the front end of the placed feature are the target position coordinates), and the deviation between the center of the front end of the feature and the center of the front end of the needle is calculated. If the calculated deviation meets the second deviation condition, the coordinate point of the current front end center of the needle in the dispensing system is determined as the second coordinate point.
[0043] In some embodiments, the second deviation threshold may be the same as or different from the first deviation threshold, depending on the required accuracy. For example, if the required accuracy is 0.01 mm, the second deviation threshold may be set to 0.01 mm. It should be noted that the aforementioned distance deviation may include distance deviations on multiple coordinate axes. For example, assuming the axis containing the guide camera and needle is the Y-axis, and the axis containing the feature is the X-axis, the second deviation threshold is the deviation threshold on these multiple coordinate axes. For instance, the second deviation threshold may be set as follows: the distance deviation on the X-axis is less than 0.01 mm, the distance deviation on the Y-axis is less than 0.01 mm, and the distance deviation on the Z-axis is less than 0.01 mm.
[0044] S23, Based on the first coordinate point and the second coordinate point, determine the distance between the guide camera and the needle.
[0045] Specifically, the distance between the guide camera and the needle can be determined by calculating the distance deviation between the first and second coordinate points on different coordinate axes. For example, assuming the first coordinate point is P1 and the second coordinate point is P2, the distance between the guide camera and the needle is:
[0046] ΔX”=X_P2-X_P1; ΔY”=Y_P2-Y_P1; ΔZ”=Z_P2-Z_P1.
[0047] Wherein, X_P1, Y_P1, and Z_P1 are the components of P1 on the X-axis, Y-axis, and Z-axis, respectively; similarly, X_P2, Y_P2, and Z_P2 are the components of P2 on the X-axis, Y-axis, and Z-axis, respectively. In some embodiments, after determining the distance between the guide camera and the needle (assumed to be the target distance), if a dispensing instruction is received, the position information to be dispensed is parsed from the dispensing instruction, the image captured by the guide camera is analyzed, and the physical position points corresponding to the pixels in the image (i.e., the position points in the actual scene) are parsed. The position point to be matched is calculated based on the physical position point and the target distance. If the position point to be matched is the same as the position information to be dispensed, the needle is controlled to dispense glue to complete the dispensing operation of the needle.
[0048] In this embodiment, the first coordinate point is the coordinate point of the dispensing system when the distance deviation between the center of the field of view of the guide camera and the center of the front end of the preset feature is less than a preset first deviation threshold, and the second coordinate point is the coordinate point of the dispensing system when the distance deviation between the center of the front end of the needle and the center of the front end of the preset feature is less than a preset second deviation threshold. Therefore, the first and second coordinate points can respectively reflect the positions of the center of the field of view of the guide camera and the center of the front end of the needle in the dispensing system. At the same time, since the determination of the first and second coordinate points is related to the initial position of the center of the front end of the feature, and the initial position of the center of the front end of the feature is determined according to the preset target position coordinates, that is, the determination of the first and second coordinate points is based on the same position information, the accuracy of the determined distance can be guaranteed when the distance between the guide camera and the needle is determined according to the first and second coordinate points. Furthermore, since it is not necessary to determine the coordinates of the guide camera and the needle separately when determining the distance between the guide camera and the needle, and there is no need for manual operation (such as no need to control the needle dispensing), that is, no human error is introduced. Therefore, the accuracy of the determined distance can be further guaranteed, that is, the accuracy of the calibration of the field of view center of the needle and the guide camera can be guaranteed.
[0049] It should be noted that there is no fixed order in which the first coordinate point and the second coordinate point are determined. For example, in practice, the second coordinate point can be determined first and then the first coordinate point can be determined.
[0050] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0051] Example 2:
[0052] like Figure 3 As shown, in some embodiments, the dispensing system provided in this application also includes a needle-setting cartridge 32 located on the shaft 31, which is movable on the shaft 31. Figure 3It is known that the needle box 32 is located below the guide camera 12 (or needle 13), and a needle-aligning camera (not shown in the figure) is disposed within the needle box 32. This needle-aligning camera is used to determine the position coordinates of objects within its field of view in the dispensing system. For example, when a feature is mounted in the needle box and within the field of view of the needle-aligning camera, the camera can determine the position coordinates of the feature point (such as the center of the tip of the feature) within the dispensing system. Similarly, when the needle 13 is within the field of view of the needle-aligning camera, it can determine the position coordinates of the feature point (such as the center of the tip of the needle) within the dispensing system. When the needle-aligning camera is a depth camera, the position coordinates determined by the camera are three-dimensional coordinates. Alternatively, the camera can be two cameras (such as two cameras with lenses placed perpendicularly to each other), and the three-dimensional position coordinates can be determined based on these two cameras.
[0053] In some embodiments, the calibration method for the needle and guide camera of the dispensing system provided in this application further includes:
[0054] The position coordinates of the front end center of the feature object that meets the preset positioning conditions in the above-mentioned dispensing system are determined as the target position coordinates, wherein the preset positioning conditions include: the feature object is within the field of view of the above-mentioned needle-aligning camera.
[0055] Specifically, once the feature is within the field of view of the needle-aligning camera, the camera can take a picture of the feature, which will help the camera to determine the second coordinates by taking pictures of the feature and the needle.
[0056] In some embodiments, to improve the accuracy of the obtained second coordinates, the positioning condition may further include: the feature is within the field of view of the needle-aligning camera and is in sharp focus. Since the feature is in sharp focus within the field of view of the needle-aligning camera, after the camera captures the feature, it will obtain a clear image corresponding to the feature. Thus, after analyzing the image, more accurate pixel coordinates corresponding to the feature can be obtained, and subsequently, more accurate position coordinates of the feature within the dispensing system can be obtained based on these more accurate pixel coordinates.
[0057] In some embodiments, to ensure the stability of the feature's position in the dispensing system, a structure for fixing the feature can be provided within the needle box. For example, when the feature has an externally threaded tail, this structure is a hole with an internally threaded hole. The feature is fixed within the structure in the needle box, and the height of the feature is not greater than the height of the needle box, so that the feature is within the field of view of the needle camera.
[0058] In some embodiments, S21 includes:
[0059] A1. When the aforementioned feature is within the field of view of the aforementioned needle camera, an image including the front center of the aforementioned feature is obtained by the aforementioned guide camera to obtain a first image.
[0060] Specifically, when the feature is within the field of view of the needle-aligning camera, the position coordinates of the center of the front end of the feature within the dispensing system are the target position coordinates. For example, if the feature is fixed inside the needle-aligning box and is within the field of view of the guide camera, the guide camera is controlled to perform a shooting action to acquire a first image; if the feature is not within the field of view of the guide camera, the guide camera is controlled to move above the feature so that the feature is within the field of view of the guide camera before performing the shooting action to acquire the first image.
[0061] A2. Based on the position of the front end center of the aforementioned feature in the aforementioned first image, the field of view center of the aforementioned guide camera, and the preset first mapping relationship, determine the distance deviation between the front end center of the aforementioned feature and the field of view center of the aforementioned guide camera in the actual scene, and obtain the first distance deviation, wherein the aforementioned first mapping relationship is used to record the mapping relationship between the pixel distance of the aforementioned guide camera and the distance in the actual scene.
[0062] The first mapping relationship can be determined by calibrating the guide camera, which can be a 9-point calibration (or nine-grid calibration). When using the 9-point calibration method, the guide camera can be used to photograph objects or patterns at 9 positions. Based on the pixel positions of the objects or patterns at these 9 positions in the captured images and their positions in the actual scene, the mapping relationship between the distances between pixels in the images captured by the guide camera (i.e., pixel distances) and the distances in the actual scene can be determined.
[0063] Specifically, the pixel distance between the front end center and the field of view center is calculated based on the position of the front end center of the feature in the first image and the position of the field of view center of the guiding camera in the first image. The distance deviation between the front end center and the field of view center in the actual scene is calculated based on the calculated pixel distance and the first mapping relationship.
[0064] A3. If the first distance deviation is less than the preset first deviation threshold, the coordinate point of the current field of view center of the guide camera in the dispensing system is determined as the first coordinate point.
[0065] Specifically, when the first distance deviation is less than the first deviation threshold, the difference between the position of the center of the field of view of the guiding camera and the position of the front end center of the feature is small. In this case, the coordinate point where the center of the field of view is located can be determined as the first coordinate point, or the coordinate point where the front end center of the feature is located can be determined as the first coordinate point.
[0066] In this embodiment, considering the correspondence between pixel distances in an image and distances in the actual scene, the distance deviation between the front center of the feature and the field of view of the guiding camera in the actual scene can be calculated by taking an image of the front center of the feature using a guiding camera. The corresponding first coordinate point is then determined based on this distance deviation. Since no human error is introduced during the shooting action and distance deviation calculation, the accuracy of the obtained first coordinate point is improved.
[0067] In some embodiments, the guide camera and the needle are on the Y-axis of the coordinate system in which the dispensing system is located, and the needle box is on the X-axis of the coordinate system in which the dispensing system is located.
[0068] Specifically, the guide camera and needle can move on the Y-axis, and the needle box can move on the X-axis.
[0069] Assuming the first distance deviation includes a distance deviation ΔX on the X-axis and a distance deviation ΔY on the Y-axis, ΔX can be reduced by controlling the movement of the needle box on the X-axis, and ΔY can be reduced by controlling the movement of the guide camera on the Y-axis. Of course, if the first distance deviation only includes the distance deviation on the X-axis, then only the movement of the needle box on the X-axis needs to be controlled to reduce ΔX, without needing to control the movement of the guide camera on the Y-axis. In this embodiment, since the guide camera and the needle box are located on two mutually perpendicular axes, when the first distance deviation does not meet the first deviation condition, the first distance deviation can be quickly reduced by controlling the movement of the guide camera on the Y-axis and / or by controlling the movement of the needle box on the X-axis.
[0070] In practice, the guide camera and the needle setter can also be located on two axes that are not perpendicular to each other. However, in this case, the number of operations required to reduce the first distance deviation is usually greater than the number of operations required when the guide camera and the needle setter are located on two perpendicular axes.
[0071] In some embodiments, the calibration method for the needle and guide camera of the dispensing system provided in this application further includes:
[0072] If the first distance deviation does not meet the first deviation condition, the guide camera is controlled to move on the Y-axis, and / or the needle box is controlled to move on the X-axis, and after moving, the process returns to the step of acquiring an image of the front end center of the feature through the guide camera and subsequent steps.
[0073] Specifically, the movement of both the guide camera and the needle holder is controlled simultaneously based on the information included in the first distance deviation. For example, if the first distance deviation only includes the distance deviation on the X-axis, then it is only necessary to control the movement of the needle holder on the X-axis to reduce the first distance deviation; if the first distance deviation only includes the distance deviation on the Y-axis, then it is only necessary to control the movement of the guide camera on the Y-axis to reduce the first distance deviation; and if the first distance deviation includes both the distance deviation on the X-axis and the distance deviation on the Y-axis, then it is necessary to control both the movement of the needle holder on the X-axis and the movement of the guide camera on the Y-axis to reduce the first distance deviation. Since the steps of acquiring the first image and subsequent steps are returned after controlling the movement of the guide camera and / or the movement of the needle holder, the coordinates of the center of the field of view of the guide camera with a distance deviation less than the first deviation threshold can be determined by the acquired new first image. That is, the required first coordinate point can be obtained through the above steps.
[0074] In some embodiments, S22 includes:
[0075] B1. Obtain an image including the center of the tip of the needle using the aforementioned needle-mounted camera to obtain a second image.
[0076] Specifically, the center of the tip of the feature inside the needle box is positioned at the target position coordinates within the dispensing system, i.e., the needle box is positioned at the same position as when the guide camera acquires the first image. If the needle, which is on the same axis as the guide camera, is within the field of view of the needle box before the needle box performs the shooting action, the needle box is controlled to perform the shooting action to acquire the second image; if the needle is not within the field of view of the needle box at this time, the position of the needle is adjusted so that the needle is within the field of view of the needle box (e.g., so that the needle is directly above the needle box) before the shooting action is performed to acquire the second image.
[0077] B2. Based on the position of the tip center of the needle in the second image, the position of the tip center of the feature in the second image, and the preset second mapping relationship, determine the distance deviation between the tip center of the needle and the tip center of the feature in the actual scene, and obtain the second distance deviation. The second mapping relationship is used to record the mapping relationship between the pixel distance of the needle camera and the distance in the actual scene.
[0078] The second mapping relationship can be determined by calibrating the pin camera, which can be a 9-point calibration (or nine-grid calibration). When using the 9-point calibration method, the pin camera can be used to photograph objects or patterns at 9 positions. Based on the pixel positions of the objects or patterns at these 9 positions in the captured images and their positions in the actual scene, the mapping relationship between the distance between pixels in the captured images (i.e., pixel distance) and the distance in the actual scene can be determined.
[0079] Specifically, the pixel distance between the two front-end centers is calculated based on the positions of the front-end center of the feature and the front-end center of the needle in the second image. The distance deviation between the two front-end centers in the actual scene is then calculated based on the calculated pixel distance and the second mapping relationship.
[0080] B3. If the second distance deviation is less than the preset second deviation threshold, the coordinate point of the front end center of the current feature in the dispensing system is determined as the second coordinate point.
[0081] Specifically, when the second distance deviation is less than the second deviation threshold, the difference between the position of the tip center of the needle and the position of the tip center of the feature is small. In this case, the coordinate point where the tip center of the needle is located can be determined as the second coordinate point, or the coordinate point where the tip center of the feature is located can be determined as the second coordinate point.
[0082] In this embodiment, since no human error is added when performing the shooting action and calculating the distance deviation, the accuracy of the obtained second coordinate point is improved.
[0083] In some embodiments, the shape of the front end center of the feature is the same as the shape of the front end center of the needle, and the material of the feature is the same as the material of the needle.
[0084] In this embodiment, since the shape of the front end center of the feature is the same as the shape of the front end center of the needle (e.g., both are circular), it is beneficial to ensure the consistency between the front end center of the feature determined by the guide camera and the front end center of the needle determined by the needle-aligning camera. In addition, since the optimal shooting parameters corresponding to different materials are usually different, setting the material of the feature to be the same as the material of the needle is beneficial to ensure the consistency between the image effect captured by the guide camera and the image effect captured by the needle-aligning camera.
[0085] To more clearly describe the calibration method for the needle and guide camera of the dispensing system provided in the embodiments of this application, an application example is described below.
[0086] refer to Figure 3Assume the X-axis of the dispensing system is axis 31, the Y-axis is axis 11, and the Z-axis is axis 33. The needle-setting box 32 is on the X-axis, containing an opening for fixing a feature, and two needle-setting cameras. The guide camera 12 and the needle 13 are on the Y-axis. The needle-setting box 32 can move back and forth on the X-axis, and the guide camera 12 and the needle 13 can move left and right on the Y-axis.
[0087] (1) Perform 9-point calibration on the guide camera 12 to obtain the first mapping relationship.
[0088] (2) Perform 9-point calibration on the pin camera to obtain the second mapping relationship.
[0089] (3) Place the feature (such as the feature needle) in the hole of the needle box 32 and fix it. Check whether the feature is in the field of view of the two needle cameras and is clearly focused. If so, determine the position coordinates of the center of the front end of the feature as the target position coordinates.
[0090] (4) When the coordinates of the front center of the feature are the target coordinates, control the guide camera 12 to move along the Y-axis until the front center of the feature is within the field of view of the guide camera 12 and is in focus. The guide camera 12 takes a picture of the front center of the feature to obtain a first image. The processor analyzes the position of the front center of the feature in the first image and the position of the field of view center of the guide camera in the first image to determine the pixel distance between the front center of the feature and the field of view center in the first image. Based on the pixel distance and the first mapping relationship, the processor determines the distance deviation between the front center of the feature and the field of view center in the actual scene: ΔX = X_fov - X_feature; ΔY = Y_fov - Y_feature. Wherein, X_fov is the X-axis component of the position of the field of view center of the guide camera 12 in the actual scene, Y_fov is the Y-axis component of the position of the field of view center of the guide camera 12 in the actual scene, X_feature is the X-axis component of the position of the front center of the feature in the actual scene, and Y_feature is the Y-axis component of the position of the front center of the feature in the actual scene.
[0091] If the distance deviation is less than a preset first deviation threshold (assuming the first deviation threshold is 0.01 mm, and ΔX and ΔY are both within ±0.01 mm), then the current front-end center of the feature coincides with the field of view center of the guide camera 12. The coordinate point of the current front-end center of the feature in the dispensing system is then determined as the first coordinate point, assuming it is P1. Of course, if the distance deviation is not less than the preset first deviation threshold, then the guide camera 12 and the needle holder 32 are controlled to incline by ΔY and ΔX respectively at their current positions until the distance deviation obtained after inclining is less than the preset first deviation threshold.
[0092] It should be noted that if the condition that "the front center of the feature is within the field of view of the guide camera 12 and is clearly focused" is still not met after the guide camera 12 is moved on the Y-axis, the Z-axis can also be moved to reduce the distance between the guide camera 12 on the Y-axis and the alignment camera on the X-axis on the Z-axis.
[0093] (5) With the position coordinates of the front center of the feature object as the target position coordinates, control the needle 13 to move on the Y-axis until the front center of the needle 13 is within the field of view of the needle-aligning camera and is in focus. The needle-aligning camera takes a picture of the front center of the needle 13 to obtain a second image. The processor analyzes the position of the front center of the feature object in the second image and the position of the front center of the needle 13 in the second image to determine the pixel distance between the front center of the feature object and the front center of the needle 13 in the second image. Based on the pixel distance and the second mapping relationship, the distance deviation between the front center of the feature object and the front center of the needle 13 in the actual scene is determined: ΔX'=X_feature - X_needle; ΔY'=Y_feature - Y_needle; ΔZ'=Z_feature - Z_needle. Wherein, X_feature is the component of the position of the front end center of the feature object on the X-axis in the actual scene, Y_feature is the component of the position of the front end center of the feature object on the Y-axis in the actual scene, Z_feature is the component of the position of the front end center of the feature object on the Z-axis in the actual scene, and X_needle, Y_needle, and Z_needle are the components of the position of the front end center of needle 13 on the X-axis, Y-axis, and Z-axis in the actual scene, respectively.
[0094] If the distance deviation is less than the preset second deviation threshold (assuming the second deviation threshold is 0.01 mm, and ΔX', ΔY', and ΔZ' are all within ±0.01 mm), that is, the current front-end center of the feature coincides with the tip of the needle 13, then the coordinate point of the current front-end center of the feature in the dispensing system is determined as the second coordinate point, assuming it is P2. Of course, if the distance deviation is not less than the preset second deviation threshold, then the needle 13 and the needle holder 32 are controlled to inch ΔY' and ΔX' respectively at the current position, and the Z-axis is controlled to move ΔZ', until the distance deviation obtained after inching is less than the preset first deviation threshold.
[0095] (6) Calculate the difference between the two coordinate points P1 and P2, that is, the distance from the needle 13 to the center of the field of view of the guide camera 12: ΔX”=X_P2-X_P1;ΔY”=Y_P2-Y_P1;ΔZ”=Z_P2-Z_P1.
[0096] Example 3:
[0097] Corresponding to the calibration method for the needle and guide camera of the dispensing system described in the embodiments above, Figure 4The diagram shows a structural block diagram of the needle and the calibration device for the guide camera of the dispensing system provided in the embodiments of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0098] Reference Figure 4 The calibration device 4 for the needle and guide camera of the dispensing system can be applied to the processor of the dispensing system, including: a first coordinate point determination module 41, a second coordinate point determination module 42, and a distance determination module 43. Wherein:
[0099] The first coordinate point determination module 41 is used to determine the coordinate point of the current front end center of the preset feature in the above-mentioned dispensing system when the distance deviation from the center of the field of view of the guide camera is less than the preset first deviation threshold, thereby obtaining the first coordinate point. The initial position of the front end center of the preset feature is determined according to the preset target position coordinates.
[0100] The preset feature is an object selected by the user to help determine the distance between the guide camera and the needle. For example, the preset feature can be an object whose material, length, shape, etc. are the same as or similar to the needle.
[0101] The initial position of the front end center of the preset feature is determined according to the preset target position coordinates.
[0102] In some embodiments, the unit of the first deviation threshold is millimeters, which is set according to the actual required accuracy. For example, when the actual required accuracy is 0.01 millimeters, the first deviation threshold can be set to 0.01 millimeters.
[0103] The second coordinate point determination module 42 is used to determine the coordinate point of the current front end center of the feature in the dispensing system when the distance deviation from the front end center of the needle is less than a preset second deviation threshold, and obtain the second coordinate point, wherein the initial position of the preset front end center of the feature is determined according to the target position coordinates.
[0104] In some embodiments, the second deviation threshold is set according to the actual required accuracy. For example, when the actual required accuracy is 0.01 mm, the second deviation threshold can be set to 0.01 mm.
[0105] The distance determination module 43 is used to determine the distance between the guide camera and the needle based on the first coordinate point and the second coordinate point.
[0106] In this embodiment, the first coordinate point is the coordinate point of the center of the field of view of the guiding camera in the dispensing system when the distance deviation between the center of the front end of the pre-set feature is less than a preset first deviation threshold, and the second coordinate point is the coordinate point of the center of the front end of the needle in the dispensing system when the distance deviation between the center of the front end of the needle and the center of the front end of the pre-set feature is less than a preset second deviation threshold. Therefore, the first and second coordinate points can respectively reflect the positions of the center of the field of view of the guiding camera and the center of the front end of the needle in the dispensing system. At the same time, since the determination of the first and second coordinate points is related to the initial position of the center of the front end of the feature, and the initial position of the center of the front end of the feature is determined according to the preset target position coordinates, that is, the determination of the first and second coordinate points is based on the same position information, the accuracy of the determined distance can be guaranteed when the distance between the guiding camera and the needle is determined according to the first and second coordinate points. Furthermore, since it is not necessary to determine the coordinates of the guide camera and the needle separately when determining the distance between the guide camera and the needle, and no human operation is required, i.e. no human error is introduced, the accuracy of the determined distance can be further guaranteed, i.e. the accuracy of the calibration of the field of view center of the needle and the guide camera can be guaranteed.
[0107] In some embodiments, the needle of the dispensing system and the calibration device 4 for guiding the camera may further include:
[0108] The dispensing module, after determining the distance between the guide camera and the needle (assuming it is the target distance), if it receives a dispensing instruction, it parses the position information to be dispensed from the dispensing instruction, analyzes the image captured by the guide camera, parses the physical position points corresponding to the pixels in the image, calculates the matching position point based on the physical position point and the target distance, and if the matching position point is the same as the position information to be dispensed, it controls the needle to dispense glue to complete the dispensing operation of the needle.
[0109] In some embodiments, the dispensing system further includes a needle alignment box, in which a needle alignment camera is disposed, and the calibration device 4 for the needle tip and the guide camera of the dispensing system further includes:
[0110] The target position coordinate determination module is used to determine the position coordinates of the front end center of the feature object that meets the preset positioning conditions in the dispensing system as the target position coordinates, wherein the preset positioning conditions include: the feature object is within the field of view of the needle-aligning camera.
[0111] In some embodiments, the first coordinate point determination module 41 includes:
[0112] The first image acquisition unit is used to acquire an image including the front center of the feature object through the guide camera when the feature object is within the field of view of the pin camera, thereby obtaining a first image.
[0113] The first distance deviation determination unit is used to determine the distance deviation between the front end center of the feature and the field of view center of the guide camera in the actual scene based on the position of the front end center of the feature in the first image, the field of view center of the guide camera, and a preset first mapping relationship, thereby obtaining the first distance deviation. The first mapping relationship is used to record the mapping relationship between the pixel distance of the guide camera and the distance in the actual scene.
[0114] The first coordinate point acquisition unit is used to determine the coordinate point of the current front end center of the feature in the dispensing system as the first coordinate point when the first distance deviation is less than the preset first deviation threshold.
[0115] In some embodiments, the guide camera and the needle are on the Y-axis of the coordinate system in which the dispensing system is located, and the needle box is on the X-axis of the coordinate system in which the dispensing system is located.
[0116] In some embodiments, the calibration device 4 for the needle and guide camera of the dispensing system provided in this application further includes:
[0117] The inching module is used to control the guide camera to move on the Y-axis and / or control the needle box to move on the X-axis when the first distance deviation does not meet the first deviation condition, and to return to the step of acquiring an image of the front end center of the feature through the guide camera and subsequent steps after the movement.
[0118] In some embodiments, the second coordinate point determination module 42 includes:
[0119] The second image acquisition unit is used to acquire an image including the center of the tip of the needle through the needle-aligning camera to obtain a second image.
[0120] The second distance deviation determination unit is used to determine the distance deviation between the front end center of the needle and the front end center of the feature in the actual scene based on the position of the front end center of the needle in the second image, the position of the front end center of the feature in the second image, and a preset second mapping relationship, thereby obtaining a second distance deviation. The second mapping relationship is used to record the mapping relationship between the pixel distance of the needle-aligning camera and the distance in the actual scene.
[0121] The second coordinate point acquisition unit is used to determine the coordinate point of the front end center of the feature in the dispensing system as the second coordinate point when the second distance deviation is less than the preset second deviation threshold.
[0122] In some embodiments, the shape of the front end center of the feature is the same as the shape of the front end center of the needle, and the material of the feature is the same as the material of the needle.
[0123] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0124] Example 4:
[0125] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 5 of this embodiment includes: at least one processor 50 ( Figure 5 The diagram shows only one processor, a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, which, when executed, performs the steps of any of the above method embodiments.
[0126] The electronic device 5 can be a desktop computer, laptop, handheld computer, or cloud server, etc. This electronic device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will understand that... Figure 5 This is merely an example of electronic device 5 and does not constitute a limitation on electronic device 5. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0127] The processor 50 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0128] In some embodiments, the memory 51 may be an internal storage unit of the electronic device 5, such as a hard disk or memory of the electronic device 5. In other embodiments, the memory 51 may be an external storage device of the electronic device 5, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 5. Furthermore, the memory 51 may include both internal and external storage units of the electronic device 5. The memory 51 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 51 can also be used to temporarily store data that has been output or will be output.
[0129] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0130] This application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the steps in any of the above method embodiments.
[0131] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0132] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0133] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0134] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0135] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0136] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0138] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A calibration method for the needle and guide camera of a dispensing system, characterized in that, The method comprises the following steps: When a distance deviation between a field center of a guide camera and a front end center of a preset feature object meets a preset first deviation condition, a coordinate point of the field center of the guide camera in a coordinate system of the dispensing system is determined, to obtain a first coordinate point, wherein an initial position of the front end center of the preset feature object is determined according to a preset target position coordinate, and the distance deviation is a difference value of the respective coordinates of the two object points; When a distance deviation between the front end center of the feature object and a front end center of the needle meets a preset second deviation condition, a coordinate point of the current front end center of the needle in the coordinate system of the dispensing system is determined, to obtain a second coordinate point; The distance between the guide camera and the needle is determined according to the first coordinate point and the second coordinate point.
2. The method of claim 1, wherein the method further comprises: The dispensing system further comprises a needle box, and a needle camera is arranged in the needle box. The position coordinate of the front end center of the feature object meeting the preset positioning condition in the dispensing system is determined as the target position coordinate, wherein the preset positioning condition comprises that the feature object is in the field of view of the needle camera.
3. The method of claim 2, wherein the method further comprises: The method further comprises the following steps: When the feature object is in the field of view of the needle camera, an image including the front end center of the feature object is acquired by the guide camera, to obtain a first image; According to the position of the front end center of the feature object in the first image, the field center of the guide camera and a preset first mapping relationship, a distance deviation between the front end center of the feature object and the field center of the guide camera in an actual scene is determined, to obtain a first distance deviation, wherein the first mapping relationship is used to record a mapping relationship between a pixel distance of the guide camera and a distance in the actual scene; When the first distance deviation is less than the preset first deviation threshold, the coordinate point of the field center of the guide camera in the dispensing system is determined as the first coordinate point.
4. The method of claim 3, wherein the method further comprises: The guide camera and the needle are on a Y-axis of a coordinate system in which the dispensing system is located, and the needle box is on an X-axis of the coordinate system in which the dispensing system is located.
5. The method of claim 4, wherein the method further comprises: The method further comprises the following steps: When the first distance deviation does not meet the first deviation condition, the guide camera is controlled to move on the Y-axis, and / or the needle box is controlled to move on the X-axis, and after the movement, the step of acquiring the image including the front end center of the feature object by the guide camera and subsequent steps are returned to.
6. The method of claim 2, wherein the method further comprises: The method further comprises the following steps: An image including the front end center of the needle is acquired by the needle camera, to obtain a second image; According to a position of the front end center of the needle in the second image, a position of the front end center of the feature in the second image, and a preset second mapping relationship, a distance deviation between the front end center of the needle and the front end center of the feature in an actual scene is determined, to obtain a second distance deviation, wherein the second mapping relationship is used to record a mapping relationship between a pixel distance of the guide camera and a distance in the actual scene. In a case where the second distance deviation is less than a preset second deviation threshold, the current front end center of the needle in the coordinate point of the point gluing system is determined as the second coordinate point.
7. The method of claim 1 to 6, wherein, The shape of the front end center of the feature is the same as the shape of the front end center of the needle, and the material of the feature is the same as the material of the needle.
8. A calibration device for a needle of a dispensing system and a guide camera, characterized in that, Comprise: A first coordinate point determination module is configured to determine a coordinate point of a guide camera in a point gluing system as a first coordinate point when a distance deviation between a field center of the guide camera and a preset front end center of a feature meets a preset first deviation condition, wherein an initial position of the preset front end center of the feature is determined according to a preset target position coordinate, and the distance deviation is a difference between the two object points. A second coordinate point determination module is configured to determine a coordinate point of a current front end center of a needle in the point gluing system as a second coordinate point when a distance deviation between the front end center of the feature and the front end center of the needle meets a preset second deviation condition. A distance determination module is configured to determine a distance between the guide camera and the needle according to the first coordinate point and the second coordinate point.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method of any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Method for obtaining reference coordinates of dispensing pinhead, correction method and correction device
CN110538765A
Dispenser needle alignment calibration control method based on machine vision
CN111687002A