A position calibration method and related apparatus

CN120635190BActive Publication Date: 2026-10-09CAPITALBIO CORP +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510851236.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2026-10-09
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

但这种方法费时费力,且对操作人员的经验要求很高

Benefits of technology

[0047] By employing the above technical solution, the position calibration method and related apparatus provided in this application process the first image to obtain the coordinates of the target point, and the second image to obtain the coordinates of the needle-picking point. When the difference between the coordinates of the target point and the coordinates of the needle-picking point is not less than a threshold, affine transformation parameters are calculated based on the coordinates of the target point and the coordinates of the needle-picking point. A third image is then obtained and processed to obtain the coordinates of a new needle-picking point. The third image contains both the target point and the new needle-picking point, which is generated based on the affine transformation parameters and the coordinates of the target point. This process continues until the difference between the coordinates of the target point and the coordinates of the needle-picking point reaches the threshold, thus completing the needle-picking position calibration. This application obtains the coordinates of the needle-picking point through image processing and adjusts the coordinates of the needle-picking point by calculating affine transformation parameters based on the coordinates of the target point and the needle-picking point, ensuring that the difference between the coordinates of the needle-picking point and the coordinates of the target point is less than a threshold. This achieves automatic calibration of the needle-picking position without the need for manual calibration, saving time, improving efficiency, and reducing manpower.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635190B_ABST
    Figure CN120635190B_ABST
Patent Text Reader

Abstract

The application discloses a position calibration method and related device, and relates to the technical field of position calibration, and comprises the following steps: acquiring a first image, processing the first image, obtaining the coordinates of a target point, and the first image being an image with the target point; acquiring a second image, processing the second image, obtaining the coordinates of a needle drop point, and the second image being an image with the target point and the needle drop point; judging whether the difference between the coordinates of the target point and the coordinates of the needle drop point is less than a threshold value; if the difference is not less than the threshold value, calculating affine transformation parameters based on the coordinates of the target point and the coordinates of the needle drop point, acquiring and processing a third image to obtain the coordinates of a new needle drop point, and the third image being an image with the target point and the new needle drop point; judging the difference between the coordinates of the target point and the coordinates of the new needle drop point until the difference is less than the threshold value, and then completing needle position calibration. The application can automatically calibrate the position of the needle, and efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of position calibration technology, and in particular to a position calibration method and related apparatus. Background Technology

[0002] Needle placement calibration is the process of adjusting the actual landing point of the needle to coincide with the target position. Currently, most needle placement calibrations are performed manually, requiring multiple adjustments to the pixel X and Y scaling ratios and the X and Y offset distances of the reference point to ensure the actual landing point of the needle matches the target position, thus achieving the goal of accurately picking up the colony. However, this method is time-consuming, labor-intensive, and requires a high level of experience from the operator. Summary of the Invention

[0003] In view of the above problems, this application provides a position calibration method and related device, which can automatically calibrate the needle picking position, saving time, improving efficiency, and saving manpower. The specific solution is as follows:

[0004] The first aspect of this application provides a position calibration method, comprising:

[0005] A first image is acquired, and the first image is processed to obtain the coordinates of the target point; wherein, the first image is an image containing the target point;

[0006] A second image is acquired and processed to obtain the coordinates of the needle landing point; wherein, the second image is an image containing the target point and the needle landing point;

[0007] Determine whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than a threshold.

[0008] If the phase difference is not less than the threshold, then the affine transformation parameters are calculated based on the coordinates of the target point and the coordinates of the needle landing point. The third image is then obtained and processed to obtain the coordinates of the new needle landing point. Then, the process returns to the step "determine whether the phase difference between the coordinates of the target point and the coordinates of the needle landing point is less than the threshold". The third image is an image containing the target point and the new needle landing point, which is generated based on the affine transformation parameters and the coordinates of the target point.

[0009] If the phase difference is less than the threshold, the needle picking position calibration is completed.

[0010] In one possible implementation, processing the first image to obtain the coordinates of the target point includes:

[0011] Determine the segmentation region of the target point in the first image;

[0012] Calculate the morphological parameters of the segmented region of the target point to obtain the first morphological parameter;

[0013] If the morphological parameters meet the preset conditions, the centroid coordinates of the segmented region of the target point are used as the coordinates of the target point.

[0014] In one possible implementation, processing the second image to obtain the coordinates of the needle landing point includes:

[0015] Remove the target point from the second image and retain the needle landing point in the second image to obtain the processed image;

[0016] Determine the segmented region of the needle landing point in the processed image;

[0017] Calculate the morphological parameters of the segmented region at the needle landing point to obtain the second morphological parameters;

[0018] When the second morphological parameter meets the preset conditions, the centroid coordinates of the segmented region of the needle landing point are used as the coordinates of the needle landing point.

[0019] In one possible implementation, the target point in the second image is a first color, and the point where the needle lands is a second color, wherein the first color and the second color are different.

[0020] The step of removing the target point from the second image and retaining the needle landing point in the second image to obtain the processed image includes:

[0021] Determine the second color component of each pixel in the second image;

[0022] The pixel values ​​of pixels whose second color components are within a preset range are kept unchanged, while the pixel values ​​of pixels whose second color components are not within the preset range are set to 0, thus obtaining the processed image.

[0023] In one possible implementation, determining whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than a threshold includes:

[0024] Calculate the distance from one of the needle landing points to multiple target points to obtain multiple distances;

[0025] Select the target point corresponding to the closest distance from the multiple distances to obtain the selected target point;

[0026] Determine whether the difference between the coordinates of the selected target point and the landing point of the needle is less than a threshold.

[0027] A second aspect of this application provides a position calibration device, comprising:

[0028] Needle-picking device and imaging device;

[0029] The imaging device is mounted on the needle-picking device;

[0030] The imaging device is used to capture a first image of the calibration fixture with the target point, and to capture a second image of the calibration fixture with the target point and the needle drop point.

[0031] The needle-picking device is used to acquire the first image and the second image, process the first image to obtain the coordinates of the target point, process the second image to obtain the coordinates of the needle-picking point, determine whether the difference between the coordinates of the target point and the coordinates of the needle-picking point is less than a threshold; if the difference is not less than the threshold, then affine transformation parameters are calculated based on the coordinates of the target point and the coordinates of the needle-picking point, a third image is acquired and processed to obtain the coordinates of a new needle-picking point, and then the process returns to the step "determine whether the difference between the coordinates of the target point and the coordinates of the needle-picking point is less than a threshold"; wherein, the third image is an image containing the target point and the new needle-picking point, and the new needle-picking point is generated based on the affine transformation parameters and the coordinates of the target point; if the difference is less than the threshold, then the needle-picking position calibration is completed.

[0032] One possible implementation also includes:

[0033] Distance measuring device;

[0034] The ranging device is mounted on the needle-picking device;

[0035] The ranging device is used to measure the distance from the imaging device to the calibration fixture.

[0036] A third aspect of this application provides a position calibration system, comprising:

[0037] A first image processing module is used to acquire a first image, process the first image, and obtain the coordinates of a target point; wherein, the first image is an image containing the target point;

[0038] The second image processing module is used to acquire a second image, process the second image, and obtain the coordinates of the needle landing point; wherein, the second image is an image having the target point and the needle landing point;

[0039] The judgment module is used to determine whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than a threshold.

[0040] An adjustment module is used to calculate affine transformation parameters based on the coordinates of the target point and the coordinates of the needle landing point when the phase difference is not less than the threshold, obtain and process the third image to obtain the coordinates of the new needle landing point, and then execute the judgment module; wherein, the third image is an image with the target point and the new needle landing point, and the new needle landing point is generated based on the affine transformation parameters and the coordinates of the target point;

[0041] The completion module is used to complete the needle picking position calibration when the phase difference is less than the threshold.

[0042] A fourth aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the position calibration method described in the first aspect or any implementation thereof.

[0043] A fifth aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0044] The memory is used to store computer programs;

[0045] The processor is used to execute the computer program so that the electronic device can implement the position calibration method of the first aspect or any implementation thereof.

[0046] The sixth aspect of this application provides a computer storage medium carrying one or more computer programs that, when executed by an electronic device, enable the electronic device to perform the position calibration method described in the first aspect or any implementation thereof.

[0047] By employing the above technical solution, the position calibration method and related apparatus provided in this application process the first image to obtain the coordinates of the target point, and the second image to obtain the coordinates of the needle-picking point. When the difference between the coordinates of the target point and the coordinates of the needle-picking point is not less than a threshold, affine transformation parameters are calculated based on the coordinates of the target point and the coordinates of the needle-picking point. A third image is then obtained and processed to obtain the coordinates of a new needle-picking point. The third image contains both the target point and the new needle-picking point, which is generated based on the affine transformation parameters and the coordinates of the target point. This process continues until the difference between the coordinates of the target point and the coordinates of the needle-picking point reaches the threshold, thus completing the needle-picking position calibration. This application obtains the coordinates of the needle-picking point through image processing and adjusts the coordinates of the needle-picking point by calculating affine transformation parameters based on the coordinates of the target point and the needle-picking point, ensuring that the difference between the coordinates of the needle-picking point and the coordinates of the target point is less than a threshold. This achieves automatic calibration of the needle-picking position without the need for manual calibration, saving time, improving efficiency, and reducing manpower. Attached Figure Description

[0048] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0049] Figure 1 A flowchart of a position calibration method provided in this application;

[0050] Figure 2 The first image provided for this application is a schematic diagram;

[0051] Figure 3 A schematic diagram of the first image size provided for this application;

[0052] Figure 4 The second image provided in this application is a schematic diagram;

[0053] Figure 5 A schematic diagram of the image after position calibration provided in this application;

[0054] Figure 6 A schematic diagram of a position calibration device provided in this application;

[0055] Figure 7 A schematic diagram of another position calibration device provided in this application;

[0056] Figure 8 A structural diagram of a position calibration system provided in this application;

[0057] Figure 9 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation

[0058] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0059] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0060] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0061] Reference Figure 1 , Figure 1 This is a flowchart illustrating a position calibration method provided in an embodiment of this application, as shown below. Figure 1 As shown in the embodiment of this application, a position calibration method may include steps 101 to 105, which are described in detail below.

[0062] Step 101: Obtain the first image, process the first image, and obtain the coordinates of the target point; wherein, the first image is an image containing the target point.

[0063] Before the needle picks up the target point, an image can be acquired of the calibration fixture to obtain a first image. One or more target points are set on the calibration fixture. For multiple target points, they can be arranged in a dot matrix on the calibration fixture. For example, if there are 35 target points, they can be arranged in a grid of 5 rows and 7 columns. By acquiring an image of the calibration fixture with the target points, the first image can be obtained. Figure 2 This is a schematic diagram of the first image. Image recognition algorithms can be used to analyze the first image and calculate the coordinates of the target point on the calibration fixture.

[0064] In one possible implementation, the first image is processed to obtain the coordinates of the target point, including:

[0065] Determine the segmentation region of the target point in the first image;

[0066] Calculate the morphological parameters of the segmented region of the target point to obtain the first morphological parameters;

[0067] If the morphological parameters meet the preset conditions, the centroid coordinates of the segmented region of the target point are used as the coordinates of the target point.

[0068] When determining the segmentation region of a target point in the first image, the Otsu algorithm can be used to calculate a threshold to obtain the segmentation region of the target point. This segmentation region indicates the area where the target point is located. Then, the morphological parameters of the segmentation region of the target point are calculated to obtain the first morphological parameter, which may include roundness and radius. If the roundness is greater than a preset value and the radius is within a preset range, the morphological parameters are determined to meet the preset conditions, and the centroid coordinates of the segmentation region of the target point can be used as the coordinates of the target point. If the morphological parameters do not meet the preset conditions, the corresponding target point can be removed.

[0069] In the first image, the target point is black and the background is white. The default detection area for the target point is the white outline. Therefore, the first image can be inverted before determining the segmentation area of ​​the target point. The segmentation area of ​​the target point can then be determined after obtaining the inverted image and then converted to grayscale.

[0070] Furthermore, the rows formed by the target points in the first image may be at an angle to the horizontal axis of the coordinate system, and the columns formed by the target points may also be at an angle to the vertical axis of the coordinate system. Therefore, the projection peak can be calculated using Radon transform with the center of the first image as the center. The angle corresponding to the maximum projection peak is the array rotation angle. Based on this array rotation angle, the rows formed by the target points in the first image can be made parallel to the horizontal axis of the coordinate system, and the columns formed by the target points can also be made parallel to the vertical axis of the coordinate system.

[0071] The first image is processed to obtain the coordinates of the target points. If there are 35 target points, and these target points are all points that meet the preset requirements, then the coordinates of 35 target points can be obtained. )……( ).like Figure 3 As shown, the length of the calibration fixture is 118mm, the width is 81mm, the distance between the two target points is 15mm, and the diameter of the target point is 1.5mm.

[0072] Step 102: Obtain the second image, process the second image to obtain the coordinates of the needle landing point; wherein, the second image is an image with the target point and the needle landing point.

[0073] When the needle picks up the target point based on the initial affine transformation parameters, it creates a needle landing point on the calibration fixture. At this point, an image can be acquired from the calibration fixture to obtain a second image. The number of needle landing points can be the same as the number of target points. For example, if there are 35 target points, the number of needle landing points is also 35. By acquiring images of the calibration fixture containing both the target points and the needle landing points, a second image can be obtained. Figure 4 This is a schematic diagram of the second image. Figure 4In the image, the black dot represents the target point, and the red dot represents the needle landing point. Image recognition algorithms can be used to analyze the second image and calculate the coordinates of the needle landing point on the calibration fixture.

[0074] In one possible implementation, the second image is processed to obtain the coordinates of the needle's landing point, including:

[0075] Remove the target point from the second image and retain the needle landing point in the second image to obtain the processed image;

[0076] Determine the segmentation region of the needle landing point in the processed image;

[0077] Calculate the morphological parameters of the segmented region at the needle landing point to obtain the second morphological parameters;

[0078] If the second morphological parameter meets the preset conditions, the centroid coordinates of the segmented region of the needle landing point are used as the coordinates of the needle landing point.

[0079] To obtain the coordinates of the needle-picking point, the target point in the second image can be removed, leaving only the needle-picking point in the second image, resulting in the processed image. When determining the segmentation region of the needle-picking point in the processed image, the Otsu algorithm can be used to calculate a threshold to obtain the segmentation region, which indicates the area where the needle-picking point is located. Then, the morphological parameters of the segmentation region are calculated to obtain the second morphological parameter, which may include roundness and radius. If the roundness is greater than a preset value and the radius is within a preset range, the morphological parameters satisfy the preset conditions, and the centroid coordinates of the segmentation region can be used as the coordinates of the needle-picking point. If the morphological parameters do not meet the preset conditions, the corresponding needle-picking point can be discarded.

[0080] Optionally, the target point in the second image is colored as a first color, and the needle landing point is colored as a second color, with the first and second colors being different. A special material can be used to make the needle landing point mark appear in the image as the second color; this second color can be red, while the first color is black.

[0081] In one possible implementation, the target point in the second image is removed, while the needle landing point in the second image is retained, resulting in a processed image, including:

[0082] Determine the second color component of each pixel in the second image;

[0083] The pixel values ​​of pixels whose second color component is within a preset range are kept unchanged, while the pixel values ​​of pixels whose second color component is not within the preset range are set to 0, thus obtaining the processed image.

[0084] The second image is an RGB image. If the second color is red, the red component of each pixel in the second image can be determined. The pixel values ​​of the red components of the pixels within the preset range are kept unchanged, and the pixel values ​​of the red components of the pixels outside the preset range are set to 0. That is, the threshold processing of the RGB image R channel is retained within a certain threshold range, and the others are 0, so that the black points of the second image are removed and only the red needle landing points are left.

[0085] After obtaining an image containing only red needle-picking points, binarization can be performed on this image to obtain a binarized image. Then, the segmented regions containing the needle-picking points in the binarized image are determined, and the circularity and radius of these segmented regions are calculated. If they meet preset conditions, the centroid coordinates of the segmented regions can be used as the coordinates of the needle-picking points. That is, if both the number of needle-picking points and the number of target points are 35, and all of them meet the conditions, then the final coordinates of 35 needle-picking points are obtained. )……( ).

[0086] Step 103: Determine whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than the threshold; if yes, proceed to step 105; otherwise, proceed to step 104.

[0087] In one possible implementation, determining whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than a threshold includes:

[0088] Calculate the distance from a needle landing point to multiple target points to obtain multiple distances;

[0089] Select the target point corresponding to the closest distance from multiple distances to obtain the selected target point;

[0090] Determine whether the difference between the coordinates of the selected target point and the point where the needle lands is less than a threshold.

[0091] When calculating the distance from a needle-picking point to multiple target points, one needle-picking point can be selected. Assuming there are 35 needle-picking points and 35 target points, if the coordinates of this needle-picking point (… Then the coordinates of the needle landing point can be calculated. ) to the coordinates of 35 target points respectively ( )……( The distances are calculated, resulting in multiple distances. The target point corresponding to the closest distance is selected from these distances. For example, the target point corresponding to the closest distance is ( ). Then the target point can be determined. ) and the coordinates of the needle landing point ( Is the difference between the two values ​​less than the threshold? Then, for the coordinates of the next needle landing point ( The corresponding target points are obtained in the same way as above. Then, it is determined whether the difference between the coordinates of the selected target point and the needle landing point is less than the threshold, until all needle landing points are selected.

[0092] When determining whether the difference between the coordinates of the selected target point and the needle landing point is less than a threshold, one method is to check whether the difference between the x-coordinate of the target point and the x-coordinate of the needle landing point is less than the threshold, and whether the difference between the y-coordinate of the target point and the y-coordinate of the needle landing point is less than the threshold. This threshold can be 0.1 mm or other values. Another method is to calculate whether the distance between the target point and the needle landing point is less than the threshold based on the coordinates of the selected target point and the needle landing point. When calculating the distance between the target point and the needle landing point, the square of the difference between the x-coordinate of the target point and the x-coordinate of the needle landing point can be calculated to obtain the first square, and the square of the difference between the y-coordinate of the target point and the y-coordinate of the needle landing point can be calculated to obtain the second square. The first square and the second square are summed and the square root is taken to obtain the distance between the target point and the needle landing point.

[0093] Step 104: Calculate the affine transformation parameters based on the coordinates of the target point and the needle landing point, obtain and process the third image to obtain the coordinates of the new needle landing point, and then return to step 103; wherein, the third image is an image with the target point and the new needle landing point, and the new needle landing point is generated based on the affine transformation parameters and the coordinates of the target point.

[0094] After calculating the affine transformation parameters based on the coordinates of the target point and the landing point of the needle, the needle is picked up again according to the coordinates of the target point based on the calculated simulation transformation parameters. Then, the calibration fixture is image acquired to obtain the third image.

[0095] After processing the third image to obtain the coordinates of the new needle landing point, it is then determined whether the difference between the coordinates of the target point and the coordinates of the new needle landing point is less than a threshold. If yes, step 105 is executed. If no, the affine transformation parameters are calculated based on the coordinates of the target point and the coordinates of the new needle landing point. Then, the image is re-acquired and processed to obtain the coordinates of the needle landing point again. This process continues until the difference between the coordinates of the obtained needle landing point and the coordinates of the target point is less than the threshold, at which point step 105 is executed.

[0096] Based on the coordinates of the target point and the point where the needle lands, the rotation and translation matrices of the affine transformation can be calculated using the least squares method. The specific formulas are as follows:

[0097] = +

[0098] In the formula, ( , () represents the coordinates of the target point. Let x be the x-coordinate of the target point. Let be the ordinate of the target point, ( , () represents the coordinates of the point where the needle lands. The x-coordinate of the point where the needle lands. The vertical coordinate of the point where the needle lands is denoted as . For rotation matrix, Let a, b, c, d be the movement matrix. , These are the affine transformation parameters.

[0099] Step 105: Complete needle picking position calibration.

[0100] The needle placement calibration is completed when the difference between the coordinates of the target point and the coordinates of the needle landing point is less than a threshold. The positional relationship between the target point and the needle landing point at this time can be found in [reference needed]. Figure 5 , Figure 5 In the diagram, the black dot represents the target point, and the red dot represents the needle placement point. By calibrating the needle position, the needle placement point can be made to coincide with the target point, or with minimal deviation.

[0101] This application obtains the coordinates of the needle-picking point through image processing, and calculates affine transformation parameters based on the coordinates of the target point and the needle-picking point to adjust the coordinates of the needle-picking point, so that the difference between the coordinates of the needle-picking point and the coordinates of the target point is less than a threshold. This achieves automatic calibration of the needle-picking position without the need for manual calibration, saving time, improving efficiency, and saving manpower.

[0102] The above describes a position calibration method provided by the embodiments of this application. The position calibration device will be described below.

[0103] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a position calibration device provided in an embodiment of this application. Figure 6 As shown, the position calibration device includes:

[0104] Needle picking device 1 and imaging device 2.

[0105] The imaging device 2 is mounted on the needle picking device 1.

[0106] The imaging device is used to capture images of the calibration fixture with the target point to obtain a first image, and to capture images of the calibration fixture with the target point and the needle drop point to obtain a second image.

[0107] The needle-picking device is used to acquire a first image and a second image, process the first image to obtain the coordinates of the target point, process the second image to obtain the coordinates of the needle-picking point, determine whether the difference between the coordinates of the target point and the coordinates of the needle-picking point is less than a threshold, if the difference is not less than the threshold, calculate the affine transformation parameters based on the coordinates of the target point and the coordinates of the needle-picking point, acquire and process a third image to obtain the coordinates of a new needle-picking point, and then return to the step "determine whether the difference between the coordinates of the target point and the coordinates of the needle-picking point is less than the threshold"; wherein, the third image is an image with the target point and the new needle-picking point, the new needle-picking point is generated based on the affine transformation parameters and the coordinates of the target point; if the difference is less than the threshold, the needle-picking position calibration is completed.

[0108] like Figure 6 As shown, the imaging device 2 is mounted on the needle-picking device 1. Moving the imaging device 2 above the fixture allows the distance H between the imaging device 2 and the imaging surface to be set to 160mm. The imaging device 2 takes an image at a position 160mm from the fixture surface. The imaging device parameters can be 4000 pixels in the X direction and 3000 pixels in the Y direction. The needle-picking device can be a 96-needle picking system, and the imaging device can be a CCD (Charge-Coupled Device).

[0109] In one possible implementation, the position calibration device further includes:

[0110] Distance measuring device 3.

[0111] The distance measuring device 3 is installed on the needle picking device 1.

[0112] The ranging device 3 is used to measure the distance from the imaging device 2 to the calibration fixture.

[0113] The ranging device can be an ultrasonic ranging sensor.

[0114] like Figure 7 As shown, the ultrasonic ranging sensor is moved above the fixture to measure the height of the fixture. The distance between the CCD and the imaging surface is set to 160mm. This distance is measured by the ultrasonic ranging sensor to measure the height of the imaging surface, and then the imaging device is controlled to move to a distance of 160mm from the imaging surface.

[0115] Of course, the position calibration device may also include a backlight system.

[0116] During needle position calibration, an ultrasonic ranging sensor is positioned above the fixture to measure its height. The imaging device then moves in the Z-axis to a fixed distance H from the fixture surface, taking a picture to obtain the first image. An image recognition algorithm identifies the positions of 35 target points on the fixture. Based on these positions, the needle is selected, and the selected surface of the fixture is photographed to obtain the second image. The image recognition algorithm then identifies the needle's landing point. The difference between the target point's position and the needle's landing point is analyzed. If the requirements are not met, affine transformation parameters are calculated, yielding the X and Y scaling ratios and X and Y offset values. These calculated parameters control the needle to reselect, and a third image is taken after each selection. Calibration continues until the accuracy is satisfactory.

[0117] The system for performing the above-described position calibration method will be described below.

[0118] Please see Figure 8 , Figure 8 This is a schematic diagram of a position calibration system provided in an embodiment of this application. Figure 8 As shown, the position calibration system includes:

[0119] The first image processing module 801 is used to acquire a first image, process the first image, and obtain the coordinates of the target point; wherein, the first image is an image with the target point.

[0120] The second image processing module 802 is used to acquire a second image, process the second image, and obtain the coordinates of the needle landing point; wherein, the second image is an image with a target point and the needle landing point.

[0121] The judgment module 803 is used to determine whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than a threshold; if yes, the completion module 805 is executed; if no, the adjustment module 804 is executed.

[0122] The adjustment module 804 is used to calculate the affine transformation parameters based on the coordinates of the target point and the coordinates of the needle landing point when the phase difference is not less than the threshold, obtain and process the third image to obtain the coordinates of the new needle landing point, and then execute the judgment module 803; wherein, the third image is an image with the target point and the new needle landing point, and the new needle landing point is generated based on the affine transformation parameters and the coordinates of the target point.

[0123] The completion module 805 is used to complete the needle picking position calibration when the phase difference is less than the threshold.

[0124] In one possible implementation, the first image processing module 801 is specifically used for:

[0125] Determine the segmentation region of the target point in the first image;

[0126] Calculate the morphological parameters of the segmented region of the target point to obtain the first morphological parameters;

[0127] If the morphological parameters meet the preset conditions, the centroid coordinates of the segmented region of the target point are used as the coordinates of the target point.

[0128] In one possible implementation, the second image processing module 802 is specifically used for:

[0129] Remove the target point from the second image and retain the needle landing point in the second image to obtain the processed image;

[0130] Determine the segmentation region of the needle landing point in the processed image;

[0131] Calculate the morphological parameters of the segmented region at the needle landing point to obtain the second morphological parameters;

[0132] If the second morphological parameter meets the preset conditions, the centroid coordinates of the segmented region of the needle landing point are used as the coordinates of the needle landing point.

[0133] Optionally, the target point in the second image is colored as the first color, and the point where the needle lands is colored as the second color, wherein the first color and the second color are different;

[0134] In one possible implementation, the second image processing module 802 is further configured to:

[0135] Determine the second color component of each pixel in the second image;

[0136] The pixel values ​​of pixels whose second color component is within a preset range are kept unchanged, while the pixel values ​​of pixels whose second color component is not within the preset range are set to 0, thus obtaining the processed image.

[0137] In one possible implementation, the decision module 803 is specifically used for:

[0138] Calculate the distance from a needle landing point to multiple target points to obtain multiple distances;

[0139] Select the target point corresponding to the closest distance from multiple distances to obtain the selected target point;

[0140] Determine whether the difference between the coordinates of the selected target point and the point where the needle lands is less than a threshold.

[0141] This application also provides an electronic device in its embodiments. (See reference...) Figure 9The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 9 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0142] like Figure 9 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. When the electronic device is powered on, the RAM 903 also stores various programs and data required for the operation of the electronic device. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0143] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, memory cards, hard drives, etc.; and communication devices 909. Communication device 909 allows electronic devices to exchange data via wireless or wired communication with other devices. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.

[0144] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the position calibration methods provided in this application.

[0145] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the position calibration methods provided in this application.

[0146] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0147] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0148] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0149] 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 may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, 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 may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A position calibration method, characterized in that, include: A first image is acquired, and the first image is processed to obtain the coordinates of the target point; wherein, the first image is an image containing the target point; A second image is acquired and processed to obtain the coordinates of the needle landing point; wherein, the second image is an image containing the target point and the needle landing point; Determine whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than a threshold. If the difference is not less than the threshold, then the affine transformation parameters are calculated based on the coordinates of the target point and the coordinates of the needle landing point. The third image is then obtained and processed to obtain the coordinates of the new needle landing point. Then, the process returns to the step "determine whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than the threshold". The third image is an image containing the target point and the new needle landing point, and the new needle landing point is generated based on the affine transformation parameters and the coordinates of the target point. If the phase difference is less than the threshold, the needle position calibration is completed; The step of processing the second image to obtain the coordinates of the needle landing point includes: removing the target point from the second image and retaining the needle landing point in the second image to obtain a processed image; determining the segmented region of the needle landing point in the processed image; calculating the morphological parameters of the segmented region of the needle landing point to obtain a second morphological parameter; and using the centroid coordinates of the segmented region of the needle landing point as the coordinates of the needle landing point when the second morphological parameter meets a preset condition. In the second image, the target point is colored as a first color, and the needle landing point is colored as a second color, wherein the first color and the second color are different; removing the target point from the second image and retaining the needle landing point in the second image to obtain the processed image includes: determining the second color component of each pixel in the second image; keeping the pixel values ​​whose second color components are within a preset range unchanged, and setting the pixel values ​​whose second color components are not within the preset range to 0, thereby obtaining the processed image.

2. The position calibration method according to claim 1, characterized in that, The step of processing the first image to obtain the coordinates of the target point includes: Determine the segmentation region of the target point in the first image; Calculate the morphological parameters of the segmented region of the target point to obtain the first morphological parameter; If the morphological parameters meet the preset conditions, the centroid coordinates of the segmented region of the target point are used as the coordinates of the target point.

3. The position calibration method according to any one of claims 1 to 2, characterized in that, The step of determining whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than a threshold includes: Calculate the distance from one of the needle landing points to multiple target points to obtain multiple distances; Select the target point corresponding to the closest distance from the multiple distances to obtain the selected target point; Determine whether the difference between the coordinates of the selected target point and the landing point of the needle is less than a threshold.

4. A position calibration device, characterized in that, include: Needle-picking device and imaging device; The imaging device is mounted on the needle-picking device; The imaging device is used to capture a first image of the calibration fixture with the target point, and to capture a second image of the calibration fixture with the target point and the needle drop point. The needle-picking device is used to acquire the first image and the second image, process the first image to obtain the coordinates of the target point, process the second image to obtain the coordinates of the needle-picking point, determine whether the difference between the coordinates of the target point and the coordinates of the needle-picking point is less than a threshold; if the difference is not less than the threshold, then affine transformation parameters are calculated based on the coordinates of the target point and the coordinates of the needle-picking point, a third image is acquired and processed to obtain the coordinates of a new needle-picking point, and then the process returns to the step "determine whether the difference between the coordinates of the target point and the coordinates of the needle-picking point is less than a threshold"; wherein, the third image is an image containing the target point and the new needle-picking point, and the new needle-picking point is generated based on the affine transformation parameters and the coordinates of the target point; if the difference is less than the threshold, then the needle-picking position calibration is completed; The step of processing the second image to obtain the coordinates of the needle landing point includes: removing the target point from the second image and retaining the needle landing point in the second image to obtain a processed image; determining the segmented region of the needle landing point in the processed image; calculating the morphological parameters of the segmented region of the needle landing point to obtain a second morphological parameter; and using the centroid coordinates of the segmented region of the needle landing point as the coordinates of the needle landing point when the second morphological parameter meets a preset condition. In the second image, the target point is colored as a first color, and the needle landing point is colored as a second color, wherein the first color and the second color are different; removing the target point from the second image and retaining the needle landing point in the second image to obtain the processed image includes: determining the second color component of each pixel in the second image; keeping the pixel values ​​whose second color components are within a preset range unchanged, and setting the pixel values ​​whose second color components are not within the preset range to 0, thereby obtaining the processed image.

5. The position calibration device according to claim 4, characterized in that, Also includes: Distance measuring device; The ranging device is mounted on the needle-picking device; The ranging device is used to measure the distance from the imaging device to the calibration fixture.

6. A position calibration system, characterized in that, include: A first image processing module is used to acquire a first image, process the first image, and obtain the coordinates of a target point; wherein, the first image is an image containing the target point; The second image processing module is used to acquire a second image, process the second image, and obtain the coordinates of the needle landing point; wherein, the second image is an image having the target point and the needle landing point; The judgment module is used to determine whether the difference between the coordinates of the target point and the coordinates of the needle landing point is less than a threshold. An adjustment module is used to calculate affine transformation parameters based on the coordinates of the target point and the coordinates of the needle landing point when the phase difference is not less than the threshold, obtain and process the third image to obtain the coordinates of the new needle landing point, and then execute the judgment module; wherein, the third image is an image with the target point and the new needle landing point, and the new needle landing point is generated based on the affine transformation parameters and the coordinates of the target point; The completion module is used to complete the needle picking position calibration when the phase difference is less than the threshold. The step of processing the second image to obtain the coordinates of the needle landing point includes: removing the target point from the second image and retaining the needle landing point in the second image to obtain a processed image; determining the segmented region of the needle landing point in the processed image; calculating the morphological parameters of the segmented region of the needle landing point to obtain a second morphological parameter; and using the centroid coordinates of the segmented region of the needle landing point as the coordinates of the needle landing point when the second morphological parameter meets a preset condition. In the second image, the target point is colored as a first color, and the needle landing point is colored as a second color, wherein the first color and the second color are different; removing the target point from the second image and retaining the needle landing point in the second image to obtain the processed image includes: determining the second color component of each pixel in the second image; keeping the pixel values ​​whose second color components are within a preset range unchanged, and setting the pixel values ​​whose second color components are not within the preset range to 0, thereby obtaining the processed image.

7. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the position calibration method as described in any one of claims 1 to 3.

8. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the position calibration method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Rapid image registration and calibration method and system for implementing same

    CN102542569A

  • Correction method, device and system of puncturing system

    CN108335326A