Structural center calibration method, calibration device, equipment and storage medium
By using the image acquisition device to rotate the image card and calculate the offset data, the precise alignment between the image acquisition device and the image card is achieved, which solves the problem of large errors in the traditional positioning method, and improves the detection accuracy and image acquisition quality.
Patent Information
- Application Number
- CN202411768365.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-04
AI Technical Summary
There are errors in the installation and positioning process between traditional image acquisition equipment and image cards, resulting in limited detection accuracy and the laser level cannot guarantee accurate positioning.
By rotating the image card with the image acquisition device, the position information of the center feature point of the picture card at different rotation angles is obtained, the offset data from the center axis of the calibrated structure to the center feature point of the picture card is calculated, and the position of the calibrated structure is adjusted so that the center axis is aligned with the center feature point of the picture card is adjusted.
It realizes accurate alignment between the image acquisition device and the image card, reduces errors during machining and assembly, and improves detection accuracy and image acquisition quality.
Smart Images

Figure CN119741209A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of visual inspection technology, and in particular to a structure center calibration method, calibration device, equipment and storage medium. Background Art
[0002] In recent years, with the widespread popularity of digital products such as smart phones and tablets, and the continuous increase in consumer demand for high-quality images and video content, image acquisition devices, as the core components that determine the imaging quality of digital products, have become increasingly important. The quality and performance of image acquisition devices are not only directly related to user satisfaction, but also become one of the key indicators for measuring product competitiveness.
[0003] However, in the production and testing of image acquisition equipment, a large number of image cards are used. Due to the complexity and high standards of the field of visual inspection technology itself, it is currently facing many technical challenges. Particularly critical is the installation and positioning process between the image card and the image acquisition device (for example, camera module), which directly determines the accuracy and reliability of subsequent tests. Given that the image card itself lacks obvious mechanical positioning features, traditional positioning methods, such as relying on laser levels for manual alignment, not only have errors that are difficult to avoid with the naked eye, but may also cause potential damage to the image card due to direct laser irradiation, thereby limiting further improvements in detection accuracy. In addition, the laser level cannot guarantee the installation position of the image acquisition device (for example, camera module) and the precise positioning between the image card.
[0004] Therefore, how to achieve accurate positioning between the installation position of the image acquisition device and the image card has become an important issue that needs to be solved urgently. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a structure center calibration method, calibration device, equipment and storage medium, which can effectively solve the problems of large errors in naked eye observation and inability to accurately position when using a laser level to make positioning lines on the chart for alignment due to the lack of mechanical features in the chart plane in the traditional positioning method.
[0006] In a first aspect, an embodiment of the present application provides a structure center calibration method, comprising:
[0007] The image acquisition device is used to rotate and shoot the image card to obtain the position information of the central feature point of the image card at multiple different rotation angles;
[0008] Calculating the plurality of position information to determine the offset data from the central axis of the installation position of the calibrated structure to the central feature point of the chart; wherein the image acquisition device is mounted on the calibrated structure;
[0009] The position of the calibrated structure is adjusted by using the offset data so that the central axis of the installation position of the calibrated structure is aligned with the central feature point of the chart.
[0010] In some embodiments, the step of rotating and photographing a picture card using an image acquisition device to obtain position information of a central feature point of the picture card at different rotation angles includes:
[0011] Based on a preset rotation angle, controlling the image acquisition device to rotate four times in sequence on the calibrated structure;
[0012] The coordinate position information of the central feature point of the image card at different rotation angles is captured and identified.
[0013] In some embodiments, the step of calculating the plurality of position information to determine the offset data from the central axis of the installation position of the calibrated structure to the central feature point of the chart includes:
[0014] Obtaining the coordinate values of the central feature points of the image card in the plurality of position information and performing average calculation to determine the coordinate value of the central axis of the installation position of the calibrated structure in the image;
[0015] Based on the coordinate value of the central feature point of the chart and the coordinate value of the central axis of the installation position of the calibrated structure in the image, the offset direction and offset amount of the central axis of the installation position of the calibrated structure to the central feature point of the chart are determined.
[0016] In some embodiments, the step of calculating the plurality of position information to determine the offset data from the central axis of the installation position of the calibrated structure to the central feature point of the chart includes:
[0017] Acquire the coordinate values of the central feature points of the image card in the plurality of position information, and establish corresponding initial vectors between the coordinate origin and the plurality of central feature points of the image card;
[0018] According to the rotation direction and rotation angle of the image acquisition device, the captured images are rotated in sequence to determine the transformation vector after the initial vector is rotated;
[0019] An offset vector is obtained by averaging a plurality of the transformation vectors, wherein the offset vector is a vector between a central axis of the installation position of the calibrated structure and a central feature point of the chart;
[0020] Based on the offset vector, the offset direction and the offset amount from the central axis of the installation position of the calibrated structure to the central feature point of the chart are determined.
[0021] In some embodiments, the step of establishing corresponding initial vectors between a plurality of central feature points of the image card and the coordinate origin according to the coordinate values in the plurality of position information includes:
[0022] The virtual fixed-point coordinates are introduced to decompose the initial vector into the sum of a first vector and a second vector, wherein the virtual fixed-point coordinates are the coordinates of the central axis of the installation position of the calibrated structure in the image, the first vector is a vector from the coordinate origin to the coordinates of the central axis of the installation position of the calibrated structure in the image, and the second vector is a vector from the coordinates of the central axis of the installation position of the calibrated structure in the image to the coordinates of the central feature point of the chart.
[0023] In some embodiments, the step of rotating the captured images in sequence according to the rotation direction and rotation angle of the image acquisition device to determine the transformation vector after the initial vector is rotated includes:
[0024] Based on the rotation direction and rotation angle of the image acquisition device, using a vector rotation formula to perform rotation transformation on the first vector and the second vector respectively;
[0025] The first rotated vector and the second rotated vector are added to obtain a transformation vector.
[0026] In some embodiments, the step of adjusting the position of the calibrated structure image acquisition device by using the offset data includes:
[0027] According to the offset direction and offset amount from the central axis of the installation position of the calibrated structure to the central feature point of the chart, the mobile platform is controlled to drive the calibrated structure to move.
[0028] In a second aspect, an embodiment of the present application provides a structure center calibration device, comprising:
[0029] An image acquisition module is used to use an image acquisition device to rotate and shoot a picture card, and obtain the position information of the central feature point of the picture card at different rotation angles;
[0030] An offset data calculation module is used to calculate the plurality of position information to determine the offset data between the central axis of the installation position of the calibrated structure and the central feature point of the chart; wherein the image acquisition device is mounted on the calibrated structure;
[0031] The calibration module is used to adjust the position of the calibrated structure according to the offset data so that the central axis of the installation position of the calibrated structure is aligned with the central feature point of the chart.
[0032] In a third aspect, an embodiment of the present application provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the structure center calibration method of the first aspect.
[0033] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, and when the computer program is executed on a processor, the structure center calibration method of the first aspect is implemented.
[0034] The embodiments of the present application have the following beneficial effects:
[0035] The structural center calibration method of the present application obtains the position information of the center feature point of the chart at multiple different rotation angles by using an image acquisition device to rotate and photograph the chart; calculates multiple position information to determine the offset data from the central axis of the installation position of the calibrated structure to the center feature point of the chart; wherein the image acquisition device is mounted on the calibrated structure; the position of the calibrated structure is adjusted by the offset data so that the central axis of the installation position of the calibrated structure is aligned with the center feature point of the chart. The present application effectively offsets the errors generated during mechanical processing and assembly, realizes precise alignment between the calibrated structure and the chart, has the advantages of non-contact and high precision, and provides reliable guarantee for the acquisition and processing of high-quality images. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A schematic diagram of the structure of a method for calibrating a structure center according to an embodiment of the present application is shown;
[0038] Figure 2 A schematic diagram showing the coincidence of the shooting field of view axis and the center of the chart used for testing under an ideal state of a method for calibrating the structure center according to an embodiment of the present application;
[0039] Figure 3 A schematic diagram showing a method for calibrating the center of a structure in an embodiment of the present application in which the axis of the camera's shooting field of view is translated or tilted;
[0040] Figure 4 A flow chart of a method for calibrating a structure center according to an embodiment of the present application is shown;
[0041] Figure 5A schematic diagram showing a method for calibrating a structure center using an image acquisition device to capture a picture card in an embodiment of the present application is shown;
[0042] Figure 6 A schematic diagram showing a situation where a camera is installed at an angle or with a translation in a method for calibrating a structure center according to an embodiment of the present application is shown;
[0043] Figure 7 Another flow chart of a structure center calibration method according to an embodiment of the present application is shown;
[0044] Figure 8 Another flow chart of a structure center calibration method according to an embodiment of the present application is shown;
[0045] Fig. 9 A vector diagram of a structure center calibration method according to an embodiment of the present application is shown;
[0046] Fig.10 A schematic diagram showing image rotation in a structure center calibration method according to an embodiment of the present application is shown;
[0047] Fig.11 A schematic diagram of a structure center calibration device according to an embodiment of the present application is shown.
[0048] Explanation of the main component symbols: 10: image acquisition device; 20: calibrated structure; 30: bracket; 40: chart; 50: central feature point of the chart. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0050] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0051] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0052] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0053] Considering that in the traditional positioning method, the plane of the chart 40 has no mechanical features, when the positioning line is made on the chart 40 by a laser level for alignment, there are problems such as large visual observation errors and inability to accurately position. Therefore, the present application proposes a structural center calibration method, by setting up an image acquisition device on the calibrated structure, using the image acquisition device to rotate and shoot the chart 40, and obtaining the position information of the central feature point 50 of the chart at multiple different rotation angles; calculating the multiple position information to determine the offset data from the central axis of the installation position of the calibrated structure to the central feature point 50 of the chart; adjusting the position of the calibrated structure by the offset data, so that the central axis of the installation position of the calibrated structure is aligned with the central feature point 50 of the chart. The structural center calibration method of the present application can effectively offset the errors in the mechanical processing and assembly process, and ensure the precise alignment of the image acquisition device (for example, the camera module) and the chart 40 during the subsequent test process, thereby providing a reliable guarantee for the acquisition and processing of high-quality images.
[0054] Please refer to the attached Figure 1 - Attachment Fig.11 , some implementation methods of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0055] The present invention provides a method for calibrating the structure center, which can be applied to Figure 1 In the structure shown.
[0056] Specifically, in the structural center calibration method of the present application, the image acquisition device 10 is mounted on a bracket 30, the bracket 30 is mounted on the calibrated structure 20, and the bracket 30 and the calibrated structure 20 are rotatably connected. The calibrated structure 20 is used to assist in fixing the image acquisition device 10 in space.
[0057] The calibrated structure 20 is a precision mechanical structure, which is designed to firmly fix the position of the image acquisition device 10 in space, such as a camera, scanner, etc.; and allows the position of the image acquisition device 10 to be flexibly adjusted. In this embodiment, a circular groove is provided on the calibrated structure 20, and the bracket 30 is placed in the circular groove for rotation. The rotation connection method between the bracket 30 and the calibrated structure 20 is not limited here. Therefore, when the bracket 30 drives the image acquisition device 10 to rotate, the rotation center axis of the image acquisition device 10 coincides with the rotation center axis of the bracket 30; at the same time, the rotation center axis of the image acquisition device 10 also coincides with the center axis of the circular groove on the calibrated structure 20. In this embodiment, the center axis of the installation position of the calibrated structure 20 is the center axis of the circular groove on the calibrated structure 20.
[0058] After the spatial position of the structure to be calibrated 20 is adjusted accordingly, the image acquisition device to be tested, such as a camera module, can be repeatedly replaced on the bracket 30, thereby realizing industrial testing of the image acquisition device. In this embodiment, the bracket 30 is set to a quick-detachable structure, the rotating connection part between the bracket 30 and the structure to be calibrated 20 is retained, and the image acquisition device to be tested is installed on the rotating connection part.
[0059] Take the camera as an example. Figure 2 As shown, in an ideal state, after the camera is mounted on the calibrated structure 20, the axis of the camera's field of view should coincide with the center of the chart 40 used for the test. However, in practice, due to factors such as machining and assembly errors of the calibrated structure 20, the axis of the camera's field of view may be translated or tilted, as shown in FIG. Figure 3 As shown in (a) and (b) in the figure, if you replace the camera and test it, the camera will be tested inaccurately.
[0060] Figure 4 A flow chart of a structure center calibration method according to an embodiment of the present application is shown. The structure center calibration method comprises the following steps:
[0061] Step S100: Using the image acquisition device 10 to rotate and photograph the image card 40, position information of the central feature point 50 of the image card at multiple different rotation angles is obtained.
[0062] Exemplarily, the image acquisition device 10 is mounted on a bracket 30, which is installed on the calibrated structure 20. The image acquisition device 10 is driven by rotating the bracket 30 on the calibrated structure 20 to capture images of the chart 40 at different rotation angles to obtain position information of multiple central feature points 50 of the chart.
[0063] The picture card 40 is a black-and-white picture with many black and white areas on it. These black or white areas have various shapes, such as square, circle, ring, etc. At the physical center of the picture card 40, there is a special black or white area. This special black or white area is smaller than the surrounding black or white areas of the same size, so it is used as the center of the picture card 40, which is convenient for quickly identifying the center of the picture card 40.
[0064] The position information can be expressed in a variety of ways, for example, by using coordinate points to display the position, or by using vectors. In the above methods, it is usually necessary to pre-set the coordinate system. The coordinate system can be set in a variety of ways, for example, by establishing a coordinate system at the exact center of the captured image, or by using the vertex at any corner of the image as the origin of the coordinate system. In this embodiment, the coordinate system is established with the center point of the image as the origin of the coordinate system.
[0065] In one embodiment, the step of rotating and photographing the image card 40 using the image acquisition device 10 to obtain position information of the central feature point 50 of the image card at different rotation angles includes:
[0066] Step S110 , based on a preset rotation angle, controlling the image acquisition device 10 to rotate four times in sequence on the calibrated structure 20 .
[0067] The preset rotation angle refers to a specific angle pre-set during the calibration process to indicate the rotation amplitude, for example, it may include 0 degrees, 90 degrees, 180 degrees, 270 degrees, etc. The image acquisition device 10 is driven to rotate on the calibrated structure 20 multiple times in sequence by the rotating bracket 30. The setting of these rotation angles enables the image acquisition device 10 to shoot the chart 40 from different angles to capture the position changes of the central feature point 50 of the chart at various angles, providing comprehensive data support for subsequent calibration. The image acquisition device 10 is controlled to rotate on the calibrated structure 20 in sequence, and the rotation shooting process can be performed clockwise or counterclockwise.
[0068] Exemplarily, the image acquisition device 10 is driven by the rotating bracket 30 to perform four clockwise rotations on the calibrated structure 20 in sequence. For example, the four rotations here may include: 0 degree, 90 degrees, 180 degrees and 270 degrees.
[0069] Step S120 , photographing and identifying the coordinate position information of the central feature point 50 of the chart at different rotation angles.
[0070] After each rotation, the image acquisition device 10 will capture and identify the coordinate position information of the center feature point 50 of the chart at the corresponding rotation angle. For specific coordinate values, after the coordinate system is established, the coordinate value of the center feature point 50 of the chart can be identified and calculated using the pixel value according to the image recognition algorithm. For example, Figure 5 As shown in (a), (b), (c), and (d), the position information of the central feature point 50 of the image card captured at four angles of 0 degrees, 90 degrees, 180 degrees, and 270 degrees is:
[0071] At 0 degrees, the coordinate position information of the center of the chart is A(X1,Y1);
[0072] At 90 degrees, the coordinate position information of the center of the chart is B(X2,Y2);
[0073] At 180 degrees, the coordinate position information of the center of the chart is C(X3,Y3);
[0074] At 270 degrees, the coordinate position information of the center of the chart is D(X4,Y4);
[0075] Step S200 , calculating a plurality of position information to determine the offset data from the central axis of the installation position of the calibrated structure 20 to the central feature point 50 of the chart; wherein the image acquisition device 10 is mounted on the calibrated structure 20 .
[0076] It can be understood that when the camera is installed at an angle or translation, there will be a fixed point in the multiple images taken by the camera rotation, such as Figure 6 As shown in (a), the position of this fixed point in each image is the same, and this fixed point is on the rotation axis of the bracket 30. When the central feature point 50 of the chart card is not on the rotation axis of the bracket 30, the camera is rotated to shoot. In the image captured at this time, the central feature point 50 of the chart card will also rotate around the point in the image where the rotation axis of the bracket 30 is located, that is, it rotates around the fixed point, as shown in FIG. Figure 6 Even if the bracket 30 is installed offset on the calibrated structure 20, the rotation center axis of the bracket 30 still coincides with the center axis of the installation position provided by the calibrated structure 20.
[0077] Exemplarily, by performing image processing calculation on the captured image, the offset data between the central axis of the installation position of the calibrated structure 20 and the central feature point 50 of the chart can be obtained. The offset data includes an offset amount and an offset direction.
[0078] For example, the present application provides two methods to calculate the offset data between the central axis of the installation position of the calibrated structure 20 and the central feature point 50 of the chart. One method is to calculate the coordinates of the central axis of the installation position of the calibrated structure 20 and the coordinates of the central feature point 50 of the chart through image processing, and then use the coordinates to calculate the corresponding offset direction and offset. The other method is to directly calculate the offset vector between the central axis of the installation position of the calibrated structure 20 and the central feature point 50 of the chart using a vector method, and obtain the corresponding offset direction and offset through the offset vector.
[0079] For the first method, the coordinates of the central axis of the installation position of the calibrated structure 20 and the coordinates of the central feature point 50 of the chart are calculated through image processing, and then the corresponding offset direction and offset are calculated using the coordinates, such as Figure 7 As shown, including:
[0080] Step S210 , obtaining the coordinate values of the central feature point 50 of the chart in the plurality of position information and performing average calculation to determine the coordinate value of the central axis of the installation position of the calibrated structure 20 in the image.
[0081] For example, Figure 5 As shown in (a), (b), (c), and (d), by rotating and photographing the chart 40 four times, the position information of the four central feature points 50 of the chart can be obtained, namely A (X1, Y1), B (X2, Y2), C (X3, Y3), and D (X4, Y4).
[0082] Then, if Figure 5 As shown in (e), the coordinate value of the central axis of the installation position of the calibrated structure 20 in the image can be determined by taking the average value of the coordinate value of the central feature point 50 of the chart at each angle.
[0083] The coordinates of the central axis of the installation position of the calibrated structure 20 in the X direction in the image are:
[0084]
[0085] The coordinates of the central axis of the installation position of the calibrated structure 20 in the Y direction in the image are:
[0086]
[0087] Right now
[0088] Step S220 , based on the coordinate value of the center feature point 50 of the chart and the coordinate value of the center axis of the installation position of the calibrated structure 20 in the image, determine the offset direction and offset amount from the center axis of the installation position of the calibrated structure 20 to the center feature point 50 of the chart.
[0089] For example: Assume that the coordinate value of the central feature point 50 of the i-th image card is (Xi, Yi), and the coordinate value of the central axis in the image is (X avg ,Y avg ), then calculate the offset vectors of these two coordinate values in the X and Y directions respectively:
[0090] X-direction offset vector ΔX=Xi-X avg ;
[0091] Y-direction offset vector ΔY=Yi-Y avg ;
[0092] It can be understood that the calculated offset vector can be used to determine the adjusted position of the calibrated structure 20. The above offset vector reflects two characteristics, namely, the offset direction and the offset amount.
[0093] Among them, the offset direction is used to determine the direction in which the calibrated structure 20 needs to move, which is determined by the positive and negative conditions of the offset vector in the corresponding direction; and the offset amount is used to determine the distance that the calibrated structure 20 needs to move in a specific direction, which is determined by the specific value of the offset vector in the corresponding direction. Usually, it can be obtained by taking the absolute value of the offset vector.
[0094] For the X direction, if ΔX>0, that is, the offset direction is positive, it means that the calibrated structure 20 needs to be moved along the positive direction of the X axis (to the right) by a corresponding distance, and if ΔX<0, that is, the offset direction is negative, it means that the calibrated structure 20 needs to be moved along the negative direction of the X axis (to the left) by a corresponding distance. Similarly, for the Y direction, if ΔY>0, that is, the offset direction is positive, it means that the calibrated structure 20 needs to be moved along the positive direction of the Y axis (upward) by a corresponding distance, and if ΔY<0, that is, the offset direction is negative, it means that the calibrated structure 20 needs to be moved along the negative direction of the Y axis (downward) by a corresponding distance.
[0095] For example, assuming that the X-direction offset vector ΔX=+1, that is, the offset direction is the positive direction of the X-axis, and the offset is 1, it means that the calibrated structure 20 needs to be moved 1 distance unit in the positive direction of the X-axis. Alternatively, assuming that ΔX=-1, that is, the offset direction is the negative direction of the X-axis, and the offset is 1, it means that the calibrated structure 20 needs to be moved 1 distance unit in the negative direction of the X-axis.
[0096] For the second method, the offset vector between the central axis of the installation position of the calibrated structure 20 and the central feature point 50 of the chart is directly calculated by using the vector method, and the corresponding offset direction and offset amount are obtained by the offset vector, such as Figure 8 As shown, including:
[0097] Step S230 , obtaining the coordinate values of the central feature points 50 of the chart in the plurality of position information, and establishing corresponding initial vectors between the coordinate origin and the plurality of central feature points 50 of the chart.
[0098] The initial vector is a vector from the origin of the coordinate system to each of the center feature points 50 of the chart. For example, the four center feature points 50 of the chart obtained by four rotations are respectively recorded as A(X1, Y1), B(X2, Y2), C(X3, Y3), and D(X4, Y4). Since the origin of the coordinate system is (0, 0), the initial vectors corresponding to the center points A, B, C, and D of the chart are as follows:
[0099] For point A: initial vector = (X1, Y1);
[0100] For point B: initial vector = (X2, Y2);
[0101] For point C: initial vector = (X3, Y3);
[0102] For point D: initial vector = (X4, Y4);
[0103] In an optional embodiment, for step S230, in the step of establishing corresponding initial vectors between a plurality of image card center feature points 50 and the coordinate origin according to the coordinate values in the plurality of position information, the step includes:
[0104] A virtual fixed-point coordinate is introduced to decompose the initial vector into the sum of the first vector and the second vector. The virtual fixed-point coordinate is the coordinate of the central axis of the installation position of the calibrated structure 20 in the image, and the first vector is the vector from the coordinate origin to the coordinate of the central axis of the installation position of the calibrated structure 20 in the image. The second vector is the vector from the coordinate of the central axis of the installation position of the calibrated structure 20 in the image to the coordinate of the central feature point 50 of the chart.
[0105] In order to better describe the relationship between the central feature point 50 of the chart and the central axis of the installation position of the calibrated structure 20, this step introduces virtual fixed point coordinates, which represent the alignment center point of the camera and the calibrated device in an ideal situation. The first vector represents the vector from the origin of the coordinate system to the virtual fixed point coordinates, such as Fig. 9 The second vector refers to the vector from the virtual fixed point coordinate to the center feature point 50 of the chart, as shown in (a)-(d). Fig. 9 ② shown in (a)-(d).
[0106] For example, the coordinate origin is (0,0), the central feature point 50 of the chart is (Xi,Yi), and the virtual fixed point coordinates are (XM,YM):
[0107] The first vector refers to the vector from the coordinate origin (0,0) to the virtual fixed point coordinate (XM,YM), that is, the first vector = (XM,YM); the second vector refers to the vector from the virtual fixed point coordinate (XM,YM) to the center feature point 50 (Xi,Yi) of the chart, that is, the second vector = (Xi-XM,Yi-YM).
[0108] Then for point A: the second vector = (X1-XM, Y1-YM);
[0109] For point B: second vector = (X2-XM, Y2-YM);
[0110] For point C: second vector = (X3-XM, Y3-YM);
[0111] For point D: second vector = (X4-XM, Y4-YM);
[0112] It can be understood that the initial vector of any central feature point 50 of the chart = the first vector + the second vector, that is, it satisfies:
[0113] (Xi,Yi)=(XM,YM)+(Xi-XM,Yi-YM);
[0114] Then for the central feature points A, B, C, and D of the picture card, we have:
[0115] A(X1,Y1)=(XM,YM)+(X1-XM,Y1-YM);
[0116] B(X2,Y2)=(XM,YM)+(X2-XM,Y2-YM);
[0117] C(X3,Y3)=(XM,YM)+(X3-XM,Y3-YM);
[0118] D(X4,Y4)=(XM,YM)+(X4-XM,Y4-YM);
[0119] Step S240: rotate the captured images in sequence according to the rotation direction and rotation angle of the image acquisition device 10 to determine the transformation vector after the initial vector is rotated.
[0120] Exemplarily, when the support 30 drives the image acquisition device 10 to rotate, all positions in the image will change with the rotation of the image acquisition device 10, such as Fig.10 As shown in (a)-(d) in FIG. 1 . Therefore, it is necessary to rotate each initial vector in the image according to the rotation direction (e.g., counterclockwise or clockwise) and the rotation angle (e.g., 90°, 180°, 270°, etc.) of the image acquisition device 10. The rotated initial vector, i.e., the transformation vector, is calculated by the rotation formula. The transformation vector describes the position of the central feature point 50 of the image card after the image acquisition device 10 is rotated.
[0121] In an optional embodiment, in step S240, the step of rotating the captured images in sequence according to the rotation direction and rotation angle of the image acquisition device 10 to determine the transformation vector after the initial vector is rotated includes:
[0122] Based on the rotation direction and rotation angle of the image acquisition device 10, the first vector and the second vector are respectively rotated and transformed using a vector rotation formula; the rotated first vector and the second vector are added to obtain a transformation vector.
[0123] Exemplarily, the vector rotation formula is:
[0124] X = Xcosθ-Ysinθ;
[0125] Y = Xsinθ + Ycosθ;
[0126] For special angle rotation, the following formula can be directly applied for calculation. For example:
[0127] When rotating 0 degrees counterclockwise: X ′ =X;Y ′ =Y;
[0128] When rotating 90 degrees counterclockwise, X ′ =-Y;Y ′ =X;
[0129] When rotating 180 degrees counterclockwise, X ′ =-X;Y ′ = -Y;
[0130] When rotating 270 degrees counterclockwise, X ′ =Y;Y ′ = -X;
[0131] For example, using the vector rotation formula, the first vector (XM, YM) is rotated by 0 degrees, 90 degrees, 180 degrees, and 270 degrees in sequence, and the following are obtained:
[0132] (XM,YM);
[0133] (XM,-YM);
[0134] (-XM,-YM);
[0135] (-XM,YM);
[0136] Use the vector rotation formula to rotate the second vector (X1-XM, Y1-YM),
[0137] (X2-XM, Y2-YM), (X3-XM, Y3-YM), (X4-XM, Y4-YM) are rotated by 0, 90, 180, and 270 degrees respectively to obtain:
[0138] (X1-XM, Y1-YM);
[0139] (YM-Y2,X2-XM);
[0140] (XM-X3, YM-Y3);
[0141] (Y4-YM, XM-X4);
[0142] Add the rotated first and second vectors to obtain the following transformation vector:
[0143] Transformation vector A: (XM, YM) + (X1-XM, Y1-YM) = (X1, Y1);
[0144] Transformation vector B: (-YM, XM) + (YM-Y2, X2-XM) = (X2, -Y2);
[0145] Transformation vector C: (-XM, -YM) + (XM-X3, YM-Y3) = (-X3, -Y3);
[0146] Transformation vector D: (YM, -XM) + (Y4 - YM, XM - X4) = (-X4, Y4);
[0147] Step S250, the average of the multiple transformation vectors is calculated to obtain an offset vector, wherein the offset vector is the vector between the central axis of the installation position of the calibrated structure 20 and the central feature point 50 of the chart, such as Fig.10 ③ shown in (e) above.
[0148] Combination Fig. 9 and Fig.10 As shown in (a), (b), (c), and (d), in the images taken at the four rotation angles, the directions of the first vectors after the rotation transformation are basically the same, while the directions of the second vectors after the rotation transformation are complementary to each other. Therefore, averaging the four transformation vectors can offset the second vector to a large extent. In addition, through the vector rotation transformation, the vector distribution can be made more balanced, from being concentrated in one quadrant to being distributed in multiple quadrants. In the actual calculation process, the intermediate quantity in the vector calculation process, that is, the transformation vector, can also be displayed with the help of an auxiliary terminal display device, which is also convenient for operators to check whether there are errors in the calculation and analysis process in a timely manner.
[0149] Exemplarily, by averaging the transformation vectors of the abscissa and ordinate, the offset vector between the central axis of the installation position of the calibrated structure 20 and the central feature point 50 of the chart can be obtained, so that in subsequent steps, the offset direction and offset amount can be determined according to the offset vector.
[0150] Among them, the offset vector for averaging the transformation vector of the horizontal axis is as follows:
[0151]
[0152]
[0153] The offset vector for averaging the transformation vector of the ordinate is as follows:
[0154]
[0155] Step S260 , based on the offset vector, determine the offset direction and offset amount from the central axis of the installation position of the calibrated structure 20 to the central feature point 50 of the chart.
[0156] Exemplarily, the offset direction is determined by the signs of the abscissa and ordinate offset vectors:
[0157] If the result of the horizontal coordinate offset vector is positive, it means that the offset direction is the positive direction of the X-axis (i.e., to the right).
[0158] If the result of the horizontal coordinate offset vector is negative, it means that the offset direction is the negative direction of the X-axis (ie, to the left).
[0159] If the result of the ordinate offset vector is positive, it means that the offset direction is the positive direction of the Y axis (ie upward).
[0160] If the result of the ordinate offset vector is negative, it means that the offset direction is in the negative direction of the Y axis (ie, downward).
[0161] Furthermore, the absolute value of the horizontal coordinate offset vector is the offset in the X direction, that is, the actual offset distance of the center of the chart in the X direction:
[0162]
[0163] The absolute value of the ordinate offset vector is the offset in the Y direction, that is, the actual offset distance of the center of the chart in the Y direction:
[0164]
[0165] Step S300 : adjusting the position of the calibrated structure 20 by using the offset data so that the central axis of the installation position of the calibrated structure 20 is aligned with the central feature point 50 of the chart.
[0166] Exemplarily, the offset direction is used to determine the specific direction in which the calibrated structure 20 needs to move, and the offset amount is used to determine the specific distance that the calibrated structure 20 should move in the specific direction.
[0167] According to the offset direction and offset, the position of the calibrated structure 20 is adjusted. For example, assuming that the Y-direction offset vector ΔY=-5, that is, the offset direction is the negative direction of the Y axis, and the offset is 5, it means that the calibrated structure 20 needs to be moved 5 distance units in the negative direction of the Y axis. Alternatively, assuming that ΔY=7, that is, the offset direction is the positive direction of the Y axis, and the offset is 7, it means that the calibrated structure 20 needs to be moved 7 distance units in the positive direction of the Y axis. In this way, the central axis of the installation position of the calibrated structure 20 is aligned with the actual position of the center feature point 50 of the chart, achieving the effect of precise alignment.
[0168] In an optional embodiment, the step of adjusting the position of the image acquisition device 10 of the calibrated structure 20 by using the offset data includes:
[0169] According to the offset direction and offset amount from the central axis of the installation position of the calibrated structure 20 to the central feature point 50 of the chart, the mobile platform is controlled to drive the calibrated structure 20 to move.
[0170] Exemplarily, when adjusting the spatial position of the calibrated structure 20, the mobile platform is controlled to move the calibrated structure 20 through the offset amount and the offset direction, so that the central axis of the installation position of the calibrated structure 20 is aligned and coincides with the central feature point 50 of the chart, thereby achieving calibration between the calibrated structure 20 and the chart 40, and improving the accuracy and consistency of image acquisition and processing.
[0171] The structural center calibration method of the present application cleverly simplifies the calculation process, and does not require tedious explicit solution of the central axis of the installation position of the calibrated structure. It has the advantages of non-contact and high precision, offsets the errors generated during machining and assembly, and makes the central axis of the installation position of the calibrated structure aligned and coincident with the center feature point 50 of the chart card, thereby realizing calibration between the calibrated structure and the chart card 40, and improving the accuracy and consistency of image acquisition and processing.
[0172] The present application also proposes a structural center calibration device, such as Fig.11 As shown, the device comprises:
[0173] The card acquisition module 111 is used to use an image acquisition device to rotate and shoot the card to obtain the position information of the central feature point of the card at different rotation angles;
[0174] The offset data calculation module 112 is used to calculate the multiple position information to determine the offset data between the central axis of the installation position of the calibrated structure and the central feature point of the chart; wherein the image acquisition device is mounted on the calibrated structure;
[0175] The calibration module 113 is used to adjust the position of the calibrated structure by using the offset data so that the central axis of the installation position of the calibrated structure is aligned with the central feature point of the chart.
[0176] It can be understood that the device of this embodiment corresponds to a structural center calibration method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0177] The present application also provides a computer device. Exemplarily, the computer device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the functions of each module in the above-mentioned structure center calibration method or the above-mentioned structure center calibration device.
[0178] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0179] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0180] The present application also provides a computer-readable storage medium for storing the computer program used in the above-mentioned terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0181] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0182] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0183] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0184] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for calibrating a structure center, characterized in that: The method comprises: The image acquisition device is used to rotate and shoot the image card to obtain the position information of the central feature point of the image card at multiple different rotation angles; Calculating the plurality of position information to determine the offset data from the central axis of the installation position of the calibrated structure to the central feature point of the chart; wherein the image acquisition device is mounted on the calibrated structure; The position of the calibrated structure is adjusted by using the offset data so that the central axis of the installation position of the calibrated structure is aligned with the central feature point of the chart.
2. The method for calibrating the structure center according to claim 1, characterized in that: The step of rotating and photographing a picture card by using an image acquisition device to obtain position information of a central feature point of the picture card at different rotation angles includes: Based on a preset rotation angle, controlling the image acquisition device to rotate four times in sequence on the calibrated structure; The coordinate position information of the central feature point of the image card at different rotation angles is captured and identified.
3. The method for calibrating the structure center according to claim 1, characterized in that: The step of calculating the plurality of position information to determine the offset data from the central axis of the installation position of the calibrated structure to the central feature point of the chart includes: Obtaining the coordinate values of the central feature points of the image card in the plurality of position information and performing average calculation to determine the coordinate value of the central axis of the installation position of the calibrated structure in the image; Based on the coordinate value of the central feature point of the chart and the coordinate value of the central axis of the installation position of the calibrated structure in the image, the offset direction and offset amount of the central axis of the installation position of the calibrated structure to the central feature point of the chart are determined.
4. The method for calibrating the structure center according to claim 1, characterized in that: The step of calculating the plurality of position information to determine the offset data from the central axis of the installation position of the calibrated structure to the central feature point of the chart includes: Acquire the coordinate values of the central feature points of the image card in the plurality of position information, and establish corresponding initial vectors between the coordinate origin and the plurality of central feature points of the image card; According to the rotation direction and rotation angle of the image acquisition device, the captured images are rotated in sequence to determine the transformation vector after the initial vector is rotated; An offset vector is obtained by averaging a plurality of the transformation vectors, wherein the offset vector is a vector between a central axis of the installation position of the calibrated structure and a central feature point of the chart; Based on the offset vector, the offset direction and the offset amount from the central axis of the installation position of the calibrated structure to the central feature point of the chart are determined.
5. The method for calibrating the structure center according to claim 4, characterized in that: The step of establishing corresponding initial vectors between a plurality of central feature points of the image card and the coordinate origin according to the coordinate values in the plurality of position information includes: The virtual fixed-point coordinates are introduced to decompose the initial vector into the sum of a first vector and a second vector, wherein the virtual fixed-point coordinates are the coordinates of the central axis of the installation position of the calibrated structure in the image, the first vector is a vector from the coordinate origin to the coordinates of the central axis of the installation position of the calibrated structure in the image, and the second vector is a vector from the coordinates of the central axis of the installation position of the calibrated structure in the image to the coordinates of the central feature point of the chart.
6. The method for calibrating the structure center according to claim 5, characterized in that: The step of rotating the captured images in sequence according to the rotation direction and rotation angle of the image acquisition device to determine the transformation vector after the initial vector is rotated includes: Based on the rotation direction and rotation angle of the image acquisition device, using a vector rotation formula to perform rotation transformation on the first vector and the second vector respectively; The first rotated vector and the second rotated vector are added to obtain a transformation vector.
7. The method for calibrating the structure center according to claim 3 or 4, characterized in that: The step of adjusting the position of the calibrated structure image acquisition device by using the offset data includes: According to the offset direction and offset amount from the central axis of the installation position of the calibrated structure to the central feature point of the chart, the mobile platform is controlled to drive the calibrated structure to move.
8. A structure center calibration device, characterized in that: The structure center calibration device comprises: An image acquisition module is used to use an image acquisition device to rotate and shoot a picture card, and obtain the position information of the central feature point of the picture card at different rotation angles; An offset data calculation module is used to calculate the plurality of position information to determine the offset data between the central axis of the installation position of the calibrated structure and the central feature point of the chart; wherein the image acquisition device is mounted on the calibrated structure; The calibration module is used to adjust the position of the calibrated structure according to the offset data so that the central axis of the installation position of the calibrated structure is aligned with the central feature point of the chart.
9. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the structure center calibration method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The device stores a computer program, which, when executed on a processor, implements the structure center calibration method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Camera center shaft adjusting machine
CN105965250A
Test position calibration method and device of image sensor, equipment and storage medium
CN115396665A