Sample injection needle position calibration method and automatic sample injector
By controlling the horizontal movement of the injection needle and the image fitting of the image acquisition device, the problem of injection needle position calibration relying on human experience has been solved, achieving efficient, low-cost, and highly accurate injection needle position calibration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU KUANGXIN TECH CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-07-03
Smart Images

Figure CN121917686B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sample testing technology, and in particular to a method for calibrating the position of a sample injection needle and an automatic sampler. Background Technology
[0002] In sample testing scenarios, such as those using liquid chromatography, an autosampler can inject the sample into the system flow path for analysis. Specifically, the autosampler's injection needle can draw a specified sample from a sample vial and inject the drawn sample into the system flow path through the injection port.
[0003] If the injection needle is found to be misaligned, it needs to be recalibrated. For example, calibration can be completed by manually observing the relative positions of the injection needle and the injection port, and then manually adjusting the needle to align with the port. However, this method relies heavily on manual experience, has a high operational threshold, resulting in high calibration costs and low efficiency. Furthermore, due to the inherent errors in manual observation, the accuracy of the calibration is also low. Summary of the Invention
[0004] The purpose of this application is to provide a method for calibrating the position of an injection needle and an automatic injector, so as to reduce calibration costs and improve calibration efficiency and accuracy. The specific technical solution is as follows:
[0005] A first aspect of this application provides a method for calibrating the position of an injection needle, the method comprising:
[0006] The tip of the injection needle is controlled to move horizontally at a preset height from the injection port and then move to the initial injection position, wherein the horizontal movement trajectory is centered on the initial injection position;
[0007] The image acquisition device is controlled to acquire a first image including the injection port, and during the horizontal movement, the image acquisition device is controlled to acquire multiple second images including the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images;
[0008] Based on the first image, the projection of the injection port in the image coordinate system is fitted as a first projection pattern; and based on each of the second images, the projection of the motion trajectory in the image coordinate system is fitted as a second projection pattern.
[0009] The physical offset in the horizontal direction between the initial injection position and the center of the injection port is determined based on the offset between the center of the first projection pattern and the center of the second projection pattern.
[0010] In one possible embodiment, the optical axis of the image acquisition device is offset from the central axis of the injection needle; the step of fitting the projection of the injection port in the image coordinate system as a first projection pattern based on the first image includes:
[0011] Based on the preset height and the calibration results of the image acquisition device, the transformation relationship between the target image coordinate system and the image coordinate system of the first image is calculated, wherein the target image coordinate system is the image coordinate system of the image acquired by the image acquisition device when the optical axis coincides with the central axis;
[0012] According to the transformation relationship, the position of the contour point of the injection port in the first image is projected into the target image coordinate system to obtain the first projection position; and each of the first projection positions is fitted to obtain the projection of the injection port in the image coordinate system, which is used as the first projection pattern.
[0013] The step of fitting the projection of the motion trajectory in the image coordinate system based on each of the second images, as a second projection pattern, includes:
[0014] According to the transformation relationship, the position of the needle tip in each of the second images is projected into the target image coordinate system to obtain the second projection position; and each of the second projection positions is fitted to obtain the projection of the motion trajectory in the target image coordinate system as the second projection pattern.
[0015] In one possible embodiment, fitting each of the second projection positions to obtain the projection of the motion trajectory in the target image coordinate system as a second projection pattern includes:
[0016] The shape of the needle tip's trajectory in the needle tip coordinate system during the horizontal movement is obtained as the first shape;
[0017] Each of the second projection positions is fitted into a pattern of the first shape, which is used as the first projection pattern.
[0018] In one possible embodiment, the tip of the control injection needle first moves horizontally at a preset height from the injection port, including:
[0019] Obtain the shape of the outer contour of the injection port as the second shape;
[0020] The motion trajectory of the second shape centered on the initial injection position is planned in the horizontal direction;
[0021] The tip of the injection needle is controlled to move along the motion trajectory at a preset height from the injection port.
[0022] In one possible embodiment, the initial injection position is the origin of the needle tip coordinate system;
[0023] The method further includes:
[0024] The needle tip is controlled to move from the initial injection position by the physical offset, and the coordinates of the needle tip after the physical offset are determined in the needle tip coordinate system, which is used as the new origin of the needle tip coordinate system.
[0025] In one possible embodiment, controlling the movement of the needle tip from the initial injection position by the physical offset includes:
[0026] If the physical offset is greater than a preset offset threshold, then the needle tip is controlled to move from the initial injection position by the physical offset.
[0027] The method further includes:
[0028] If the physical offset is not greater than the preset offset threshold, then the origin of the needle tip coordinate system remains unchanged.
[0029] In one possible embodiment, determining the physical offset in the horizontal direction between the initial injection position and the injection port center based on the offset between the center of the first projection pattern and the center of the second projection pattern includes:
[0030] Determine the ratio between the physical size of the injection port and the size of the first projected pattern, as the target ratio;
[0031] The offset between the center of the first projection pattern and the center of the second projection pattern is determined as the pixel offset;
[0032] The pixel offset is proportionally transformed according to the target ratio, and the transformation result is used as the physical offset.
[0033] In one possible embodiment, the injection port is circular; determining the ratio between the physical size of the injection port and the size of the first projected pattern, as a target ratio, includes:
[0034] Obtain the design radius of the injection port;
[0035] The ratio between the design radius of the injection port and the radius of the first projected pattern is determined as the target ratio.
[0036] In a second aspect of this application, an autosampler is also provided, the autosampler comprising: a control terminal and an image acquisition device;
[0037] The image acquisition device is used to acquire images under the control of the control terminal;
[0038] The control terminal is used to execute any of the methods described in the first aspect above.
[0039] Beneficial effects of the embodiments in this application:
[0040] The injection needle position calibration method provided in this application embodiment controls the horizontal movement of the injection needle tip and takes pictures of the injection needle during the movement to obtain the movement trajectory of the injection needle. Then, the position of the injection needle is calibrated based on the offset between the movement trajectory and the injection port. It does not rely on human experience, so the calibration cost is low and the calibration efficiency is high. Furthermore, since it is not affected by human observation errors, the calibration accuracy is high.
[0041] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0042] 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, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0043] Figure 1 A schematic flowchart of a needle position calibration method provided in an embodiment of this application;
[0044] Figure 2 Another schematic flowchart of the injection needle position calibration method provided in the embodiments of this application;
[0045] Figure 3a A schematic diagram showing the position of the image acquisition device provided in this application relative to the injection port and injection needle;
[0046] Figure 3b Another schematic diagram showing the position of the image acquisition device relative to the injection port and injection needle provided in this application;
[0047] Figure 4 This is another schematic flowchart illustrating the injection needle position calibration method provided in the embodiments of this application;
[0048] Figure 5a This is another schematic flowchart illustrating the injection needle position calibration method provided in the embodiments of this application;
[0049] Figure 5b This is another schematic flowchart illustrating the injection needle position calibration method provided in the embodiments of this application;
[0050] Figure 6This is another schematic flowchart illustrating the injection needle position calibration method provided in the embodiments of this application;
[0051] Figure 7 A schematic diagram of a projection pattern provided in an embodiment of this application;
[0052] Figure 8 This is a schematic diagram of the structure of a needle position calibration device provided in an embodiment of this application;
[0053] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0054] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0055] In sample testing scenarios, the injection needle in an autosampler can draw a specified sample from a sample vial and inject the drawn sample into the system flow path through the injection port for sample testing. If the injection needle is found to be inaccurate, for example, if changing the injection needle causes inaccuracy, the injection needle position needs to be recalibrated. For example, calibration can be completed by manually observing the relative position of the injection needle and the injection port and manually adjusting the injection needle position to align it with the injection port. However, this method not only relies on human experience, but also has a high operational threshold, resulting in high calibration costs and low calibration efficiency.
[0056] To reduce calibration costs and improve calibration efficiency, this application provides a method for calibrating the position of an injection needle. One possible embodiment is shown below. Figure 1 The method for calibrating the position of the injection needle may include:
[0057] Step S101: Control the tip of the injection needle to move horizontally at a preset height from the injection port and then move to the initial injection position, wherein the horizontal movement trajectory is centered on the initial injection position; Step S102: Control the image acquisition device to acquire a first image including the injection port, and during the horizontal movement, control the image acquisition device to acquire multiple second images including the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images; Step S103: Based on the first image, fit the projection of the injection port in the image coordinate system as the first projection pattern; and based on each of the second images, fit the projection of the movement trajectory in the image coordinate system as the second projection pattern; Step S104: Based on the offset between the center of the first projection pattern and the center of the second projection pattern, determine the physical offset in the horizontal direction between the initial injection position and the center of the injection port. This embodiment allows for the control of the horizontal movement of the injection needle tip and the capture of images of the injection needle during the movement to obtain the injection needle's trajectory. The position of the injection needle can then be calibrated based on the offset between the trajectory and the injection port. This eliminates the need for human experience, resulting in lower calibration costs and higher calibration efficiency. Furthermore, since it is not affected by human observation errors, the calibration accuracy is high.
[0058] In step S101 of this embodiment, the preset height is set in advance according to user needs or practical experience. For example, the preset height can be 2mm or 3mm. The initial injection position is the injection position before executing step S101. In this document, the height direction refers to the axial direction of the injection port, and the horizontal direction refers to the radial direction of the injection port.
[0059] The trajectory can be closed, such as a circle, rectangle, or regular hexagon, or it can be open, such as a line segment, arc, or broken line segment. When the trajectory is a circle or arc, the initial injection position as the center of the trajectory can mean either the center of the circle or the geometric center of the trajectory. Conversely, when the trajectory is not a circle or arc, the initial injection position as the center of the trajectory can mean the geometric center of the trajectory.
[0060] In step S102 of this embodiment, the first image can be acquired first, followed by the acquisition of each second image; the second images can be acquired first, followed by the acquisition of the first image; or the first image can be acquired during the acquisition of each second image. The same pose of the image acquisition devices means that the poses of the image acquisition devices relative to the inlet are the same, that is, the image acquisition devices have not been translated or rotated relative to the inlet.
[0061] In step S103 of this embodiment, the image coordinate system can refer to the image coordinate system of the image acquisition device itself, or it can refer to other image coordinate systems. For example, it can be assumed that there is a device with exactly the same optical parameters as the image acquisition device (hereinafter referred to as the virtual acquisition device), but the pose of the virtual acquisition device is different from the pose of the image acquisition device. The image coordinate system can refer to the image coordinate system of the virtual acquisition device.
[0062] It is understood that the injection port can be a hollow pattern. For example, the injection port can be annular, a pattern with an outer circle and an inner square, or a pattern with an outer square and an inner circle. The projection of the injection port can refer to the projection of the hollow pattern, the projection of the outer contour of the hollow pattern, or the projection of the hollow portion. For example, in the case of an annular injection port, the projection of the injection port can refer to the projection of the annulus, the projection of the contour of the larger circle within the annulus, or the projection of the contour of the smaller circle within the annulus.
[0063] In step S104 of this embodiment, physical offset refers to the offset in the Earth coordinate system or the laboratory coordinate system (hereinafter collectively referred to as the physical coordinate system). It can be understood that the centers of the first projection pattern and the second projection pattern are located in the image coordinate system, so it is necessary to establish the transformation relationship between the image coordinate system and the physical coordinate system.
[0064] When the image coordinate system is the image coordinate system of the image acquisition device itself, the transformation relationship between the image coordinate system and the physical coordinate system can be established by calibrating the image acquisition device. When the image coordinate system is another image coordinate system, the transformation relationship can be obtained through calibration or calculated based on the transformation relationship between the image coordinate system of the image acquisition device and the physical coordinate system.
[0065] One possible embodiment, see Figure 2 Compared to Figure 1 The embodiment shown, Figure 2 In the illustrated embodiment, the optical axis of the image acquisition device is offset from the central axis of the injection needle, and step S103 is further refined into steps S1031 to S1033. Figure 2 In the illustrated embodiment, the injection needle position calibration method may include:
[0066] Step S101: Control the tip of the injection needle to move horizontally at a preset height from the injection port and then move to the initial injection position, wherein the horizontal movement trajectory is centered on the initial injection position; Step S102: Control the image acquisition device to acquire a first image including the injection port, and during the horizontal movement, control the image acquisition device to acquire multiple second images including the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images; Step S1031: Calculate the transformation relationship between the target image coordinate system and the image coordinate system of the first image based on the preset height and the calibration result of the image acquisition device, wherein the target image coordinate system is the image acquired by the image acquisition device when the optical axis coincides with the central axis. The image coordinate system; Step S1032: According to the transformation relationship, the position of the contour point of the injection port in the first image is projected to the target image coordinate system to obtain the first projection position; and each first projection position is fitted to obtain the projection of the injection port in the image coordinate system as the first projection pattern; Step S1033: According to the transformation relationship, the position of the needle tip in each second image is projected to the target image coordinate system to obtain the second projection position; and each second projection position is fitted to obtain the projection of the motion trajectory in the target image coordinate system as the second projection pattern; Step S104: According to the offset between the center of the first projection pattern and the center of the second projection pattern, the physical offset of the initial injection position and the center of the injection port in the horizontal direction is determined. In this embodiment, the motion trajectory and the injection port are projected to the target image coordinate system. Since the target image coordinate system is the image coordinate system of the front shot (and along the central axis of the injection port), the distortion of the ground pattern caused by the oblique shot can be eliminated, thereby further improving the accuracy of the calibration.
[0067] Since steps S101, S102, and S104 of this embodiment are the same as those described above... Figure 1 The embodiments shown are the same, and can be found in the foregoing. Figure 1 The relevant explanations will not be repeated here. The following only describes steps S1031, S1032, and S1033 as detailed in this embodiment:
[0068] In step S1031 of this embodiment, since the image acquisition device cannot capture the sample inlet when it is located directly below the sample inlet, it can be considered that the image acquisition device is located directly above the sample inlet when the optical axis of the image acquisition device coincides with the central axis of the sample inlet. That is, it can be considered that the image acquisition device is taking pictures of the sample inlet and the needle tip from above.
[0069] It is understandable that when an image acquisition device acquires an image at an angle, the acquired image will have a certain degree of distortion. For example, taking the motion trajectory as a circle, when the image acquisition device acquires an image at an angle, the motion trajectory in the image coordinate system of the image acquisition device itself will change to an approximately elliptical shape due to distortion, making it difficult to accurately determine the center and thus making it difficult to achieve accurate calibration.
[0070] Although Figure 3a As shown, placing the image acquisition device 31 directly above the injection port 32 can avoid distortion. However, at this time, the tip 331 of the injection needle 33 will be blocked by the injection needle body, causing the image acquisition device 31 to be unable to acquire the tip 331 of the injection needle 33.
[0071] In this embodiment, the optical axis of the image acquisition device is offset from the central axis of the injection needle, that is, as shown below. Figure 3b As shown, the image acquisition device 31 is placed on the side of the injection needle 33 so that the image acquisition device 31 can normally acquire the tip 331 of the injection needle 33. At the same time, the motion trajectory and the injection port are projected onto the image coordinate system of the overhead shot to avoid the aforementioned distortion, thereby improving the accuracy of calibration.
[0072] In step S1032 of this embodiment, the contour point of the injection port can refer to the contour point of the outer contour of the injection port, or the contour point of the hollow part of the injection port, or a combination of the two contour points mentioned above.
[0073] In step S1033 of this embodiment, the fitted motion trajectory should be consistent with the shape of the actual motion trajectory. For example, if the actual motion trajectory is an arc, then arc fitting should be used when fitting the second projection position, and if the actual motion trajectory is a straight line, then straight line fitting should be used when fitting the second projection position.
[0074] and, Figure 2 The example shown is only one possible embodiment, although in Figure 2 In the illustrated embodiment, step S1033 is executed after steps S1031 and S1032. In other possible embodiments, step S1033 may also be executed after step S1031 and before step S1032, or it may be executed in parallel or alternately with step S1032. This application does not impose any limitations on this.
[0075] In one possible embodiment, the fitting of each second projection position in step S1033 to obtain the projection of the motion trajectory in the target image coordinate system as the second projection pattern includes: acquiring the shape of the motion trajectory of the needle tip in the needle tip coordinate system during horizontal movement, as the first shape; and fitting each second projection position into a pattern of the first shape, as the first projection pattern. Since the needle tip coordinate system and the image coordinate system have a simple proportional scaling relationship when shot from above, the shape of the motion trajectory in the target image coordinate system is consistent with its shape in the needle tip coordinate system. Since the needle tip moves under control in the needle tip coordinate system, the motion trajectory of the needle tip in the needle tip coordinate system is known. Using this embodiment, the shape in the needle tip coordinate system can be used to assist in fitting the second position, thereby improving the accuracy of the fitting and thus improving the accuracy of the calibration.
[0076] In this embodiment, the needle tip coordinate system is a coordinate system attached to the needle tip. For example, it can be a coordinate system with the needle tip as the origin.
[0077] One possible embodiment, see Figure 4 Compared to Figure 1 The embodiment shown, Figure 4 In the illustrated embodiment, step S101 is further refined into steps S1011 to S1013. Figure 4 In the illustrated embodiment, the injection needle position calibration method may include:
[0078] Step S1011: Obtain the shape of the outer contour of the injection port as the second shape; Step S1012: Plan the motion trajectory of the second shape centered on the initial injection position in the horizontal direction; Step S1013: Control the tip of the injection needle to move along the motion trajectory at a preset height from the injection port and then move to the initial injection position, wherein the horizontal motion trajectory is centered on the initial injection position; Step S102: Control the image acquisition device to acquire a first image containing the injection port, and during the horizontal movement, control the image acquisition device to acquire multiple second images containing the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images; Step S103: Based on the first image, fit the projection of the injection port in the image coordinate system as the first projection pattern; and based on each of the second images, fit the projection of the motion trajectory in the image coordinate system as the second projection pattern; Step S104: Based on the offset between the center of the first projection pattern and the center of the second projection pattern, determine the physical offset in the horizontal direction between the initial injection position and the center of the injection port. By using this embodiment, the movement trajectory of the needle tip is planned to ensure that the movement trajectory of the needle tip is consistent with the shape of the injection port, thereby reducing the center offset error caused by shape differences. This improves the accuracy of the calculated center offset and thus improves the accuracy of calibration.
[0079] Since steps S102, S103, and S104 of this embodiment are the same as those described above... Figure 1 The embodiments shown are the same, and can be found in the foregoing. Figure 1 The relevant explanations will not be repeated here. The following only describes steps S1011, S1012, and S1013 as detailed in this embodiment:
[0080] In S1011 of this embodiment, edge recognition can be performed on the first image to obtain the shape of the outer contour of the inlet, or the shape of the outer contour of the inlet can be obtained from the drawing of the inlet, or the shape of the outer contour of the inlet can be manually input by the user.
[0081] In S1012 of this embodiment, when the second shape is a circle, a motion trajectory with a preset radius or a random radius can be planned with the initial injection position as the center. The preset radius can be set according to user needs or practical experience. When the second shape is a rectangle, a rectangular trajectory with the initial injection position as the geometric center can be planned as the motion trajectory.
[0082] In S1013 of this embodiment, when the motion trajectory is a closed figure, the needle tip can be controlled to move to any point on the motion trajectory first, then move around the motion trajectory from that point, and then move back to the initial injection position. When the motion trajectory is a non-closed figure, that is, when the motion trajectory is a line segment, the needle tip can be controlled to move to any endpoint on the motion trajectory first, then move around the motion trajectory from that point to the other endpoint, and then move back to the initial injection position.
[0083] One possible embodiment, see Figure 5a Compared to Figure 1 The embodiment shown, Figure 5a In the embodiment shown, the initial injection position is the origin of the needle tip coordinate system, and step S105 is added. Figure 5a In the illustrated embodiment, the injection needle position calibration method may include:
[0084] Step S101: Control the tip of the injection needle to move horizontally at a preset height from the injection port and then move to the initial injection position, wherein the horizontal movement trajectory is centered on the initial injection position; Step S102: Control the image acquisition device to acquire a first image including the injection port, and during the horizontal movement, control the image acquisition device to acquire multiple second images including the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images; Step S103: Based on the first image, fit the projection of the injection port in the image coordinate system as the first projection pattern; and based on each of the second images, fit the projection of the movement trajectory in the image coordinate system as the second projection pattern; Step S104: Based on the offset between the center of the first projection pattern and the center of the second projection pattern, determine the physical offset in the horizontal direction between the initial injection position and the center of the injection port; Step S105: Control the needle tip to move physically away from the initial injection position, and determine the coordinates of the needle tip after the physical offset in the needle tip coordinate system, which is the new origin of the needle tip coordinate system. In this embodiment, since the needle tip moves in a controlled manner within a needle tip coordinate system, the control of the needle tip is simplified by using the origin of the needle tip coordinate system as the initial injection position, thus reducing the difficulty of implementing the injection needle position calibration method. Simultaneously, the origin of the needle tip coordinate system is calibrated based on the calibrated physical offset to align the origin with the injection port center as closely as possible, thereby improving the success rate of subsequent injections while reducing implementation difficulty.
[0085] Since steps S101, S102, S103, and S104 of this embodiment are the same as those described above... Figure 1 The embodiments shown are the same, and can be found in the foregoing. Figure 1 The relevant explanations will not be repeated here. The following only describes the additional step S105 in this embodiment:
[0086] In step S105 of this embodiment, since the needle tip moves under control in the needle tip coordinate system, the coordinates of the needle tip in the needle tip coordinate system are known. Therefore, the coordinates of the needle tip in the needle tip coordinate system after the physical offset can be obtained. Furthermore, since the physical offset is the offset of the needle tip relative to the center of the injection port, theoretically, after the physical offset of the needle tip, the needle tip and the center of the injection port are aligned in the horizontal direction. When controlling the injection needle for subsequent injection, it is only necessary to first control the injection needle to move horizontally to the origin of the needle tip coordinate system, and then control the injection needle to move vertically in the height direction to achieve injection. This not only simplifies control but also ensures a high injection success rate because the needle tip is aligned with the injection port.
[0087] One possible embodiment, see Figure 5b Compared to Figure 5a The embodiment shown, Figure 5bIn the illustrated embodiment, step S105 is refined into step S1051, and step S106 is added. Figure 5b In the illustrated embodiment, the injection needle position calibration method may include:
[0088] Step S101: Control the tip of the injection needle to move horizontally at a preset height from the injection port and then move to the initial injection position, wherein the horizontal movement trajectory is centered on the initial injection position; Step S102: Control the image acquisition device to acquire a first image including the injection port, and during the horizontal movement, control the image acquisition device to acquire multiple second images including the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images; Step S103: Based on the first image, fit the projection of the injection port in the image coordinate system as the first projection pattern; and based on each of the second images... The image is fitted to obtain the projection of the motion trajectory in the image coordinate system, which is used as the second projection pattern; Step S104: Based on the offset between the center of the first projection pattern and the center of the second projection pattern, the physical offset in the horizontal direction between the initial injection position and the injection port center is determined; Step S1051: If the physical offset is greater than a preset offset threshold, the needle tip is controlled to move physically offset from the initial injection position, and the coordinates of the needle tip after the physical offset are determined in the needle tip coordinate system, which is used as the new coordinate origin of the needle tip coordinate system; Step S106: If the physical offset is not greater than the preset offset threshold, the coordinate origin of the needle tip coordinate system remains unchanged. In this embodiment, the coordinate origin of the needle tip coordinate system is calibrated only when the physical offset is large, and not when the physical offset is small, so as to avoid the increased control difficulty caused by too frequent calibration of the coordinate origin.
[0089] Since steps S101, S102, S103, and S104 of this embodiment are the same as those described above... Figure 1 The embodiments shown are the same, and can be found in the foregoing. Figure 1 The relevant explanations will not be repeated here. The following only describes the detailed step S1051 and the newly added step S106 in this embodiment:
[0090] In step S1051 of this embodiment, the preset offset threshold can be set according to user needs or practical experience, but it should satisfy the following condition: when the tip of the injection needle has an offset below the preset offset threshold, it will not affect the injection success rate. For example, assuming the injection port size is 4mm, it can be considered that even if the tip of the injection needle has an offset of 0.2mm from the center of the injection port, the tip can still successfully enter the injection port to achieve injection, so the preset offset threshold can be set to 0.2mm. Conversely, if it is believed that the tip of the injection needle will not be able to successfully enter the injection port to achieve injection when there is an offset of 1mm from the center of the injection port, then the preset offset threshold cannot be set to 1mm or more.
[0091] In step S106 of this embodiment, it can be understood that the origin of the needle tip coordinate system is usually written in the controller of the injection needle. If the origin of the coordinate system is changed frequently, it will lead to the frequent writing of the origin of the coordinate system in the controller, which will affect the service life of the controller and increase the difficulty of controlling the injection needle.
[0092] One possible embodiment, see Figure 6 Compared to Figure 1 The embodiment shown, Figure 6 In the illustrated embodiment, step S104 is further refined into steps S1041 to S1043. Figure 6 In the illustrated embodiment, the injection needle position calibration method may include:
[0093] Step S101: Control the tip of the injection needle to move horizontally at a preset height from the injection port and then move to the initial injection position, wherein the horizontal movement trajectory is centered on the initial injection position; Step S102: Control the image acquisition device to acquire a first image including the injection port, and during the horizontal movement, control the image acquisition device to acquire multiple second images including the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images; Step S103: Based on the first image, fit the projection of the injection port in the image coordinate system as the first projection pattern; and based on each of the second images, fit the projection of the movement trajectory in the image coordinate system as the second projection pattern; Step S1041: Determine the ratio between the physical size of the injection port and the size of the first projection pattern as the target ratio; Step S1042: Determine the offset between the center of the first projection pattern and the center of the second projection pattern as the pixel offset; Step S1043: Perform a proportional transformation on the pixel offset according to the target ratio, and use the transformation result as the physical offset. In this embodiment, the scaling ratio between the image coordinate system and the physical coordinate system is calculated by the physical size of the injection port and the size of the first projected pattern. The physical offset is then calculated based on this scaling ratio. Since the size of the injection port is fixed, it is relatively easy to obtain. In other words, this embodiment provides a physical offset calculation method that is relatively easy to implement, thereby further reducing the calibration cost.
[0094] Since steps S101, S102, and S103 of this embodiment are the same as those described above... Figure 1 The embodiments shown are the same, and can be found in the foregoing. Figure 1 The relevant explanations will not be repeated here. The following only describes steps S1041, S1042, and S1043 as detailed in this embodiment:
[0095] In step S1041 of this embodiment, the physical size of the injection port can be pre-input by the user, obtained from the injection port drawing, or pre-measured using machine vision algorithms or other measurement methods. The physical size and the size of the first projected pattern should be of the same type. For example, taking an injection port as a ring, assuming the physical size is the diameter of the large circle of the injection port, the size of the first projected pattern is also the diameter of the large circle. Furthermore, assuming the physical size is the thickness of the ring, the size of the first projected pattern should also be the thickness of the ring. For ease of description, the physical size is denoted as Dactual, and the size of the first projected pattern is denoted as Dpixel.
[0096] In step S1042 of this embodiment, the pixel offset can be obtained by subtracting the pixel coordinates of the center of the first projection pattern from the pixel coordinates of the center of the second projection pattern. For ease of description, the pixel coordinates of the center of the first projection pattern are denoted as (x1, y1), and the pixel coordinates of the center of the second projection pattern are denoted as (x2, y2).
[0097] In step S1043 of this embodiment, the pixel offset is multiplied by the target ratio, and the product is the physical offset. For ease of description, the physical offset is denoted as (Δx, Δy), and can be calculated using the following formula:
[0098] △x = (D_actual / D) (x2-x1)
[0099] △y = (D_actual / D) (y2-y1)
[0100] In the above formula, D_actual / D is the target ratio, and (x2-x1) and (y2-y1) are the pixel row direction and pixel column direction components of the pixel offset, respectively.
[0101] In one possible embodiment, Figure 6 In the example shown, the injection port is circular, and step S1041 includes: obtaining the design radius of the injection port; determining the ratio between the design radius of the injection port and the radius of the first projected pattern as the target ratio. By using this embodiment, the isotropy of a circle is utilized to eliminate the influence of outliers in different directions, thereby more accurately calculating the target ratio and improving the accuracy of the calibration.
[0102] In this embodiment, for ease of description, it is assumed that the movement trajectory of the needle tip is also circular. Then, the first and second projected patterns can be as follows: Figure 7 As shown, Figure 7 The first projection pattern 71 is shown as a solid line, while the second projection pattern 72 is shown as a dashed line. A1 is the center of the second projection pattern, and r1 is the radius of the second projection pattern, while A2 is the center of the first projection pattern, and r2 is the radius of the first projection pattern.
[0103] Furthermore, it is understandable that since the design radius of the injection port is used as the physical size, and the radius of the first projected pattern is used as the size of the first projected pattern, then r2 is the size of the first projected pattern. If the design radius is taken as r2, then the aforementioned formula for calculating the physical offset can be rewritten as:
[0104] △x = (r²actual / r²) (x2-x1)
[0105] △y = (r²actual / r²) (y2-y1)
[0106] Understandably, the aforementioned Figure 6 Steps S1041 to S1043 are only one possible way to calculate the physical offset. In other possible embodiments, the physical offset can also be calculated in the following way: calculate the size of the movement trajectory of the needle tip in the needle tip coordinate system as the first size; perform a scaling transformation on the first size according to the scaling relationship between the calibrated needle tip coordinate system and the physical coordinate system, and use the transformation result as the second size; calculate the ratio between the second size and the size of the second projection pattern as the target ratio; determine the offset between the center of the first projection pattern and the center of the second projection pattern as the pixel offset; perform a scaling transformation on the pixel offset according to the target ratio, and use the transformation result as the physical offset.
[0107] Based on the same inventive concept, this application also provides a syringe position calibration device, see [link to relevant documentation]. Figure 8 The injection needle position calibration device includes:
[0108] A needle tip control module 801 is used to control the needle tip of the injection needle to first move horizontally at a preset height from the injection port and then move to the initial injection position, wherein the horizontal movement trajectory is centered on the initial injection position; an image acquisition module 802 is used to control an image acquisition device to acquire a first image including the injection port, and during the horizontal movement, control the image acquisition device to acquire multiple second images including the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images; a projection fitting module 803 is used to fit the projection of the injection port in the image coordinate system based on the first image, as a first projection pattern; and to fit the projection of the movement trajectory in the image coordinate system based on each of the second images, as a second projection pattern; an offset calculation module 804 is used to determine the physical offset in the horizontal direction between the initial injection position and the center of the injection port based on the offset between the center of the first projection pattern and the center of the second projection pattern. Based on the injection needle position calibration device provided in the embodiments of this application, the injection needle tip can be controlled to move horizontally and the injection needle can be photographed during the movement to obtain the movement trajectory of the injection needle. The position of the injection needle can then be calibrated based on the offset between the movement trajectory and the injection port. This eliminates the need to rely on human experience, thus reducing calibration costs and increasing calibration efficiency. Furthermore, since it is not affected by human observation errors, the calibration accuracy is high.
[0109] In one possible embodiment, the optical axis of the image acquisition device deviates from the central axis of the injection needle. The projection fitting module, based on the first image, fits the projection of the injection port in the image coordinate system as a first projection pattern. This includes: calculating the transformation relationship between the target image coordinate system and the image coordinate system of the first image based on the preset height and the calibration result of the image acquisition device, wherein the target image coordinate system is the image coordinate system of the image acquired by the image acquisition device when the optical axis coincides with the central axis; projecting the position of the contour point of the injection port in the first image to the target image coordinate system according to the transformation relationship to obtain a first projection position; and fitting each of the first projection positions to obtain the projection of the injection port in the image coordinate system as a first projection pattern. The projection fitting module, based on each of the second images, fits the projection of the motion trajectory in the image coordinate system as a second projection pattern. This includes: projecting the position of the needle tip in each of the second images to the target image coordinate system according to the transformation relationship to obtain a second projection position; and fitting each of the second projection positions to obtain the projection of the motion trajectory in the target image coordinate system as a second projection pattern.
[0110] In one possible embodiment, the projection fitting module fits each of the second projection positions to obtain the projection of the motion trajectory in the target image coordinate system as a second projection pattern, including: obtaining the shape of the motion trajectory of the needle tip in the needle tip coordinate system during the horizontal movement as a first shape; and fitting each of the second projection positions into a pattern of the first shape as a first projection pattern.
[0111] In one possible embodiment, the needle tip control module controls the needle tip of the injection needle to first move horizontally at a preset height from the injection port, including: acquiring the shape of the outer contour of the injection port as a second shape; planning a motion trajectory of the second shape centered on the initial injection position in the horizontal direction; and controlling the needle tip of the injection needle to move along the motion trajectory at a preset height from the injection port.
[0112] In one possible embodiment, the initial injection position is the origin of the needle tip coordinate system; the device further includes: a zero-point calibration module, used to control the needle tip to move the physical offset from the initial injection position, and to determine the coordinates of the needle tip in the needle tip coordinate system after the physical offset, as the new origin of the needle tip coordinate system.
[0113] In one possible embodiment, the zero-point calibration module controls the needle tip to move the physical offset from the initial injection position, including: if the physical offset is greater than a preset offset threshold, controlling the needle tip to move the physical offset from the initial injection position; the zero-point calibration module is further configured to keep the origin of the needle tip coordinate system unchanged if the physical offset is not greater than the preset offset threshold.
[0114] In one possible embodiment, the offset calculation module determines the physical offset in the horizontal direction between the initial injection position and the center of the injection port based on the offset between the center of the first projection pattern and the center of the second projection pattern, including: determining the ratio between the physical size of the injection port and the size of the first projection pattern as a target ratio; determining the offset between the center of the first projection pattern and the center of the second projection pattern as a pixel offset; performing a proportional transformation on the pixel offset according to the target ratio, and using the transformation result as the physical offset.
[0115] The injection port is circular; the offset calculation module determines the ratio between the physical size of the injection port and the size of the first projected pattern as a target ratio, including: obtaining the design radius of the injection port; and determining the ratio between the design radius of the injection port and the radius of the first projected pattern as a target ratio.
[0116] This application also provides an electronic device, such as... Figure 9 As shown, it includes:
[0117] Memory 901 is used to store computer programs;
[0118] When processor 902 executes a program stored in memory 901, it performs the following steps:
[0119] The needle tip of the injection needle is controlled to move horizontally at a preset height from the injection port before moving to the initial injection position, wherein the horizontal movement trajectory is centered on the initial injection position; an image acquisition device is controlled to acquire a first image including the injection port, and during the horizontal movement, the image acquisition device is controlled to acquire multiple second images including the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images; based on the first image, the projection of the injection port in the image coordinate system is fitted as a first projection pattern; and based on each of the second images, the projection of the movement trajectory in the image coordinate system is fitted as a second projection pattern; based on the offset between the center of the first projection pattern and the center of the second projection pattern, the physical offset in the horizontal direction between the initial injection position and the center of the injection port is determined.
[0120] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 902, communication interface, and memory 901 communicating with each other via the communication bus.
[0121] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0122] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0123] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0124] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be 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, or discrete hardware components.
[0125] In another embodiment provided in this application, an autosampler is also provided, including: a control terminal and an image acquisition device; the image acquisition device is used to acquire images under the control of the control terminal; the control terminal is used to execute any of the aforementioned injection needle position calibration methods.
[0126] In one possible embodiment, the optical axis of the image acquisition device is offset from the central axis of the injection needle; the control terminal is specifically used to execute... Figure 2 The method for calibrating the position of the injection needle.
[0127] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described injection needle position calibration methods.
[0128] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the injection needle position calibration methods described above.
[0129] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.
[0130] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0131] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the embodiments of autosamplers, devices, electronic devices, storage media, and program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0132] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for calibrating the position of an injection needle, characterized in that, The method includes: The tip of the injection needle is controlled to move horizontally at a preset height from the injection port and then move to the initial injection position, wherein the trajectory of the horizontal movement is centered on the initial injection position; The image acquisition device is controlled to acquire a first image including the injection port, and during the horizontal movement, the image acquisition device is controlled to acquire multiple second images including the needle tip and the injection port; wherein the pose of the image acquisition device is the same when acquiring the first image and each of the second images; Based on the first image, the projection of the injection port in the image coordinate system is fitted as a first projection pattern; and based on each of the second images, the projection of the motion trajectory in the image coordinate system is fitted as a second projection pattern. Based on the offset between the center of the first projection pattern and the center of the second projection pattern, the physical offset in the horizontal direction between the initial injection position and the center of the injection port is determined. Wherein, the optical axis of the image acquisition device is offset from the central axis of the injection needle and is positioned to the side of the injection needle; the step of fitting the projection of the injection port in the image coordinate system based on the first image, as the first projection pattern, includes: Based on the preset height and the calibration results of the image acquisition device, the transformation relationship between the target image coordinate system and the image coordinate system of the first image is calculated, wherein the target image coordinate system is the image coordinate system of the image acquired by the image acquisition device when the optical axis coincides with the central axis; According to the transformation relationship, the position of the contour point of the injection port in the first image is projected to the target image coordinate system to obtain the first projection position; and each of the first projection positions is fitted to obtain the projection of the injection port in the image coordinate system, which is used as the first projection pattern. The step of fitting the projection of the motion trajectory in the image coordinate system based on each of the second images, as a second projection pattern, includes: According to the transformation relationship, the position of the needle tip in each of the second images is projected into the target image coordinate system to obtain the second projection position; and each of the second projection positions is fitted to obtain the projection of the motion trajectory in the target image coordinate system as the second projection pattern.
2. The method of claim 1, wherein, The step of fitting each of the second projection positions to obtain the projection of the motion trajectory in the target image coordinate system, as the second projection pattern, includes: The shape of the needle tip's trajectory in the needle tip coordinate system during the horizontal movement is obtained as the first shape; Each of the second projection positions is fitted into a pattern of the first shape, which is then used as the second projection pattern.
3. The method according to claim 1, characterized in that, The control needle tip moves horizontally at a preset height from the injection port, including: Obtain the shape of the outer contour of the injection port as the second shape; The motion trajectory of the second shape centered on the initial injection position is planned in the horizontal direction; The tip of the injection needle is controlled to move along the motion trajectory at a preset height from the injection port.
4. The method according to claim 1, characterized in that, The initial injection position is the origin of the needle tip coordinate system; The method further includes: The needle tip is controlled to move from the initial injection position by the physical offset, and the coordinates of the needle tip after the physical offset are determined in the needle tip coordinate system, which is used as the new origin of the needle tip coordinate system.
5. The method according to claim 4, characterized in that, The control of the needle tip to move from the initial injection position by the physical offset includes: If the physical offset is greater than a preset offset threshold, then the needle tip is controlled to move from the initial injection position by the physical offset. The method further includes: If the physical offset is not greater than the preset offset threshold, then the origin of the needle tip coordinate system remains unchanged.
6. The method according to claim 1, characterized in that, Determining the physical offset in the horizontal direction between the initial injection position and the injection port center based on the offset between the center of the first projection pattern and the center of the second projection pattern includes: Determine the ratio between the physical size of the injection port and the size of the first projected pattern, as the target ratio; The offset between the center of the first projection pattern and the center of the second projection pattern is determined as the pixel offset; The pixel offset is proportionally transformed according to the target ratio, and the transformation result is used as the physical offset.
7. The method according to claim 6, characterized in that, The injection port is circular; determining the ratio between the physical size of the injection port and the size of the first projected pattern as the target ratio includes: Obtain the design radius of the injection port; The ratio between the design radius of the injection port and the radius of the first projected pattern is determined as the target ratio.
8. An automatic sampler, characterized in that, The autosampler includes: a control terminal and an image acquisition device; The image acquisition device is used to acquire images under the control of the control terminal; The control terminal is used to execute the method described in any one of claims 1-7; The optical axis of the image acquisition device is offset from the central axis of the injection needle and is positioned to the side of the injection needle; the control terminal is specifically used to execute: Based on the preset height and the calibration results of the image acquisition device, the transformation relationship between the target image coordinate system and the image coordinate system of the first image is calculated, wherein the target image coordinate system is the image coordinate system of the image acquired by the image acquisition device when the optical axis coincides with the central axis; According to the transformation relationship, the position of the contour point of the injection port in the first image is projected to the target image coordinate system to obtain the first projection position; and each of the first projection positions is fitted to obtain the projection of the injection port in the image coordinate system, which is used as the first projection pattern. According to the transformation relationship, the position of the needle tip in each of the second images is projected into the target image coordinate system to obtain the second projection position; and each of the second projection positions is fitted to obtain the projection of the motion trajectory in the target image coordinate system as the second projection pattern.