Dispensing system and visual positioning method, control method and control device thereof
By unifying the calibration parameters and linear interpolation algorithm at the reference height, the problem of decreased positioning accuracy caused by height changes in precision dispensing systems is solved, achieving flexible and accurate dispensing positioning and reducing system complexity and cost.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN ZMOTION TECH CO LTD
- Filing Date
- 2026-05-07
- Publication Date
- 2026-06-02
AI Technical Summary
Existing precision dispensing systems suffer from perspective projection errors due to variations in product height, leading to decreased positioning accuracy. Existing solutions are either inefficient or increase system complexity and cost.
By obtaining image correction parameters at a reference height, images at different reference heights are uniformly corrected, establishing a coordinate mapping relationship between pixel space and mechanical space. A linear interpolation algorithm is used to calculate the mechanical coordinates at the dispensing height, reducing redundant calibration and reliance on external sensors.
It enables flexible and precise positioning on uneven or inconsistent product surfaces, reduces system complexity and cost, and improves the adaptability and positioning accuracy of the dispensing system.
Smart Images

Figure CN122134813A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of dispensing positioning, and in particular to a dispensing system and its visual positioning method, control method, and control device. Background Technology
[0002] In precision dispensing systems, machine vision is typically used to locate the dispensing position on PCBs, electronic components, and other products. This is achieved by converting image pixel coordinates into mechanical coordinates. Currently, the mainstream method is to calibrate the camera at a fixed working height in one go, obtaining a transformation matrix from two-dimensional pixel coordinates to two-dimensional mechanical coordinates.
[0003] However, when the actual height of the product differs from the calibration reference plane, such as due to uneven product surfaces, thickness differences between different types of products, or tilted placement, the accuracy of this method will decrease. Since camera imaging follows the principle of perspective projection, changes in height will cause non-linear changes in the imaging scale and position. Continuing to use a single calibration matrix will introduce perspective projection errors, leading to positioning deviations and consequently, process defects such as dispensing position offsets, excess adhesive, or adhesive leakage.
[0004] To address this issue, existing technologies mainly offer two solutions: one is to calibrate products of different heights separately, but this method is inefficient and inflexible, and cannot adapt to scenarios with continuously changing heights; the other is to introduce devices such as laser sensors to measure the height in real time, and then compensate through three-dimensional coordinate transformation, which can improve accuracy but increases system complexity and cost. Summary of the Invention The main objective of this application is to provide a dispensing system and its visual positioning method, control method, and control device, which aims to solve the technical problem that existing visual dispensing systems based on single-plane calibration suffer from perspective projection errors caused by changes in product height, resulting in decreased positioning accuracy.
[0005] To achieve the above objectives, this application proposes a visual positioning method for a dispensing system, comprising: Obtain image correction parameters at a reference height, and use the image correction parameters to perform uniform correction processing on images acquired at at least two different reference heights; Establish the coordinate mapping relationship between pixel space and mechanical space under different reference heights after correction, and obtain the first transformation matrix and the second transformation matrix; A target image of the height to be dispensed is obtained, the target pixel coordinates of the target to be dispensed are extracted from the target image, the target pixel coordinates are transformed using the first transformation matrix and the second transformation matrix respectively, and the mechanical coordinates of the target to be dispensed at the height to be dispensed are calculated by combining the ratio of the height to be dispensed to the reference height.
[0006] In one embodiment, the specific steps for obtaining the image correction parameters at the reference height include: A reference image is acquired at a first reference height, and distortion calibration is performed on the reference image to obtain image correction parameters; wherein, the image correction parameters include radial distortion correction parameters and perspective distortion correction parameters.
[0007] In one embodiment, the specific steps of establishing the coordinate mapping relationship between the pixel space and the mechanical space at different corrected reference heights to obtain the first transformation matrix and the second transformation matrix include: Calibration images are acquired at a first reference height and a second reference height, respectively. The acquired calibration images are then processed to remove distortion using the image correction parameters. The pixel coordinates of feature points are then extracted from the corrected calibration images. Obtain the mechanical coordinates of the corresponding feature points fed back by the robotic arm; The transformation relationship between pixel coordinates and mechanical coordinates under the first and second reference heights is established by using the n-point calibration method, thus obtaining the first height transformation matrix and the second height transformation matrix.
[0008] In one embodiment, both the first transformation matrix and the second transformation matrix are perspective transformation matrices, and n in the n-point calibration is not less than 4.
[0009] In one embodiment, the specific steps of obtaining the target image of the height to be dispensed and extracting the target pixel coordinates of the target to be dispensed from the target image include: At the desired dispensing height, acquire an original image containing the target object to be dispensed; The image correction parameters are called to perform distortion correction on the original image to generate a corrected target image, and the target pixel coordinates of the target to be glued are extracted from the target image.
[0010] In one embodiment, the specific steps of transforming the target pixel coordinates to projected mechanical coordinates at the corresponding reference height using the first transformation matrix and the second transformation matrix, and interpolating the projected mechanical coordinates using the linear proportional relationship between the adhesive dispensing height and the reference height to calculate the mechanical coordinates of the target to be dispensed at the adhesive dispensing height include: The target pixel coordinates are mapped to a plane at a first reference height using the first transformation matrix to obtain the first mechanical coordinates; The target pixel coordinates are mapped to a plane at a second reference height using the second transformation matrix to obtain the second mechanical coordinates; By utilizing the linear positional relationship between the height to be dispensed and the first reference height and the second reference height, linear interpolation is performed on the first and second mechanical coordinates to calculate the mechanical coordinates of the target to be dispensed at the height to be dispensed.
[0011] In one embodiment, the linear interpolation satisfies the following relationship: , ; Where z1 is the first reference height, z 2 is the second reference height, z is the height to be dispensed, ( x 1 ,y 1) represents the first projected mechanical coordinates, ( x 2 ,y 2) represents the second projected mechanical coordinates. x, y () represents the mechanical coordinates of the target to be dispensed at height z.
[0012] Furthermore, to achieve the above objectives, this application also proposes a control method, comprising: In response to a dispensing task request, obtain the current working height of the surface of the product to be dispensed; Call the visual positioning method for the dispensing system as described above to obtain the mechanical world coordinates of the target to be dispensed at the current working height; Based on the mechanical world coordinates and the current working height, control the mechanical actuator of the dispensing system to move to the target spatial position; After reaching the target spatial position, the dispensing valve is opened to perform the dispensing action.
[0013] In addition, to achieve the above objectives, this application also proposes a control device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the control method as described above.
[0014] In addition, to achieve the above objectives, this application also proposes a dispensing system, including the control device as described above, as well as a camera, a dispensing valve, and a mechanical actuator for driving the dispensing valve to move in three-dimensional space.
[0015] One or more technical solutions proposed in this application have at least the following technical effects: This application ensures the consistency of the visual data source benchmark through unified image distortion correction processing. By acquiring and applying the same set of distortion correction parameters at a reference height, it eliminates the systematic impact of camera lens distortion on images at different heights, avoiding additional errors that may be introduced by layered or independent correction. Furthermore, this application only requires the coordinate transformation matrices of two reference height planes to quickly and accurately calculate the coordinate mapping relationship of any intermediate height plane using a linear interpolation algorithm. This reduces reliance on numerous repetitive calibrations and eliminates the need for complex hardware such as laser sensors. While reducing system complexity and cost, it effectively compensates for perspective projection errors caused by height variations, enabling the system to flexibly and accurately handle actual situations such as uneven product surfaces or inconsistent heights. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic flowchart of an embodiment of a visual positioning method for a dispensing system according to this application; Figure 2 This is a flowchart illustrating a third embodiment of a visual positioning method for a dispensing system according to this application. Figure 3 This is a flowchart illustrating Embodiment 4 of a visual positioning method for a dispensing system provided in this application; Figure 4 This is a flowchart illustrating a dispensing control method according to Embodiment 5 of this application.
[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0022] In the visual positioning stage of a precision dispensing system, the core task is to accurately map the pixel coordinates of the image captured by the camera to the physical coordinate system of the actuator, such as a robotic arm. The currently widely adopted technique is the "single-plane calibration method," which calculates a fixed transformation matrix on a predetermined reference height plane using a specific calibration plate or feature points. This matrix establishes a one-to-one mapping between pixels on that specific plane and machine coordinate points.
[0023] However, the effectiveness of this method heavily relies on one premise: the surfaces of all products to be dispensed must be strictly aligned with the same height plane as calibrated. This is fundamentally because camera imaging follows the principle of perspective projection; the position and size of an object in the image change non-linearly with the distance between it and the camera lens. When the actual product surface deviates from the calibration plane due to uneven thickness, tilted placement, or batch variations, the linear or quasi-linear mapping relationship based on a single plane becomes inaccurate. This geometric distortion in imaging caused by changes in viewing distance is called perspective projection error. It directly causes systematic deviations in the mechanical coordinates calculated by the vision system, ultimately manifesting as dispensing position offset or inaccurate dispensing volume control.
[0024] To address the aforementioned high sensitivity issue, the industry typically employs two solutions. The first is the "multiple calibration method," which involves calibrating each possible height individually and saving the corresponding transformation matrix. While this method ensures accuracy at discrete height points, the calibration workload becomes extremely heavy when dealing with continuously varying curved surfaces or numerous products of different specifications, and it lacks flexibility in handling unknown heights. The second method is the "sensor-assisted method," which integrates additional equipment such as laser displacement sensors to measure the product's surface height in real time, and then combines this with camera calibration parameters to calculate the three-dimensional spatial coordinates. This method offers high accuracy and can adapt to continuous height variations, but it undoubtedly increases the system's hardware complexity, cost, and the difficulty of calibration and maintenance for multi-sensor data fusion.
[0025] To address the aforementioned shortcomings, this application proposes a visual positioning method for dispensing systems, such as... Figure 1 As shown, it includes: S10: Obtain image correction parameters at the reference height, and use the image correction parameters to perform unified correction processing on images acquired at at least two different reference heights; S20: Establish the coordinate mapping relationship between the pixel space and the mechanical space under different reference heights after correction, and obtain the first transformation matrix and the second transformation matrix; S30: Obtain the target image of the height to be glued, extract the target pixel coordinates of the target to be glued from the target image, use the first transformation matrix and the second transformation matrix to transform the target pixel coordinates to the projected mechanical coordinates under the corresponding reference height, and use the linear proportional relationship between the height to be glued and the reference height to perform interpolation operation on the projected mechanical coordinates to calculate the mechanical coordinates of the target to be glued at the height to be glued.
[0026] This application ensures the consistency of the visual data source benchmark through unified image distortion correction processing. By acquiring and applying the same set of distortion correction parameters at a reference height, it eliminates the systematic impact of camera lens distortion on images at different heights, avoiding additional errors that may be introduced by layered or independent correction. Furthermore, this application only requires the coordinate transformation matrices of two reference height planes to quickly and accurately calculate the coordinate mapping relationship of any intermediate height plane using a linear interpolation algorithm. This reduces reliance on numerous repetitive calibrations and eliminates the need for complex hardware such as laser sensors. While reducing system complexity and cost, it effectively compensates for perspective projection errors caused by height variations, enabling the system to flexibly and accurately handle actual situations such as uneven product surfaces or inconsistent heights.
[0027] Example 1 This embodiment provides a visual positioning method for a dispensing system, suitable for mechanical coordinate positioning of the dispensing target when the height of the product surface varies. The method includes steps S10-S30.
[0028] In step S10, a calibration plate or a preset feature structure is placed at a preset reference height position, and a calibration image at the reference height is acquired by a camera. Based on the acquired calibration image, a camera calibration algorithm is used to calculate camera intrinsic parameters and lens distortion parameters to obtain image correction parameters for distortion correction. Camera intrinsic parameters include parameters such as focal length and principal point coordinates, and distortion parameters include radial distortion parameters and tangential distortion parameters. After obtaining the image correction parameters, images to be calibrated are acquired at different reference height positions. The original images acquired at each reference height are input into a preset image correction module. Using the unified image correction parameters calculated at the reference height, distortion correction processing is performed on the images acquired at different reference heights, and the corrected image is output. The above correction processing uniformly eliminates distortion components in images at different heights, ensuring that the subsequent establishment of the mapping relationship between pixel coordinates and mechanical coordinates on different height planes is based on a unified imaging model.
[0029] By performing camera distortion calibration only once at the reference height throughout the entire system through step S10, uniform image correction parameters applicable to images at different heights can be obtained. This step reduces the need for repeated calibration at multiple heights, avoids parameter inconsistencies that may be introduced by separate calibrations at different heights, reduces system calibration complexity, and improves the comparability and consistency between images at different heights.
[0030] In step S20, a first reference height and plane position are selected as reference height one. A calibration plate or a preset feature point structure is placed at this height position, and an image of reference height one after correction in step S10 is acquired. The pixel coordinates of the calibration plate or feature structure in the image are detected manually or automatically, and the corresponding actual coordinates in the mechanical coordinate system are obtained. Based on multiple sets of corresponding pixel coordinates and mechanical coordinates, a fitting algorithm, such as a least-squares homography matrix solving algorithm, is used to establish the coordinate mapping relationship from pixel space to mechanical space on the reference height one plane, and the first transformation matrix is obtained. The first transformation matrix is used to map any set of pixel coordinates to mechanical coordinates on the reference height one plane.
[0031] Similarly, a second reference height and plane position are selected as reference height two. A calibration plate or a preset feature point structure is placed at this height position, and an image of reference height two after correction in step S10 is acquired. By detecting the pixel coordinates corresponding to the calibration plate or feature structure and obtaining the corresponding mechanical coordinates, the same algorithm as for reference height one is used to establish the coordinate mapping relationship between the pixel space and the mechanical space on the plane of reference height two, and the second transformation matrix is obtained. The second transformation matrix is used to map the pixel coordinates to mechanical coordinates on the plane of reference height two.
[0032] In step S20, under the same camera intrinsic parameters and distortion model conditions, transformation matrices between pixel space and mechanical space are established on two different reference height planes. These two transformation matrices represent the relationship between the same pixel coordinates and mechanical coordinates on different height planes, allowing subsequent calculations of mechanical coordinates at unknown heights to be performed through interpolation based on these matrices and the height ratio. This step only requires calibration on two height planes, reducing the number of calibrations and workload compared to calibrating multiple height planes one by one, while retaining the ability to respond to height changes.
[0033] In step S30, the product to be dispensed is placed at a predetermined dispensing height, and the camera is controlled to acquire a target image at that height. This target image is then input into the image correction module, where the unified image correction parameters obtained in step S10 are used to correct distortion, resulting in a corrected target image. In the corrected target image, the pixel coordinates of the target to be dispensed are extracted using feature recognition, template matching, or other image processing algorithms and recorded as the target pixel coordinates.
[0034] By inputting the target pixel coordinates into the first transformation matrix and the second transformation matrix, respectively, the mechanical coordinates of the target pixel on the first reference height plane and the mechanical coordinates on the second reference height plane are obtained. Specifically, matrix operations are performed on the target pixel coordinates using the first transformation matrix to calculate the corresponding mechanical coordinates on the first plane; matrix operations are then performed on the target pixel coordinates using the second transformation matrix to calculate the corresponding mechanical coordinates on the second plane. These two mechanical coordinates reflect the calculated mechanical position of the target pixel at different reference heights.
[0035] Based on the height relationship between the height to be dispensed and reference heights one and two, the positional ratio of the height to be dispensed between reference heights one and two is calculated. The mechanical coordinates corresponding to reference heights one and two are then interpolated using this ratio to obtain the mechanical coordinates of the target pixel at the height to be dispensed. Specifically, when the height to be dispensed is between reference heights one and two, linear interpolation can be used to interpolate each component of the two sets of mechanical coordinates according to the height ratio to obtain the target mechanical coordinates at the corresponding height to be dispensed. When the height to be dispensed coincides with either reference height one or reference height two, the mechanical coordinates output by the transformation matrix of the corresponding reference height can be directly used.
[0036] Through step S30, the mechanical coordinates of the target to be dispensed on the unknown intermediate height plane can be calculated from the transformation matrix and height ratio relationship on two known reference height planes, without the need for a separate complete calibration on the intermediate height plane. This step combines the mapping relationship and height ratio on multiple reference planes to compensate for the perspective projection difference caused by height changes, enabling the system to correct the dispensing position for different product thicknesses, different clamping heights, and slight height changes, thereby improving dispensing positioning accuracy.
[0037] This embodiment, through a combination of steps S10, S20, and S30, solves the pixel-to-mechanical coordinate mapping relationship on any intermediate height plane by interpolation, using only two reference height coordinate transformation matrices, with only one distortion calibration performed on the camera. Compared to calibrating each height individually, this embodiment reduces the number of calibrations and operational complexity; compared to relying on external height sensors, this embodiment achieves height variation compensation without adding extra hardware. Overall, it meets the requirements of visual positioning accuracy and adaptability of the dispensing system under conditions of inconsistent product surface height.
[0038] Example 2 This embodiment provides a more detailed implementation process for step S10, which involves obtaining the image correction parameters at the reference height. The specific steps for step S10, obtaining the image correction parameters at the reference height, include: Within the working space of the dispensing system, the lowest height of the product's working space is predetermined as the reference plane height z1. The camera to be calibrated is fixedly installed at a predetermined position on the dispensing system, maintaining a stable camera posture. A calibration plate or preset calibration pattern is placed at the reference plane height z1, ensuring that the calibration plate or pattern is within the camera's field of view and has a fixed spatial relationship with the mechanical coordinate system of the dispensing system. The camera is controlled to acquire multiple reference images at this height. The reference images contain complete calibration pattern information and cover the actual working field of view of the camera. To improve calibration accuracy, multiple calibration pattern images from different angles and at different translation positions can be acquired at the same height z1, ensuring that the distribution of calibration feature points in the image plane has a certain range and diversity. Through the above operations, reference image data at the reference plane height z1 is obtained, providing input for subsequent camera distortion calibration.
[0039] The above-mentioned reference height z1 is set as the lowest height within the product's working space range and is selected as the commonly used dispensing height. This ensures that the height deviation within the commonly used working height range is relatively symmetrical, making it convenient to use this height as a unified distortion calibration reference plane and reducing the impact of height changes on imaging geometry.
[0040] After obtaining multiple frames of reference images at a reference height z1, the acquired reference images are input into the camera calibration module. The camera calibration module extracts feature points from the calibration pattern in the reference images. Depending on the type of calibration board used, it automatically or semi-automatically detects and labels the pixel coordinates of corner points, center points, or other feature points on the calibration board, and correlates them with the actual geometric dimensions and layout of the calibration board in space. Based on the correspondence between the spatial coordinates of the calibration board and the pixel coordinates in the image plane, the camera calibration module solves for the camera's intrinsic parameters and distortion parameters using a nonlinear optimization algorithm. Intrinsic parameters include focal length parameters and principal point coordinate parameters, while distortion parameters include radial distortion parameters and perspective distortion-related parameters.
[0041] The radial distortion correction parameter describes the degree of radial deformation produced by the camera lens during imaging and is used to correct radial offsets in the image caused by lens aberrations. The perspective distortion correction parameter describes the imaging offset and scale changes caused by perspective projection under the current imaging geometry and is used for geometric correction in subsequent image processing.
[0042] Through the above calibration calculations, a set of image correction parameters, `param`, is obtained. These parameters include at least radial distortion correction parameters and perspective distortion correction parameters, used to perform uniform distortion correction on images acquired by the camera at a reference height `z1` and other heights. Using the image at the reference height `z1` for uniform calibration during the above calibration process allows for the acquisition of complete distortion parameters in one step after camera installation. Subsequently, when the system acquires images at different heights, this set of parameters can be directly called to perform distortion correction, eliminating the need to repeat camera distortion calibration at each height.
[0043] By performing a complete camera distortion calibration at a reference height z1, image correction parameters param, including radial distortion correction parameters and perspective distortion correction parameters, are obtained. The dispensing system can then perform distortion correction based on the same set of parameters when acquiring images at multiple heights. This method maintains a uniform camera imaging model across the entire working height range, ensuring consistent geometric characteristics in the corrected images at different heights. This process reduces the need for repeated calibration at multiple heights, lowering the workload and implementation cost of camera calibration. Furthermore, since the same set of correction parameters is used for images at all heights, it avoids parameter differences that may arise from separate calibrations at different heights, reducing systemic errors introduced by calibration inconsistencies.
[0044] In subsequent steps, when establishing the mapping relationship between pixel coordinates and mechanical coordinates at different reference heights, the input images have all been corrected using a unified image correction parameter `param`, which helps improve the stability and accuracy of the coordinate mapping matrix. Combined with the transformation matrix of the two reference heights and height ratio interpolation operations, stable mechanical coordinate solutions can be achieved over a wider height range, improving the positioning accuracy and repeatability of the dispensing system under varying height conditions.
[0045] Example 3 This embodiment provides specific implementation steps for step S20, which involves establishing the coordinate mapping relationship between the pixel space and mechanical space at different corrected reference heights to obtain the first transformation matrix and the second transformation matrix. The specific steps of step S20 are as follows: Figure 2 As shown, it includes steps S21 to S23.
[0046] S21: Acquire calibration images at the first reference height and the second reference height respectively, perform distortion correction processing on the acquired calibration images using image correction parameters, and extract the pixel coordinates of feature points from the corrected calibration images. S22: Obtain the mechanical coordinates of the corresponding feature points fed back by the robotic arm; S23: Establish the transformation relationship between pixel coordinates and mechanical coordinates at the first and second reference heights using the n-point calibration method, and obtain the first height transformation matrix and the second height transformation matrix.
[0047] This can be understood as follows: In step S21, two reference height planes are selected within the product's workspace to establish a mapping relationship between pixel space and mechanical space under different height planes. The lower reference height corresponds to the minimum height z1 of the product's workspace, and the upper reference height corresponds to the maximum height z2 of the product's workspace. The range between z1 and z2 covers the commonly used working height range of the dispensing system.
[0048] At the first reference height z1, a calibration plate or preset feature structure is placed in the area to be calibrated, and the camera is controlled to acquire at least one frame of calibration image. The calibration image covers the calibration feature points within the camera's field of view, ensuring that the feature points have a certain distribution range in the image plane. Subsequently, the same operation is performed at the second reference height z2, placing the calibration plate or feature structure at the corresponding height position and acquiring at least one frame of calibration image. The calibration images acquired at both heights are input into the image distortion correction module. Using the unified image correction parameter param obtained in step S10 of Embodiment 2, distortion correction processing is performed on the calibration image. The distortion correction process performs geometric transformation on the pixel coordinates in the calibration image according to the radial distortion correction parameter and perspective distortion correction parameter in param, and outputs the distorted calibration image.
[0049] In the calibration images at the first and second reference heights after distortion correction, corner point extraction, center detection, or other feature extraction algorithms are used to identify the positions of feature points on the calibration board and extract the pixel coordinates of each feature point in the image. The set of pixel coordinates for each feature point is recorded as the image input data for the subsequent n-point calibration. Through the above steps, the pixel coordinates of feature points after uniform distortion correction are obtained at the two reference heights z1 and z2. The same image correction parameter param is used to perform distortion correction processing on the calibration images at different heights, so that the pixel coordinates at both heights are based on a unified imaging model, reducing the model differences caused by individual distortion calibration at different heights, which is beneficial to improving the consistency of subsequent transformation matrix solutions.
[0050] In step S22, the feature points on the calibration plate or feature structure from step S21 are established to correspond with the mechanical coordinate system of the dispensing system. Specifically, during the calibration process at the first reference height z1 and the second reference height z2, the robot arm or dispensing platform is moved to the location of each feature point on the calibration plate. The actual coordinate values of each feature point in the mechanical coordinate system are read through the encoder, position feedback module, or motion control system of the mechanical system. During position acquisition, the robot arm can be moved point by point to each feature point on the calibration pattern, such as calibrating the intersection of a checkerboard pattern, and the X and Y coordinate values in the mechanical coordinate system are recorded at each position, along with the corresponding height Z as the current reference height z1 or z2. For the two height planes, a set of mechanical coordinates corresponding one-to-one with the feature points extracted from the image is obtained.
[0051] During data recording, the pixel coordinates of each feature point are associated with the corresponding mechanical coordinates using the same index or label, forming multiple sets of corresponding samples of pixel coordinates and mechanical coordinates. The sample set corresponding to the first reference height z1 is used to solve the first height transformation matrix, and the sample set corresponding to the second reference height z2 is used to solve the second height transformation matrix. Through step S22, the actual mechanical coordinates of the feature points at reference heights z1 and z2 are obtained, and a correspondence is established with the pixel coordinates obtained in step S21, providing input data for subsequent n-point calibration and perspective transformation matrix solving.
[0052] In step S23, the pixel coordinates and corresponding machine coordinate samples obtained in steps S21 and S22 are input into the n-point calibration module. The n-point calibration method is based on at least n pairs of pixel coordinates P. p With world coordinates P w To determine the correspondence between the two, solve for the planar perspective transformation matrix T, which minimizes the error between the pixel coordinates and world coordinates after the perspective transformation, satisfying the following: n is the number of feature points used for calibration. n is not less than 4. When n is greater than 4, the least squares method can be used to fit the redundant data.
[0053] For the first reference height z1, the perspective transformation matrix T1 is solved using the n-point calibration method, such that, under the perspective transformation relationship, the following is satisfied: Among them, P p1 P represents the pixel coordinates at the first reference height. w1 T1 represents the mechanical coordinates at the first reference height, and T1 is the first height transformation matrix. T1 is used to convert pixel coordinates to mechanical coordinates on the first reference height plane.
[0054] For the second reference height z2, the perspective transformation matrix T2 is also solved using the n-point calibration method, such that: Among them, P p2P represents the pixel coordinates at the second reference height. w2 T1 represents the mechanical coordinates at the second reference height, and T2 is the second height transformation matrix. T2 is used to convert pixel coordinates to mechanical coordinates on the second reference height plane.
[0055] The transformation matrices T1 and T2 mentioned above are both planar perspective transformation matrices, which are 3×3 matrices in homogeneous coordinate form. By jointly solving multiple sets of pixel coordinate and mechanical coordinate samples, T1 and T2 approximate the true perspective imaging mapping relationship in the least squares sense. In the n-point calibration method, n is not less than 4, which ensures that the equation system is solvable; when n is greater than 4, more feature point samples are used in the calibration process, which can improve the fitting accuracy and stability of the transformation matrix.
[0056] In the above solution process, the unified image correction parameter `param` obtained in step S1 is used to perform unified distortion correction on the calibration images acquired from the upper and lower layers, ensuring that the pixel coordinates involved in the n-point calibration are obtained under the same distortion correction model. This method unifies the pixel data to the same reference, avoiding parameter inconsistencies caused by performing distortion calibration on images at different heights separately, reducing errors caused by independent layer-by-layer correction, and improving the robustness of T1 and T2. Through step S23, the first transformation matrix T1 at the first reference height z1 and the second transformation matrix T2 at the second reference height z2 are obtained respectively. Both the first and second transformation matrices are perspective transformation matrices, used to map any pixel coordinates to be determined to the machine coordinate system on the corresponding height plane, providing a basis for subsequent calculation of the machine coordinates of the target point by interpolation at intermediate heights.
[0057] This embodiment, through steps S21 to S23, establishes perspective transformation relationships between pixel space and mechanical space at the upper and lower heights of the product's working space, under the premise of unified distortion correction parameters. Two sets of transformation matrices, T1 and T2, are obtained only through two n-point calibrations. This process ensures transformation accuracy while reducing the number of calibration height layers and calibration operations, facilitating the subsequent calculation of mechanical coordinates for any intermediate height plane based on height ratios. This improves the dispensing system's adaptability to height changes and its positioning accuracy.
[0058] Example 4 This embodiment provides specific implementation steps for acquiring the target image at the desired dispensing height, extracting the target pixel coordinates, and calculating the mechanical coordinates of the target based on the dual-height transformation matrix and height ratio. Embodiment four, as shown... Figure 3 As shown, this includes steps S31 to S34 and related imaging model descriptions.
[0059] S31: Acquire the original image containing the target to be dispensed at the desired dispensing height; S32: Call the image correction parameters to perform distortion correction on the original image, generate the corrected target image, and extract the target pixel coordinates of the target to be glued from the target image.
[0060] S33: Using the first transformation matrix, the target pixel coordinates are mapped to the plane of the first reference height to obtain the first machine coordinates; using the second transformation matrix, the target pixel coordinates are mapped to the plane of the second reference height to obtain the second machine coordinates; S34: Using the linear positional relationship between the height to be dispensed and the first reference height and the second reference height, linear interpolation is performed on the first and second mechanical coordinates to calculate the mechanical coordinates of the target to be dispensed at the height to be dispensed.
[0061] This can be understood as follows: In step S31, based on the process settings or tooling height configuration of the current dispensing task, the actual working height z of the product to be dispensed is determined, and the product is placed or positioned at the corresponding height. The camera is controlled to acquire original images within the working area corresponding to this height. The acquired original images cover the area to be dispensed, ensuring that all targets to be dispensed are within the camera's field of view. During image acquisition, the camera's mounting posture remains unchanged, and acquisition is completed under fixed exposure time, gain, and lighting conditions to ensure stable original image quality. The acquired original images serve as input data for subsequent distortion correction and target recognition.
[0062] In step S32, the original image acquired in step S31 is input into the image correction module, and the image correction parameters param obtained in step S10 of Embodiment 2 are called to perform distortion correction on the original image. The image correction parameters param include radial distortion correction parameters and perspective distortion correction parameters. The correction module performs geometric transformation on the pixel coordinates of the original image according to the parameters param and outputs the corrected target image. On the corrected target image, the target to be glued is located by a preset target recognition algorithm. Depending on the characteristics of different products, methods such as template matching, feature point detection, shape recognition, and threshold segmentation can be used to identify the center point or key point of the glue-to-be-applied point, glue-to-be-applied line, or glue-to-be-applied area. After successful identification, the corresponding pixel coordinates are extracted from the corrected image and marked as the target pixel coordinates (u,v) of the glue-to-be-applied target. For multiple glue-to-be-applied points, the same steps are performed sequentially to obtain multiple target pixel coordinates.
[0063] Through steps S31 and S32, a target image with uniform distortion correction is acquired at the dispensing height z, and the pixel coordinates corresponding to each dispensing position are extracted from it. Since all images are processed using the same correction parameter param, the image data at different heights maintain uniform distortion characteristics.
[0064] In step S33, the target pixel coordinates (u, v) obtained in step S32 are input into the first transformation matrix T1. The first transformation matrix T1 is the perspective transformation matrix between the pixel space and the mechanical space obtained by n-point calibration at the first reference height z1. Through matrix operations and normalization, the mechanical plane coordinates (x1, y1) at the first reference height plane z1 are obtained. Combined with the height value z1, the three-dimensional coordinates (x1, y1, z1) are obtained, which represent the mechanical world coordinates mapped from the pixel point (u, v) on the height z1 plane. Similarly, the same target pixel coordinates (u, v) are input into the second transformation matrix T2. The second transformation matrix T2 is the perspective transformation matrix obtained by n-point calibration at the second reference height z2. Through matrix operations and normalization, the mechanical plane coordinates (x2, y2) at the second reference height plane z2 are obtained. Combined with the height z2, the three-dimensional coordinates (x2, y2, z2) are obtained, which represent the mechanical world coordinates mapped from the pixel point (u, v) on the height z2 plane.
[0065] In step S33, for the same target pixel coordinates (u, v), the corresponding mechanical coordinates (x1, y1, z1) and (x2, y2, z2) are obtained on two reference height planes z1 and z2 respectively, providing endpoint data for the mechanical coordinate interpolation calculation at the intermediate height z.
[0066] In step S34, let the height to be dispensed be z, the first reference height be z1, and the second reference height be z2, with z located between z1 and z2. Based on the linear positional relationship of height z between z1 and z2, a height scaling factor can be defined: Based on this scaling factor, linear interpolation is performed on the first machine coordinates (x1, y1) and the second machine coordinates (x2, y2) to obtain the machine coordinates (x, y) of the target to be dispensed in the height z-plane. The interpolation relationship is as follows: , Where (x1, y1) are the projected mechanical coordinates at the first reference height z1, (x2, y2) are the projected mechanical coordinates at the second reference height z2, and (x, y) are the mechanical coordinates of the target to be dispensed at height z. Combining height z, the final three-dimensional mechanical world coordinates (x, y, z) of the target are obtained, which are used to drive the dispensing actuator.
[0067] When the dispensing height z is equal to z1, the interpolation coefficient α is 0, and (x, y) degenerates to (x1, y1). When z is equal to z2, α is 1, and (x, y) degenerates to (x2, y2). In both cases, the transformation result of the corresponding reference height plane can be directly used without interpolation. When dispensing at the intermediate layer of the product at height z, the image acquired at the intermediate layer is also distorted using the image correction parameter param obtained in step S10. The target pixel coordinates (u, v) are located on the distorted image, and the world coordinates are calculated using T1 and T2 for dispensing. The camera imaging model is set to a pinhole imaging model, and all images are distorted. Radial distortion and perspective distortion are eliminated or significantly suppressed, so the lens can be considered to be distortion-free imaging, and the relative relationship between the camera imaging optical axis and the working plane is fixed. Under this setting, the imaging of the product at different height layers conforms to the perspective projection relationship.
[0068] For the same physical point, its pixel coordinates in the image plane will change as its height changes. Conversely, for a fixed pixel coordinate (u, v), the world coordinates (x, y, z) calculated from it on different height planes will also be different. Taking a fixed pixel coordinate (u, v) as an example, in the camera coordinate system, it can be regarded as corresponding to a ray originating from the camera's optical center. This ray intersects planes at different heights. The coordinates of the intersection point on the height z1 plane are (x1, y1, z1), the coordinates of the intersection point on the height z2 plane are (x2, y2, z2), and the coordinates of the intersection point on the intermediate height z plane are (x, y, z).
[0069] Under the conditions of a pinhole imaging model and distortion correction, the camera optical center, the lower layer point (x1, y1, z1), the upper layer point (x2, y2, z2), and the intermediate layer point (x, y, z) are collinear. Along this ray, the spatial coordinates of the point are linearly related to the height z. Therefore, for the same pixel point (u, v), its world coordinates in different height planes can be linearly interpolated in the x and y directions according to the height z. Specifically, given the known coordinates (x1, y1, z1) and (x2, y2, z2) of height planes z1 and z2, if the world coordinates (x, y, z) under the intermediate height z plane are required, the aforementioned linear interpolation relationship can be used: , In this way, it is not necessary to perform separate calibration on each intermediate height plane. The world coordinates (x, y, z) at the intermediate height z can be solved by relying only on the transformation matrices T1 and T2 of the two calibration height planes and the height z.
[0070] This embodiment, through steps S31 to S34, achieves target image acquisition and target pixel coordinate extraction at any dispensing height z under the premise of unified distortion correction. Then, using pre-calibrated two-height perspective transformation matrices and a linear height interpolation relationship, it calculates the mechanical world coordinates of the target at that height. This method provides a positioning scheme based on dual-height calibration and linear interpolation for scenarios with continuously changing heights, without adding an extra height calibration plane or introducing an additional height sensor. This reduces the need for multiple height calibrations and improves the positioning accuracy and application flexibility of the dispensing system under varying height conditions.
[0071] Example 5 This embodiment proposes a dispensing control method based on the aforementioned visual positioning method, used to automatically complete the dispensing target positioning and dispensing execution actions during the production process. This control method, as follows... Figure 4 As shown, it includes steps S100 to S400.
[0072] S100: In response to a dispensing task request, obtain the current working height of the surface of the product to be dispensed; S200: Call the visual positioning method for the dispensing system as described above to obtain the mechanical world coordinates of the target to be dispensed at the current working height; S300: Based on the mechanical world coordinates and the current working height, control the mechanical actuator of the dispensing system to move to the target spatial position; S400: After reaching the target spatial position, control the dispensing valve to open to perform the dispensing action.
[0073] In step S100, the dispensing system receives a dispensing task request from a host computer, production control system, or local control terminal. The dispensing task request includes the product model, process formula number, workstation number, or other information used to identify the current product and process parameters. Upon receiving the dispensing task request, the control system reads the working height information corresponding to the product from a preset process database or configuration file based on the product number or process formula in the task request. The working height information is the height parameter of the surface of the product to be dispensed relative to the mechanical coordinate system of the dispensing system; it can be an absolute height value or a relative height value based on a reference plane.
[0074] In some implementations, the current working height can be obtained through one or more of the following methods: pre-setting the height of the product fixture or workbench, directly setting a fixed working height for that station in the system configuration; receiving feedback on the current product height from external sensors or the production line control system, and having the control system read this height parameter as the current working height; or calculating the current working height by adding product thickness or fixture height offset to a reference height using height offset data agreed upon in the product's process flow. Through these steps, the control system obtains the current working height of the product surface to be glued before the dispensing task is executed.
[0075] In step S200, the control system, based on the current working height z obtained in step S100, inputs this height as the dispensing height into the visual positioning method for the dispensing system proposed in the aforementioned embodiments. Specifically, the control system triggers the camera to acquire an original image containing the dispensing target at the workstation or area corresponding to the current working height, and calls image correction parameters to perform distortion correction processing on the original image to obtain a corrected target image. In the corrected target image, the target pixel coordinates (u, v) of the dispensing target are extracted using an image recognition algorithm.
[0076] Then, using the first transformation matrix T1 and the second transformation matrix T2, pre-calibrated at the first reference height z1 and the second reference height z2, the target pixel coordinates (u, v) are mapped to the first reference height plane and the second reference height plane, respectively, to obtain the first mechanical projection coordinates (x1, y1). 1) The second mechanical projection coordinates (x2, y2) are calculated. Based on the height ratio of the current working height z relative to z1 and z2, linear interpolation is used to interpolate (x1, y1) and (x2, y2) to obtain the mechanical coordinates (x, y) of the target point in the height z plane. Finally, (x, y, z) is output as the mechanical world coordinates of the target to be dispensed at the current working height. Through the above process, the control system can obtain the mechanical world coordinates of the target to be dispensed at the current working height based on the existing two-plane calibration results and unified image correction parameters without needing to separately calibrate the current height, providing target position information for the motion control of the mechanical actuator.
[0077] In step S300, the control system uses the mechanical world coordinates (x, y, z) obtained in step S200 as the target position and converts them into motion control commands within the dispensing system. The mechanical world coordinates can establish a one-to-one correspondence with the joint space or servo axis coordinate space of the mechanical actuator. Through kinematic solving or coordinate transformation modules, the three-dimensional mechanical world coordinates are converted into target position commands for each axis.
[0078] Specifically, the control system calculates the target positions of the dispensing head or robotic end effector on the X, Y, and Z axes based on (x, y, z). Simultaneously, it combines the system's current attitude constraints and motion trajectory planning strategy to generate a motion trajectory including parameters such as acceleration, velocity, and position. Subsequently, the motion controller sends position or velocity control commands to each servo motor or control axis, driving the mechanical actuator to move along the planned trajectory. During execution, the control system monitors the current position, velocity status, and system status information fed back from each axis to determine whether the mechanical actuator has reached the target spatial position within a specified error range. When the deviation between the current position and the target position of all relevant axes is less than a preset threshold, and the system is in a safe state allowing dispensing, the current position of the mechanical end effector is determined as having reached the target dispensing position.
[0079] In step S400, after confirming that the mechanical actuator has reached the target spatial position planned in step S300, the control system controls the dispensing valve and related dispensing execution units to perform the dispensing operation according to the process parameters in the dispensing task request. Specifically, the control system reads the dispensing parameters corresponding to the current dispensing task, including the dispensing valve opening time, dispensing pressure, dispensing flow rate setting, target glue volume, dispensing mode, and other information. Based on these parameters, a dispensing control command is generated to control the dispensing valve to open within a predetermined time window, and to control the dispensing pressure or the operation of the screw pump and other execution components as needed, so that the glue is output at the target position in a predetermined amount.
[0080] In some implementations, the control system can set multiple continuous points or continuous trajectories based on the dispensing trajectory, and execute steps S200 to S400 sequentially or continuously to achieve multi-point, linear, or area dispensing. For trajectory dispensing, the control system considers both the opening timing of the dispensing valve and the movement speed in the motion trajectory planning, ensuring the dispensing process is continuous. After the dispensing action is completed, the control system can close the dispensing valve and perform subsequent steps such as retraction, anti-drip control, or moving to a safe position. For multi-target dispensing scenarios, the system can cyclically execute the above control flow until all dispensing positions of the current product have been processed.
[0081] The control method in this embodiment allows the dispensing system to first acquire the current working height of the product to be dispensed after receiving a dispensing task request. Then, based on a unified visual positioning method, it calculates the mechanical world coordinates of the target at that height. Finally, it drives the mechanical actuator to move to the target spatial position and performs the dispensing action at that location. This method integrates height acquisition, visual positioning, and motion control processes, enabling the dispensing system to complete dispensing positioning and execution through a unified process even when product height changes, batch differences occur, or clamping heights vary. This reduces manual intervention and improves the consistency and automation of the dispensing process.
[0082] Example 6 This embodiment proposes a control device for implementing the above-described dispensing control method. This control device can be integrated into the dispensing equipment or function as an independent control module communicating with the dispensing actuator and vision acquisition device. The control device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor.
[0083] The memory is used to store the operating system, device drivers, dispensing control program, vision positioning program, and parameter data related to product processes. The memory may include read-only memory, random access memory, and non-volatile memory, used to store firmware programs, runtime data, and process configuration data, respectively. The memory may also store calibration data, including image correction parameters param, first transformation matrix T1, second transformation matrix T2, reference heights z1 and z2, and working height information corresponding to different product models.
[0084] The processor executes the computer program stored in memory to perform functions such as logic control, visual data processing, and motion control of the dispensing system. The processor can be implemented as a main controller, such as a digital signal processing chip (DSP), a programmable gate array (FPGA), a microcontroller unit (MCU), or a system-on-a-chip (SoC). The specific selection can be configured based on the system's requirements for computing performance, real-time performance, and the number of peripheral interfaces. The processor communicates with memory, camera interface modules, motion control modules, dispensing valve drive modules, and human-machine interfaces via a bus, coordinating the workflow of each functional module.
[0085] A computer program stored in a memory and running on a processor is configured to execute the steps of the control method described above, including but not limited to steps S100 to S400 as described in Embodiment 5, and the sub-steps of the visual positioning method described in Embodiments 1 to 4.
[0086] The dispensing task management module is used to receive dispensing task requests from the host computer or the local operation interface, parse the task content, obtain product model, process formula number, dispensing trajectory information, etc., and trigger subsequent height acquisition and visual positioning processes.
[0087] The height acquisition and process parameter module reads the current product's working height information from the process database based on the dispensing task request, or calculates the current working height z based on data such as the reference height and fixture height offset, and provides this height parameter to the vision positioning module and motion control module.
[0088] The visual positioning module calls the image acquisition module to acquire the original image containing the area to be glued. Based on the stored image correction parameters (param), it performs distortion correction on the original image to generate a corrected image. In the corrected image, a target recognition algorithm is used to extract the pixel coordinates (u, v) of the target to be glued. Subsequently, the visual positioning module maps the pixel coordinates to the first reference height z1 and the second reference height z2 plane based on the stored first transformation matrix T1 and second transformation matrix T2, obtaining (x1, y1) and (x2, y2). Combining this with the proportional relationship between the current working height z and z1 and z2, it performs linear interpolation to calculate the mechanical coordinates (x, y, z) of the target point at the current working height, and outputs this result to the motion control module.
[0089] The motion control module, based on the mechanical world coordinates (x, y, z) output by the vision positioning module, converts the target position information into target position commands for multi-axis servo motors or stepper motors through inverse kinematics or coordinate transformation, generates a motion trajectory, and issues control commands to drive the mechanical actuator to move. This module monitors the position feedback information from each axis, and when it confirms that the mechanical actuator has reached the target position and meets safety conditions, it sends a dispensing permission signal to the dispensing control module.
[0090] The dispensing control module controls the opening and closing of the dispensing valve based on information such as dispensing time, glue volume, and pressure settings in the process parameters. It can also control actuators such as dispensing pressure or metering pumps to complete the dispensing operation at the target point. For multi-point and trajectory dispensing, the dispensing control module can coordinate with the motion control module to perform synchronous dispensing on specified trajectory segments or points.
[0091] Since the control device proposed in this application is used to execute the above-mentioned dispensing control method and visual positioning method, the control device in this embodiment includes all the technical solutions of the above-mentioned control method embodiments in terms of program function, and implements the corresponding functions by running the corresponding program logic through the processor, so as to achieve the same technical effect as the method embodiments.
[0092] Example 7 This embodiment proposes a dispensing system for achieving visual positioning and automatic dispensing control when the height of the product surface varies. The dispensing system includes a control device, a camera, a dispensing valve, and a mechanical actuator for driving the dispensing valve to move in three-dimensional space.
[0093] The control device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The control device is used to execute the control method and visual positioning method described in any embodiment of this application. The control device is electrically or communicatively connected to a camera, a mechanical actuator, and a dispensing valve, and is used to receive image data, output motion control commands and dispensing control commands, and manage and retrieve data such as height information, calibration parameters, and transformation matrices.
[0094] The camera is used to acquire images of the product to be dispensed, including calibration images at a reference height, calibration images at different reference heights, and the target image at the dispensing height. The camera can be an industrial camera or other image acquisition device with appropriate resolution and frame rate. The camera is mounted on the dispensing system using a fixed bracket, and its mounting position and orientation remain unchanged after calibration. The camera connects to the control device via a wired or bus interface, transmitting the acquired image data to the control device. The control device then uses the image correction parameters param and transformation matrices T1 and T2 for visual positioning and coordinate calculation.
[0095] A dispensing valve is used to dispense adhesive to a target location under the drive of a dispensing control signal from a control device. The dispensing valve can be a needle valve, jet valve, screw valve, or other types, configured according to process requirements. The on / off state, opening time, and operating frequency of the dispensing valve are controlled by the control device. The dispensing valve is fixedly connected to the end of the mechanical actuator, allowing the spatial position of the dispensing valve nozzle to change with the movement of the mechanical actuator.
[0096] A mechanical actuator is used to drive the dispensing valve to move in three-dimensional space. The mechanical actuator may include a linear module, a robotic articulated arm, or a multi-axis motion platform, and must have position adjustment capabilities in at least the X, Y, and Z directions. The mechanical actuator is connected to the motion control module of the control device and receives target position and motion trajectory commands from the control device. Based on the mechanical world coordinates (x, y, z) obtained from visual positioning, the control device generates motion commands for each axis of the mechanical actuator, causing the dispensing valve to move to the target dispensing position.
[0097] When the dispensing system is in actual operation, the control device first obtains the working height of the surface of the product to be dispensed according to the dispensing task request; then, it acquires an image containing the target to be dispensed through the camera, and calls the stored image correction parameter param to perform distortion correction processing, and identifies the pixel coordinates (u, v) of the target to be dispensed in the corrected image.
[0098] The control device uses the stored first transformation matrix T1 and second transformation matrix T2 to map the target pixel coordinates to mechanical coordinates (x1, y1) and (x2, y2) under the reference heights z1 and z2 plane. Combining this with the height ratio between the current working height z and z1 and z2, linear interpolation is performed to obtain the mechanical world coordinates (x, y, z) of the target to be dispensed at the current height. Subsequently, the control device sends a motion command to the mechanical actuator, driving the dispensing valve to move to the spatial position corresponding to the coordinates (x, y, z). Upon reaching the position, the dispensing valve opens to perform dispensing, completing the dispensing operation at the current target point.
[0099] With the above structural configuration, the dispensing system of this embodiment integrates a control device, a camera, a dispensing valve, and a mechanical actuator. It can solve for the three-dimensional coordinates of the target point using a unified distortion correction, dual-height calibration, and height interpolation algorithm, even when the product height varies. This allows it to drive the mechanical actuator and dispensing valve to complete automatic dispensing. The dispensing system of this embodiment is suitable for dispensing products of different heights and specifications. It can be used in conjunction with the visual positioning and control methods described in the foregoing embodiments of this application to achieve the technical effects of improving dispensing positioning accuracy, reducing calibration workload, and lowering system complexity.
[0100] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A visual positioning method for a dispensing system, characterized in that, include: Obtain image correction parameters at a reference height, and use the image correction parameters to perform uniform correction processing on images acquired at at least two different reference heights; Establish the coordinate mapping relationship between pixel space and mechanical space under different reference heights after correction, and obtain the first transformation matrix and the second transformation matrix; A target image of the height to be dispensed is obtained. The target pixel coordinates of the target to be dispensed are extracted from the target image. The target pixel coordinates are transformed to the projected mechanical coordinates at the corresponding reference height using the first transformation matrix and the second transformation matrix. The projected mechanical coordinates are interpolated using the linear proportional relationship between the height to be dispensed and the reference height to calculate the mechanical coordinates of the target to be dispensed at the height to be dispensed.
2. The visual positioning method for a dispensing system as described in claim 1, characterized in that, The specific steps for obtaining the image correction parameters at the reference height include: A reference image is acquired at a first reference height, and distortion calibration is performed on the reference image to obtain image correction parameters; wherein, the image correction parameters include radial distortion correction parameters and perspective distortion correction parameters.
3. The visual positioning method for a dispensing system as described in claim 1, characterized in that, The specific steps for establishing the coordinate mapping relationship between the pixel space and the mechanical space at different corrected reference heights to obtain the first transformation matrix and the second transformation matrix include: Calibration images are acquired at a first reference height and a second reference height, respectively. The acquired calibration images are then processed to remove distortion using the image correction parameters. The pixel coordinates of feature points are then extracted from the corrected calibration images. Obtain the mechanical coordinates of the corresponding feature points fed back by the robotic arm; The transformation relationship between pixel coordinates and mechanical coordinates under the first and second reference heights is established by using the n-point calibration method, thus obtaining the first height transformation matrix and the second height transformation matrix.
4. The visual positioning method for a dispensing system as described in claim 3, characterized in that, Both the first transformation matrix and the second transformation matrix are perspective transformation matrices, and n in the n-point calibration is not less than 4.
5. The visual positioning method for a dispensing system as described in claim 1, characterized in that, The specific steps for obtaining the target image of the height to be dispensed and extracting the target pixel coordinates of the target to be dispensed from the target image include: At the desired dispensing height, acquire an original image containing the target object to be dispensed; The image correction parameters are called to perform distortion correction on the original image to generate a corrected target image, and the target pixel coordinates of the target to be glued are extracted from the target image.
6. The visual positioning method for a dispensing system as described in claim 5, characterized in that, The specific steps of transforming the target pixel coordinates to projected mechanical coordinates at the corresponding reference height using the first transformation matrix and the second transformation matrix, and then interpolating the projected mechanical coordinates using the linear proportional relationship between the dispensing height and the reference height to calculate the mechanical coordinates of the target at the dispensing height include: The target pixel coordinates are mapped to a plane at a first reference height using the first transformation matrix to obtain the first mechanical coordinates; The target pixel coordinates are mapped to a plane at a second reference height using the second transformation matrix to obtain the second mechanical coordinates; By utilizing the linear positional relationship between the height to be dispensed and the first reference height and the second reference height, linear interpolation is performed on the first and second mechanical coordinates to calculate the mechanical coordinates of the target to be dispensed at the height to be dispensed.
7. The visual positioning method for a dispensing system as described in claim 6, characterized in that, The linear interpolation satisfies the following relationship: , ; Where z1 is the first reference height, z 2 is the second reference height, z is the height to be dispensed, ( x 1 ,y 1) represents the first projected mechanical coordinates, ( x 2 ,y 2) represents the second projected mechanical coordinates. x, y () represents the mechanical coordinates of the target to be dispensed at height z.
8. A control method, characterized in that, include: In response to a dispensing task request, obtain the current working height of the surface of the product to be dispensed; The visual positioning method for a dispensing system as described in any one of claims 1 to 7 is invoked to obtain the mechanical world coordinates of the target to be dispensed at the current working height. Based on the mechanical world coordinates and the current working height, control the mechanical actuator of the dispensing system to move to the target spatial position; After reaching the target spatial position, the dispensing valve is opened to perform the dispensing action.
9. A control device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the control method as claimed in claim 8.
10. A dispensing system, characterized in that, It includes the control device as described in claim 9, as well as a camera, a dispensing valve, and a mechanical actuator for driving the dispensing valve to move in three-dimensional space.