Calibration method, device and scanning system
By using independently distributed calibration blocks and marker point identification technology, the problems of low calibration accuracy and efficiency in 3D scanning systems are solved, realizing a disordered, fast, and accurate calibration method, which improves the efficiency and flexibility of calibration.
Patent Information
- Application Number
- CN202411960887.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-28
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-12-28
AI Technical Summary
In existing 3D scanning technologies, the accuracy and efficiency of calibration are low, and errors in the splicing of marker points on the calibration plate occur frequently, affecting the accuracy and efficiency of calibration.
Independently distributed calibration blocks are used, including a first calibration block with positioning markers and a second calibration block with auxiliary markers. The scanner acquires scanned images, identifies positioning marker data, determines positioning information, and performs calibration calculations based on the positioning information to generate the scanner's calibration results.
It enables calibration without the need for orderly arrangement of marker points, improving calibration efficiency and accuracy, avoiding marker point splicing errors, and enhancing calibration flexibility and convenience.
Smart Images

Figure CN119958461B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of three-dimensional scanning, and in particular, to a calibration method and device and a scanning system. BACKGROUND
[0002] With the development and maturity of digital image processing, digital projection display and computer processing technology, three-dimensional scanning technology has developed rapidly. A three-dimensional scanning system can project light onto the surface of an object, a camera device captures an image under the light projection, and a three-dimensional reconstruction algorithm is used to reconstruct the three-dimensional size information of the object surface according to the shape of the captured image. In order to ensure the accuracy of the reconstruction, the scanner in the scanning system needs to be calibrated.
[0003] In related technologies, a calibration board arranged in a calibration site is usually used to calibrate the scanner, and the marker points on the calibration board need to be arranged in order and in a neat manner. Therefore, the above-mentioned calibration method is prone to cause marker point splicing errors in the actual scanning process using a scanner, and requires that the three-dimensional coordinates of the marker points of the calibration board must be reconstructed before the calibration board is shipped, thereby affecting the accuracy and efficiency of the calibration.
[0004] At present, there is no effective solution to the problem of low accuracy and efficiency of calibration in related technologies. SUMMARY
[0005] Embodiments of the present application provide a calibration method, device and scanning system to at least solve the problem of low accuracy and efficiency of calibration in related technologies.
[0006] In a first aspect, the embodiments of the present application provide a calibration method, characterized by being used for a scanning system, the scanning system comprising a scanner and a calibration piece, the calibration piece comprising a first calibration block provided with a positioning marker point and a second calibration block provided with an auxiliary marker point; the first calibration block and the second calibration block are independently distributed calibration blocks; the method comprises:
[0007] obtaining a scanning image of the calibration piece scanned by the scanner;
[0008] identifying positioning marker point data in the scanning image, and determining positioning information according to the positioning marker point data;
[0009] performing calibration calculation on the scanning image based on the positioning information, and generating a calibration result of the scanner.
[0010] In some embodiments, the scan image includes a first scan image of the calibration piece scanned by a first camera of the scanner, and a second scan image of the calibration piece scanned by a second camera of the scanner; wherein the first scan image includes first positioning marker point data and first auxiliary marker point data, and the second scan image includes second positioning marker point data and second auxiliary marker point data.
[0011] The identifying the positioning marker point data in the scan image includes:
[0012] The identifying the first positioning marker point data and the second positioning marker point data includes:
[0013] In some embodiments, the positioning marker point includes a feature positioning marker point having a preset recognition feature.
[0014] The identifying the first positioning marker point data and the second positioning marker point data includes:
[0015] The identifying the first positioning marker point data and the second positioning marker point data includes:
[0016] The identifying the first positioning marker point data and the second positioning marker point data includes:
[0017] In some embodiments, the preset recognition feature includes a size feature having a size data greater than a preset size threshold, and the method further includes:
[0018] The identifying the first positioning marker point data and the second positioning marker point data includes:
[0019] In some embodiments, the positioning marker point further includes a common positioning marker point, and the common positioning marker point and the feature positioning marker point are arranged on a same first calibration block; and the identifying the first positioning marker point data and the second positioning marker point data includes:
[0020] searching, based on the first position information, for mark point data closest to the first feature positioning mark point in the first scan image, and determining the mark point data as first common positioning mark point data;
[0021] searching, based on the first position information, for mark point data closest to the first feature positioning mark point in the first scan image, and determining the mark point data as first common positioning mark point data;
[0022] obtaining the first positioning mark point data according to the first feature positioning mark point data and the first common positioning mark point data;
[0023] searching, based on the first position information, for mark point data closest to the first feature positioning mark point in the first scan image, and determining the mark point data as first common positioning mark point data;
[0024] searching, based on the first position information, for mark point data closest to the first feature positioning mark point in the first scan image, and determining the mark point data as first common positioning mark point data;
[0025] obtaining the second positioning mark point data according to the first feature positioning mark point data and the second common positioning mark point data.
[0026] In some embodiments, the determining the first affine relationship between the first positioning mark point data and the second positioning mark point data comprises:
[0027] iteratively calculating, by using a random consistency algorithm, second matching point pairs between the first positioning mark point data and the second positioning mark point data; or,
[0028] obtaining a preset prior matching point pair between the first positioning mark point data and the second positioning mark point data, and determining the second matching point pair based on the prior matching point pair;
[0029] calculating the first affine relationship based on the second matching point pair.
[0030] In some embodiments, the calibrating the scan image based on the positioning information to generate a calibration result of the scanner comprises:
[0031] determining a first matching point pair between the first scan image and the second scan image based on the first affine relationship, and generating the calibration result according to the first matching point pair.
[0032] In some embodiments, the determining the first matching point pair between the first scan image and the second scan image based on the first affine relationship comprises:
[0033] convert the marker point data in the first scan image in the first camera coordinate system to a second camera coordinate system based on the first affine relationship to obtain target marker point data;
[0034] determine a marker point distance between the target marker point data and each marker point data in the second scan image, and determine the first matching point pair according to the marker point distance and a preset distance threshold.
[0035] In some embodiments, the generating the calibration result according to the first matching point pair comprises:
[0036] detecting whether the first affine relationship calculation is correct based on the number of the first matching point pairs;
[0037] In a case where it is detected that the first affine relationship calculation is correct, generating the calibration result according to the first matching point pair.
[0038] In some embodiments, the generating the calibration result according to the first matching point pair comprises:
[0039] obtaining initial camera parameters of the scanner;
[0040] calculating a first pose matrix between the first camera and the second camera according to the initial camera parameters and the first matching point pair, and obtaining the calibration result.
[0041] In some embodiments, the scanner further comprises a color camera; and the generating the calibration result of the scanner comprises:
[0042] obtaining a third scan image of the calibration object scanned by the color camera; the third scan image comprises third positioning marker point data and third auxiliary marker point data;
[0043] identifying the third positioning marker point data; determining a second affine relationship between the first positioning marker point data and the third positioning marker point data; and the positioning information further comprises the second affine relationship;
[0044] determining a third matching point pair between the first scan image and the third scan image based on the second affine relationship;
[0045] reconstructing a three-dimensional point set in the first camera coordinate system according to the first matching point pair and the calculated first pose matrix between the first camera and the second camera;
[0046] determining a correspondence between a two-dimensional point in the third scan image and a three-dimensional point in the three-dimensional point set according to the third matching point pair.
[0047] based on the correspondence, obtain a second pose matrix between the first camera and the color camera; the calibration result comprises the first pose matrix and the second pose matrix.
[0048] In some embodiments, the method further comprises:
[0049] reconstruct a three-dimensional point set in a first camera coordinate system according to the first matching point pair and the calculated first pose matrix between the first camera and the second camera;
[0050] determine three-dimensional point position information in the three-dimensional point set;
[0051] in a case where the three-dimensional point position information is within a preset scanning distance range, generate the calibration result according to the first matching point pair.
[0052] In a second aspect, the embodiments of the present application provide a calibration device for a scanning system, the scanning system comprising a scanner and a calibration piece, the calibration piece comprising a first calibration block provided with a positioning marker point and a second calibration block provided with an auxiliary marker point; the first calibration block and the second calibration block are independently distributed calibration blocks; the device comprises:
[0053] an acquisition module configured to acquire a scanning image of the calibration piece scanned by the scanner;
[0054] a positioning module configured to identify positioning marker point data in the scanning image, and determine positioning information according to the positioning marker point data;
[0055] a generation module configured to perform calibration calculation on the scanning image based on the positioning information, and generate a calibration result of the scanner.
[0056] In a third aspect, the embodiments of the present application provide a scanning system, the system comprising a scanner, a calibration piece and a controller;
[0057] the calibration piece comprises a first calibration block provided with a positioning marker point and a second calibration block provided with an auxiliary marker point; the first calibration block and the second calibration block are independently distributed calibration blocks;
[0058] the controller is connected to the scanner; the controller stores a computer program, and the computer program is executed by a processor to implement the steps of the calibration method of the first aspect.
[0059] Compared with the related art, the calibration method, the device and the scanning system provided by the embodiments of the present application, the scanning system comprises a scanner and a calibration piece, the calibration piece comprises a first calibration block provided with positioning mark points and a second calibration block provided with auxiliary mark points; the first calibration block and the second calibration block are independently distributed calibration blocks; a scanning image of the calibration piece scanned by the scanner is acquired; positioning mark point data in the scanning image is identified, positioning information is determined according to the positioning mark point data; and calibration calculation is performed on each scanning image based on the positioning information to generate a calibration result of the scanner. Based on this, each mark point can be arranged on the calibration piece in any manner, so that it is not necessary to arrange the mark points on a calibration plate in an ordered manner according to a certain order, and it is not necessary to reconstruct and store three-dimensional coordinates of each mark point on the calibration plate when the calibration plate is manufactured, so that an unordered, fast and accurate calibration method is realized, and the efficiency and accuracy of calibration are effectively improved.
[0060] The details of one or more embodiments of the present application are presented in the following drawings and description to make other features, objects and advantages of the present application more apparent. BRIEF DESCRIPTION OF DRAWINGS
[0061] The drawings described herein are intended to provide further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their description serve to explain the present application, and do not constitute an improper limitation on the present application. In the drawings:
[0062] Figure 1 is a hardware structure block diagram of a terminal of a calibration method according to an embodiment of the present application;
[0063] Figure 2 is a flowchart of a calibration method according to an embodiment of the present application;
[0064] Figure 3A is a schematic diagram of a first calibration block according to an embodiment of the present application;
[0065] Figure 3B is a schematic diagram of another first calibration block according to an embodiment of the present application;
[0066] Figure 4 is a structural schematic diagram of a calibration piece according to an embodiment of the present application;
[0067] Figure 5 is a flowchart of another calibration method according to an embodiment of the present application;
[0068] Figure 6 is a structural block diagram of a calibration device according to an embodiment of the present application;
[0069] Figure 7 is a structural block diagram of a scanning system according to an embodiment of the present application. DETAILED DESCRIPTION
[0070] For the purpose of the present application, the technical solutions and advantages are more clearly and obviously understood, the present application is described and explained below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application, and are not used to limit the present application. Based on the examples provided in the present application, all other examples obtained by those of ordinary skill in the art without making creative efforts fall within the scope of the present application. In addition, it can be understood that although the efforts made in this development process can be complex and lengthy, some design, manufacture or production changes made on the basis of the technical content disclosed in the present application are only routine technical means for those of ordinary skill in the art related to the content disclosed in the present application, and should not be understood as insufficient disclosure of the present application.
[0071] In the present application, the phrase "embodiment" means that the specific features, structures or characteristics described in combination with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment to other embodiments. Those of ordinary skill in the art explicitly and implicitly understand that the embodiments described in the present application can be combined with other embodiments without conflict.
[0072] Unless otherwise defined, the technical terms or scientific terms involved in the present application should be understood as the usual meaning by those of ordinary skill in the art to which the present application belongs. The terms "one", "a", "an", "the", and similar words involved in the present application do not represent quantity limitation, and can represent singular or plural. The terms "include", "contain", "have", and any variations thereof involved in the present application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device including a series of steps or modules (units) is not limited to the listed steps or units, but can also include steps or units not listed, or can also include other steps or units inherent to the process, method, product or device. The terms "connected", "connected", "coupled" and similar words involved in the present application are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The term "multiple" in the present application means greater than or equal to two. The association between the associated objects is described by the term "and / or", which means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. The terms "first", "second", "third" and the like in the present application are only to distinguish similar objects, and do not represent a specific order for the objects.
[0073] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. Taking running on a terminal as an example, Figure 1 This is a hardware structure block diagram of a terminal for a calibration method according to an embodiment of this application. For example... Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0074] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to a calibration method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the aforementioned method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0075] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0076] The embodiment provides a calibration method for a scanning system, the scanning system comprising a scanner and a calibration piece, the calibration piece comprising a first calibration block provided with positioning marker points and a second calibration block provided with auxiliary marker points. Specifically, different numbers of positioning marker points and auxiliary marker points are arranged in blocks on the calibration piece. The positioning marker points and the auxiliary marker points are used for calibration of the scanner, and the positioning marker points are also used to provide positioning of the marker points.
[0077] The positioning marker points are carefully arranged on the first calibration block and have clear geometric features and position information. In the embodiment, the positioning marker points can provide positioning reference for all other marker points (including the auxiliary marker points on the second calibration block) in addition to participating in calibration of the scanner. That is, the positions of all the marker points can be determined and recorded relative to the positioning marker points.
[0078] The auxiliary marker points are arranged on the second calibration block and work in cooperation with the positioning marker points on the first calibration block, and the auxiliary marker points can be randomly arranged on the second calibration block based on the analysis. It should be understood that the number of the second calibration blocks can be at least one, as long as the number of the auxiliary marker points is sufficient to enable accurate calibration of the scanner.
[0079] It should be noted that the first calibration block and the second calibration block are independently distributed calibration blocks. In other words, the two types of calibration blocks are physically separated, each having independent positioning marker points or auxiliary marker points, and there is no direct physical connection or dependency between them. In actual application, the placement positions of the calibration blocks can be freely arranged; the user only needs to place the calibration blocks on a platform or ground at will, and then the scanner can be used for scanning. The positioning marker points and the auxiliary marker points are attached to different calibration plates, and there is no need to use a whole calibration plate for calibration, so as to save the space occupied by the calibration plate. The independently distributed calibration blocks allow the user to flexibly arrange the positions and directions of the calibration blocks as needed, effectively improving the flexibility and convenience of the calibration device; in addition, as the calibration demand increases or changes, the user can easily add more independent calibration blocks to expand the coverage range or improve the calibration precision of the calibration device, and the scalability enables the calibration device to adapt to different application scenarios and precision requirements.
[0080] Figure 2 is a flowchart of a calibration method according to the embodiment, as shown in Figure 2 the flowchart comprises the following steps:
[0081] In step S210, a scanning image of the calibration piece scanned by the scanner is acquired.
[0082] Step S220, identify the positioning marker point data in the scanning image, and determine the positioning information according to the positioning marker point data.
[0083] In order to enable the computer program to quickly distinguish the positioning marker point from the scanning image of the calibration device scanned by the scanner in the calibration process, the size, type or shape of the positioning marker point can be designed to be different from those of the auxiliary marker points. For example, a non-standard or complex specific geometric shape such as a polygon (non-rectangular, non-circular), a star, a circle with a specific notch, etc. can be used as the positioning marker point. For another example, if the scanner supports color recognition, a specific color or color combination can be assigned to the positioning marker point, which is in sharp contrast with the background or other auxiliary markers. For another example, the positioning marker point can be designed to be larger than the surrounding other marker points or background elements, so as to be more prominent in the image and thus more easily captured by the detection algorithm. Therefore, for such positioning marker points, image processing algorithms (such as edge detection, template matching, etc.) can be used to identify the positioning marker points in the scanning image in this step.
[0084] Subsequently, the positioning of all the marker points on the calibration piece is performed based on the identified positioning marker points. Specifically, since the positioning marker points have been determined, the positions of the other marker points can be determined according to the positional relationship between the marker points on the calibration piece and the positioning marker points in the scanning image. Therefore, in this step, the position information of each positioning marker point can be determined based on the positioning marker point data identified above, and the positioning information that can be used to provide positioning for each marker point can be determined based on the position information of each positioning marker point. For example, the topological positional relationship between the positioning marker points (i.e., the position information of the positioning marker points) can be determined according to the positioning marker point data identified, and the topological positional relationship can be used as the positioning information. For another example, for the extrinsic calibration between the first camera and the second camera in the scanner, the first positioning marker point corresponding to the first camera and the second positioning marker point corresponding to the second camera can be identified according to the scanning images collected by the first camera and the second camera respectively, and the positional affine relationship (i.e., the position information of the positioning marker points) between the first positioning marker point and the second positioning marker point can be calculated and used as the positioning information.
[0085] Step S230, perform calibration calculation on each scanning image based on the positioning information, and generate the calibration result of the scanner.
[0086] After obtaining the positioning information, the marker point data including the marker points on the calibration piece in the scanning image can be identified according to the positioning information, and the corresponding relationship established according to the identified marker point data can be used to solve the internal parameters (such as focal length, distortion coefficient, etc.) and external parameters (such as position and direction) of each camera by using mathematical methods (such as least squares method, iterative optimization, etc.).
[0087] In the related art, when calibrating a scanner, the mark points on the calibration board for calibration are required to be arranged in order; in the calibration process, the scanner scans the calibration board frame by frame, and splices the images according to the arrangement order of the mark points on the calibration board, and finally realizes the calibration of the scanner. However, for the above-mentioned method, it is easy to be affected by light conditions, scanning speed, scanning angle and other aspects to cause frame loss and other problems, resulting in incorrect splicing of mark points.
[0088] The calibration method provided by the embodiments of the present application provides a calibration member composed of independently distributed first calibration blocks and second calibration blocks. The first calibration blocks are arranged with positioning mark points capable of providing positioning of each mark point. Therefore, the mark points on the calibration board do not need to be arranged in a certain order. Based on the scanning images of the calibration member scanned by the scanner, the positioning mark point data is identified and the positioning information is determined, and finally the calibration structure of the scanner is generated. There is no need to splice each frame of scanning image according to the arrangement order of the mark points, thereby avoiding the problem of incorrect splicing of mark points in the process of actually scanning with the scanner, and effectively improving the calibration accuracy and flexibility of the scanner.
[0089] In some embodiments, the scanning image includes a first scanning image of the first camera of the scanner scanning the calibration member, and a second scanning image of the second camera of the scanner scanning the calibration member; wherein the first scanning image includes first positioning mark point data and first auxiliary mark point data, and the second scanning image includes second positioning mark point data and second auxiliary mark point data.
[0090] Specifically, the calibration member is scanned by at least two cameras of the scanner to obtain respective first scanning images and second scanning images. The mark point feature data for subsequent calibration can be obtained by processing the mark point features of each scanning image. It should also be understood that the first scanning image scanned by the first camera of the scanner and the second scanning image scanned by the second camera of the scanner are images scanned at the same time. In other words, the multiple cameras of the scanner work simultaneously and collect respective corresponding scanning images at the same time.
[0091] The identification of the positioning mark point data in the scanning image, and the determination of the positioning information according to the positioning mark point data, can further include the following steps:
[0092] The first positioning mark point data and the second positioning mark point data are identified; the first affine relationship between the first positioning mark point data and the second positioning mark point data is determined; and the positioning information includes the first affine relationship.
[0093] Wherein, due to the function, manifestation and auxiliary marker points of the positioning marker points are different, the marker point feature data extracted from each scanning image can be further distinguished to obtain corresponding positioning marker point data and auxiliary marker point data. For example, a specific geometric shape of the positioning marker point can be used, and in actual application, the scanning image scanned by each camera of the scanner is processed for marker point features, and the marker point data containing the specific geometric shape is determined from the extracted features, which is the positioning marker point data.
[0094] Then, the first affine relationship is calculated according to the first positioning marker point data identified from the first scanning image scanned by the first camera and the second positioning marker point data identified from the second scanning image scanned by the second camera. The first affine relationship specifically refers to the linear transformation relationship from the two-dimensional coordinates of the first positioning marker point to the two-dimensional coordinates of the second positioning marker point. In general, the first affine relationship can be in the form of an affine matrix.
[0095] Specifically, a one-to-one matching relationship between the first positioning marker point data and the second positioning marker point data can be determined, and then the affine matrix is calculated according to the coordinate data of the matching point pairs, i.e. the first affine relationship is obtained. Alternatively, in another embodiment, the matching point pairs between the first positioning marker point data and the second positioning marker data can be iteratively calculated by a random consistency algorithm to obtain the optimal affine matrix.
[0096] Through the above embodiment, the first affine relationship is determined according to the first positioning marker point data and the second positioning marker point data scanned by different cameras of the scanner, which provides positioning for each marker point data. Each marker point can be arranged arbitrarily on the calibration object, so it is not necessary to set a calibration board with marker points arranged in a certain order, and it is not necessary to reconstruct and store the three-dimensional coordinates of each marker point on the calibration board when the calibration board is manufactured, thereby realizing an unordered, fast and accurate calibration method, and effectively improving the efficiency and accuracy of calibration.
[0097] In some embodiments, the positioning mark points described above include feature positioning mark points having preset recognition features. The preset recognition features are features determined when the calibration member is designed or manufactured, and are features intentionally set to distinguish the positioning mark points from the auxiliary mark points so as to be recognized by the computer program. The preset recognition features can include various types, such as shape, color, pattern, texture, size, position, etc. For example, the preset recognition features can be a preset size threshold, i.e., when the calibration member is manufactured, based on the preset recognition features, a mark point having a size larger than that of the auxiliary mark points is pasted at an arbitrary position on the first calibration block, and such a mark point is the feature positioning mark point. The preset size threshold can be set in advance according to actual application, for example, the preset size threshold can be determined according to the maximum size of the auxiliary mark points, or according to the average size of the mark points. In this embodiment, the number of the feature positioning mark points should be greater than or equal to four.
[0098] The identification of the first positioning mark point data and the second positioning mark point data can further include the following steps: based on the feature information of the preset recognition features, searching for first feature positioning mark point data in the first scan image; based on the first feature positioning mark point data, obtaining the first positioning mark point data; based on the feature information of the preset recognition features, searching for second feature positioning mark point data in the second scan image; and based on the second feature positioning mark point data, obtaining the second positioning mark point data.
[0099] In this embodiment, since the positioning mark points arranged on the first calibration block are preset as feature positioning mark points, based on this feature, the data of the positioning mark points can be accurately extracted from the scan image data based on the feature data of the extracted mark point data during the calibration process. The feature data can be size data such as diameter, side length or area of the mark points, or other feature data of the same type as the feature recognition features. For example, the feature positioning mark points are circular mark points having a radius greater than a preset radius threshold, and then the radius size of the mark point data extracted from the scan image scanned by each camera in the scanner is detected, and the mark point having a radius greater than the preset radius threshold is determined as the positioning mark point.
[0100] Taking the size feature of the preset recognition features including the size data greater than the preset size threshold as an example, the method further includes the following steps:
[0101] Based on the size feature information of the size feature, searching for first feature positioning mark point data having size data greater than the preset size threshold in the first scan image, and based on the size feature information, searching for first feature positioning mark point data having size data greater than the preset size threshold in the second scan image.
[0102] More specifically, please refer toFigure 3A The first calibration block 31 is provided with four large-size feature positioning marker points 32, and the arrangement order of each feature positioning marker point 32 on the first calibration block 31 can be random. Figure 3A The first calibration block 31 is provided with four large-size feature positioning marker points 32, and the arrangement order of each feature positioning marker point 32 on the first calibration block 31 can be random.
[0103] Alternatively, in another embodiment, the above positioning marker points include feature positioning marker points, and in addition, include common positioning marker points, and the common positioning marker points and the feature positioning marker points are arranged on the same first calibration block. The common positioning marker points refer to the marker points that, compared with the auxiliary marker points, do not have preset recognition features, that is, the appearance is the same as or similar to the auxiliary marker points, and the marker points are difficult to be directly distinguished and recognized from the auxiliary marker points by using a computer program. In this embodiment, the sum of the number of the feature positioning marker points and the number of the common positioning marker points is greater than or equal to four.
[0104] The above-mentioned identifying the first positioning marker point data can further include the following steps:
[0105] The first feature positioning marker point data in the first scanning image is searched, and first position information corresponding to the first feature positioning marker point data is obtained; based on the first position information, the marker point data closest to the first feature positioning marker point in the first scanning image is searched, and the marker point data is determined as the first common positioning marker point data; and the first positioning marker point data is obtained according to the first feature positioning marker point data and the first common positioning marker point data.
[0106] Firstly, the first positioning mark point data including the data of the first feature positioning mark point can be determined from the first scanning image by the above-mentioned feature positioning mark point detection method. Secondly, considering that the size and other feature data of the first common positioning mark point data in the first positioning mark point data are similar to the feature data of the auxiliary mark point data, it is difficult to distinguish the common positioning mark point data from the auxiliary mark point data based on the feature data; and the feature positioning mark point and the common positioning mark point are arranged on the first calibration block together. Therefore, based on the above analysis, for the common positioning mark point, the position information of the above-mentioned determined feature positioning mark point can be searched and determined.
[0107] Specifically, all the remaining mark points (excluding the first large feature positioning mark point) of the first scanning image can be traversed, and the distances between the first feature positioning mark point and the traversed mark points can be calculated according to the first position information of the first feature positioning mark point and the position information of the traversed mark points; in the case that the number of common positioning mark points is known, the mark points closest to the first feature positioning mark point and satisfying the number of common positioning mark points can be determined from the traversed remaining mark points as the common positioning mark points. Then, the first positioning mark point data includes the first feature positioning mark point data and the first common positioning mark point data.
[0108] Alternatively, in another embodiment, in order to improve the efficiency and accuracy of screening the common positioning mark point, a temporary point setting method can be used. For example, the coordinate mean value can be calculated according to the mark point coordinates of the determined feature positioning mark point data, that is, the above-mentioned first position information, and a temporary point at the coordinate mean value can be determined. The distances between the temporary point coordinates and all the remaining mark points can be calculated, and finally the first common positioning mark point can be determined.
[0109] Similarly, the above-mentioned identification of the second positioning mark point data can also include the following steps:
[0110] The second feature positioning mark point data in the second scanning image is searched, and the second position information corresponding to the second feature positioning mark point data is obtained; based on the second position information, the mark point data closest to the second feature positioning mark point in the second scanning image is searched, and the mark point data is determined as the second common positioning mark point data; and the second positioning mark point data is obtained according to the first feature positioning mark point data and the second common positioning mark point data.
[0111] Please refer to Figure 3B, a first calibration block 31 is provided with three feature positioning markers 32 and one common positioning marker 33. In addition, in order to improve the accuracy of the scanner in determining the positioning marker data from the scan image, in the embodiment, when the number of feature positioning markers 32 is at least two, the deployment position of the common positioning marker 33 on the first calibration block 31 is located at the center of the deployment position of the feature positioning markers 32 on the first calibration block 31. In this way Figure 3B Taking the first calibration block 31 shown in the figure as an example, the process of determining the positioning marker data in the scan image is briefly described below. First, according to the comparison results between the marker data in the scan image and the above-mentioned preset size threshold, the data of the three feature positioning markers 32 is determined. Next, for the data of the three feature positioning markers 32 in each scan image, the coordinate mean of the three markers is calculated to obtain the corresponding temporary point p. Search for the two-dimensional coordinate point in the marker data set corresponding to the scan image that is closest to point p. The searched two-dimensional point is the common positioning marker 33, and the positioning marker data in the two camera coordinate systems can be obtained and the affine matrix can be calculated.
[0112] Through the above-mentioned embodiments, by setting positioning markers of different sizes from auxiliary markers, the affine relationship between different camera coordinate systems can be provided, so as to realize accurate positioning of each marker, without the need for markers to be arranged in a certain order, which is conducive to improving the calibration efficiency and accuracy of the scanner.
[0113] In some embodiments, the above-mentioned determining the first affine relationship between the first positioning marker data and the second positioning marker data can further include the following steps:
[0114] Using the random consistency algorithm, iteratively calculating the second matching point pair between the first positioning marker data and the second positioning marker data; or, obtaining a preset prior matching point pair between the first positioning marker data and the second positioning marker data, determining the second matching point pair based on the prior matching point pair; and calculating the first affine relationship based on the second matching point pair.
[0115] In the embodiment, the matching point pairs between the first positioning mark point data and the second positioning mark point data can be determined by using a random consistency algorithm. In the random consistency algorithm, an initial matching point pair candidate set is randomly selected from the first positioning mark point data and the second positioning mark point data, parameters (i.e., an affine matrix) of an affine transformation are calculated using the matching point pair candidate set, and all other points in the data set are tested using the calculated affine matrix to see whether they satisfy the model. The points that satisfy the model are referred to as “inliers”, and the points that do not satisfy the model are referred to as “outliers” or “noise points”. The above steps are repeated multiple times (usually a maximum number of iterations is set or a threshold is set according to the number of inliers), and a new random sample set is used in each iteration. After each iteration, the model with the largest number of inliers is recorded as the current optimal model. Finally, the optimal model at the end of the iteration is determined as the first affine relationship. It should be understood that in the above manner of calculating the first affine relationship by iteration using the random consistency algorithm, the abnormal points in the data can be automatically processed, which helps to improve the accuracy of the calculation of the first affine relationship. By using the random consistency algorithm to determine the second matching point pair, the positional relationship between the positioning mark points or the topology formed thereby can be determined without knowing or determining the positional relationship of the positioning mark points in advance, which further improves the flexibility of the calibration process.
[0116] Alternatively, in another embodiment, when the number of the first calibration blocks is only one, the positional relationship between the positioning mark points or the topology formed thereby is fixed regardless of how the calibration blocks are placed during actual calibration. Based on this, the prior matching point pairs between the first positioning mark point data and the second positioning mark point data can be obtained by pre-scanning or using process data during the manufacturing of the calibration member, and then the second matching point pairs are determined based on the prior matching point pairs. By determining the second matching point pairs based on the prior matching point pairs, the matching point pairs between the positioning mark points can be quickly obtained, and the calibration efficiency is improved.
[0117] Next, an affine matrix is calculated based on the second matching point pairs, and finally the first affine relationship is obtained. Through the above embodiments, different ways of calculating the second matching point pairs are provided, so that the calculation process can be more adaptable to different application scenarios.
[0118] In some embodiments, the calibration calculation on the scanned images based on the positioning information to generate the calibration result of the scanner can further include the following steps:
[0119] Based on the first affine relationship, the first matching point pairs between the first scanned image and the second scanned image are determined, and the calibration result of the scanner is generated based on the first matching point pairs.
[0120] The first matching point pair refers to a matching pair between each marker point in the first scan image and each marker point in the second scan image. After the first affine relationship is calculated through the above steps, the marker point data extracted from the first scan image can be converted in the coordinate system based on the first affine relationship, and the coordinates of each marker point data in the first scan image are converted to the coordinate system of the second scan image to obtain the converted marker point data. Next, the converted marker point data is matched with each marker point data in the second scan image to find the nearest neighbor or the matching point pair that meets a certain distance threshold, that is, the first matching point pair is obtained.
[0121] Then, all or part (usually high quality and sufficient quantity) of the matching point pairs are used to optimize the initial pose transformation matrix between the first camera and the second camera in the scanner, and the optimized pose matrix (including rotation matrix and translation matrix) between the cameras is calculated to generate the calibration result for the scanner.
[0122] Through the above embodiment, the geometric transformation between images such as rotation, scaling and translation is considered based on the first affine relationship, so as to improve the accuracy of the matching point pair and help to generate more accurate calibration results.
[0123] In some embodiments, the determination of the first matching point pair in the first scan image and the second scan image based on the first affine relationship can further include the following steps:
[0124] The marker point data in the first scan image in the first camera coordinate system is converted to the second camera coordinate system based on the first affine relationship to obtain target marker point data; the marker point distance between the target marker point data and each marker point data in the second scan image is determined, and the first matching point pair is determined according to the comparison result between the marker point distance and the preset distance threshold.
[0125] The marker point data extracted from the first scan image includes marker point data of each marker point; at this time, the marker point data is in a three-dimensional space coordinate system with the first camera as the origin, that is, in the first camera coordinate system. In order to accurately search for the matching point pair in the two types of scan images, the first affine relationship calculated above can be used to convert the marker point data in the first camera coordinate system to a three-dimensional space coordinate system with the second camera as the origin, that is, to the second camera coordinate system, and the converted data point set is the target marker point data. After the marker point data in the first scan image is converted through the above steps, the marker point data of the first scan image can be unified to the coordinate system of the second scan image to facilitate the point pair matching of the two types of images.
[0126] Next, the target marker point data is traversed, the distance between the currently traversed target marker point data and each marker point data in the second scan image is compared, and it is determined whether the distance between each marker point and each marker point data in the second scan image is less than the distance threshold. If it is determined that the distance is less than the distance threshold, it is considered that the position distance between the marker point data of the currently traversed target marker point data and the marker point in the currently compared second scan image is relatively close, and the point pair of the current comparison can be taken as a matching pair. Otherwise, the distance between the marker point in the target marker point data and other marker point data in the second scan image is continuously compared until the marker point data in the second scan image that matches the marker point data in the currently traversed target marker point data is detected. For the marker point data in the next traversed target marker point data, the matching point search is also based on the above-mentioned distance threshold, until all the target marker point data is traversed, or a sufficient number of matching pairs are determined by the computer program, and finally a first matching point pair set is generated.
[0127] Through the above embodiment, the coordinates of each marker point data in the first scan image are converted to the coordinate system of the second scan image through the first affine relationship, so as to accurately search for the matching point pairs of each marker point in the two types of images, thereby realizing the accurate positioning of each marker point scanned by each camera in the scanner based on the affine relationship constructed by the positioning marker point, and improving the accuracy of the calibration.
[0128] In some embodiments, the above-mentioned generating a calibration result of the scanner according to the first matching point pair can further include the following steps:
[0129] Based on the number of first matching point pairs, it is detected whether the first affine relationship calculation is correct; and in the case where it is detected that the first affine relationship calculation is correct, a calibration result is generated according to the first matching point pair.
[0130] In this step, after the first matching point pair between each marker point data in the first scan image and each marker point data in the second scan image is determined by any of the above-mentioned ways, the number of the determined first matching point pair can be detected first to determine whether the current scan image is qualified. Specifically, a matching pair threshold value for comparing the number of matching point pairs of the current frame can be preset.
[0131] When it is detected that the number of the first matching point pairs is greater than or equal to the preset matching pair number threshold, it is considered that the number of matching point pairs between the marker point data determined from the first scanned image and the second scanned image based on the first affine relationship is sufficient, and it is considered that the first affine relationship calculated at the current time is correct. At this time, the first matching point pairs can be used to optimize the pose relationship of each camera in the scanner, and finally the calibration result of the scanner is generated.
[0132] When it is detected that the number of the first matching point pairs is less than the preset matching pair number threshold, it is considered that the first affine relationship calculated based on the current scanned image may be incorrect, resulting in an error in matching the marker point data in the scanned images collected by each camera of the scanner at the current time, and not enough matching point pairs can be matched. At this time, in order to ensure the accuracy of the marker points, the marker point data of the first scanned image and the second scanned image of the frame are not used for calibration calculation, but the cameras in the scanner are instructed to continue scanning the next frame and calculating matching point pairs until the number of matching point pairs corresponding to the frame reaches the matching point pair number threshold. Based on the matching point pairs, the pose transformation relationship between the cameras is optimized and calculated, and the corresponding calibration result is generated.
[0133] Through the above embodiments, in the calibration process of the scanner, the number of matching point pairs of the current frame is also detected to determine whether the first affine relationship calculated at the current time is correct, thereby avoiding the problem that the first affine relationship calculation error leads to calibration error or cannot continue normal calibration, thereby effectively improving the accuracy and efficiency of calibration.
[0134] In some embodiments, the above step of generating a calibration result of the scanner according to the first matching point pairs can further include the following steps:
[0135] Obtaining initial camera parameters of the scanner; calculating a first pose matrix between the first camera and the second camera according to the initial camera parameters and the first matching point pairs, and obtaining a calibration result.
[0136] The initial camera parameters refer to the initial camera intrinsic parameters, camera extrinsic parameters and distortion parameters of each camera in the scanner. The initial camera parameters can be provided by the manufacturer of the scanner, or calibrated and stored when the scanner is shipped. The initial camera extrinsic parameters include an initial pose transformation matrix between the first camera and the second camera in the scanner. The first matching point pairs provide coordinate information of corresponding points in the fields of view of the two cameras; these points can be used to estimate the relative pose between the two cameras.
[0137] In the actual calibration process, the initial camera parameters of the first camera and the second camera and the first matching point pairs can be input based on a computer program, and then a new pose matrix between the first camera and the second camera is calculated by optimization. Specifically, the initial pose transformation matrix can be used as a starting point, and the optimization algorithm can be started in combination with the intrinsic parameters, the distortion parameters and the first matching point pairs. In each iteration, the algorithm calculates the re-projection error of the matching point pairs according to the current pose matrix. The gradient is calculated according to the error, and the parameters (rotation and translation components) of the pose matrix are updated to reduce the re-projection error. The above steps are repeated until a preset number of iterations, an error threshold or other convergence conditions are reached. After iterative optimization, the obtained pose matrix between the first camera and the second camera is taken as the calibration result. The pose matrix describes the conversion relationship from the first camera coordinate system to the second camera coordinate system.
[0138] Through the above embodiments, a method of optimizing and calibrating the initial camera parameters based on the matching point pairs is provided, thereby facilitating the improvement of the accuracy of the calibration.
[0139] In addition, considering that the scanner can also include a color camera for collecting color texture information of the surface of the scanned object, in order to ensure the comprehensiveness of the calibration of different types of scanners, in some embodiments, a calibration method is provided for a scanner that also includes a color camera. In this method, based on the above process of generating the calibration result of the scanner, the following steps can also be included:
[0140] A third scan image of the color camera scan calibration object is obtained; the third scan image includes third positioning marker point data and third auxiliary marker point data. It should be noted that the third scan image scanned by the color camera is an image scanned at the same time as the first scan image scanned by the first camera of the scanner and the second scan image scanned by the second camera of the scanner.
[0141] The third positioning marker point data is identified; a second affine relationship between the first positioning marker point data and the third positioning marker point data is determined; the positioning information further includes the second affine relationship; and based on the second affine relationship, third matching point pairs between the first scan image and the third scan image are determined.
[0142] The second affine relationship refers to a linear transformation relationship from the two-dimensional coordinates of the first positioning marker point to the two-dimensional coordinates of the third positioning marker point. The determination method of the second affine relationship is similar to the determination method of the first affine relationship. For example, the random consistency algorithm can also be used to iteratively calculate the matching point pairs between the first positioning marker point data and the third positioning marker point data, and the second affine relationship is calculated.
[0143] The third matching point pair refers to a matching pair between each marker point in the first scan image and each marker point in the third scan image. Similarly, the determination manner of the third matching point pair can also be that each marker point data coordinate extracted in the first scan image is converted to a coordinate system in which the third scan image is located based on the second affine relationship, to obtain the marker point data after coordinate conversion. Next, the marker point data after coordinate conversion is matched with each marker point data in the third scan image, and a nearest neighbor or a matching point pair satisfying a certain distance threshold is found, that is, the third matching point pair is obtained.
[0144] It should be understood that, in the above calibration process for the scanner including the color camera, the number of the third matching point pair calculated can also be detected by the above manner of detecting the number of the first matching point pair to determine whether the first affine relationship is calculated correctly. If it is detected that the first affine relationship and the second affine relationship are both calculated correctly, the subsequent calibration steps are continued; otherwise, the current frame image data is discarded, and the next frame image is scanned and detected and calibrated.
[0145] According to the first matching point pair and the first pose matrix between the first camera and the second camera calculated, a three-dimensional point set in the first camera coordinate system is reconstructed. Specifically, in the above process of calibrating the extrinsic parameters between the first camera and the second camera, the optimized pose matrix between the first camera and the second camera can be calculated by any of the above embodiments, that is, the first pose matrix is obtained. For example, the initial camera parameters of the first camera and the second camera can be input, and the first pose matrix is calculated by optimization in combination with the first matching point pair.
[0146] Then, the three-dimensional point set in the first camera coordinate system can be reconstructed by the first matching point pair and the first pose matrix. The calculation process is briefly described below. First, the depth information of each two-dimensional point in the first matching point pair is obtained by a stereo matching algorithm or a binocular stereo vision camera composed of the first camera and the second camera; each two-dimensional point is converted to a three-dimensional space point according to the depth information; the three-dimensional point coordinates in the second camera coordinate system are unified to the first camera coordinate system by using the first pose matrix, and finally the three-dimensional point set is obtained.
[0147] According to the third matching point pair, a corresponding relationship between the two-dimensional point in the third scan image and the three-dimensional point in the set of three-dimensional points is determined. Wherein, the third matching point pair has determined the corresponding relationship between the two-dimensional point in the third scan image and the two-dimensional point in the first scan image, and the corresponding relationship between the two-dimensional point in the scan image of the binocular camera and the three-dimensional space point has also been determined through the reconstructed set of three-dimensional points. Therefore, based on the above analysis, a one-to-one corresponding relationship between the two-dimensional point in the third scan image and the three-dimensional space point can also be determined in this step.
[0148] Finally, based on the corresponding relationship, a second pose matrix between the first camera and the color camera is obtained; and the calibration result includes the first pose matrix and the second pose matrix. Specifically, according to the camera parameters such as the intrinsic parameters and the distortion parameters of the color camera, in combination with the corresponding relationship between the two-dimensional point and the three-dimensional point, the second pose matrix of the color camera to the first camera can be calculated by using a Perspective-n-Point (PNP) algorithm. Finally, through the above-mentioned manner, the extrinsic calibration between the cameras in the scanner is realized.
[0149] Through the above-mentioned embodiments, a calibration method for a scanner containing a color camera is also provided, which effectively expands the application scenarios of calibration. Moreover, in the calibration process of the color camera, the calculation by using the corresponding relationship between the two-dimensional point and the three-dimensional point also helps to improve the accuracy of calibration.
[0150] In some embodiments, the calibration method further includes the following steps:
[0151] According to the first matching point pair and the calculated first pose matrix between the first camera and the second camera, a set of three-dimensional points located in the first camera coordinate system is reconstructed; the three-dimensional point position information in the set of three-dimensional points is determined; and in the case that the three-dimensional point position information is located in a preset scan distance range, a calibration result is generated according to the first matching point pair.
[0152] Wherein, the three-dimensional point position information of the reconstructed set of three-dimensional points can be determined by calculating the three-dimensional coordinate mean value of each three-dimensional point in the set; and the three-dimensional coordinate mean value can be used to represent the value of the Z-direction coordinate of the scanner, that is, the distance value between the scanner and the calibration object in the current frame. Therefore, by comparing the three-dimensional point position information with the scan distance range set by the staff according to the actual situation, when it is detected that the three-dimensional point position information is located in the scan distance range, it indicates that the distance of the current scanner satisfies the error range of the set scan distance threshold, and then the fast calibration can be ended and the calibration result in the current frame can be generated in the case that the corresponding pose matrix of each camera in the scanner is calculated. Otherwise, the scanning and calibration of the next frame need to be continued until the scanning position of the scanner satisfies the scan distance threshold.
[0153] Through the above embodiments, the real-time scanning position of the scanner is determined by calculating the three-dimensional point position information, so as to ensure that the scanning position of the scanner meets a certain distance range during calibration, avoiding the problem that the scanner is too close or too far from the calibration part during scanning, which would affect the accuracy of the calibration results or cause calibration failure, and further improving the accuracy of calibration.
[0154] The following detailed description is based on specific embodiments. Figure 4 This is a schematic diagram of the structure of a calibration component according to an embodiment of this application, such as... Figure 4 As shown, the calibration component includes a first calibration block with positioning markers and a second calibration block 41 with auxiliary markers 42. The first calibration block is independently distributed with the other second calibration blocks 41, and the calibration blocks can be freely arranged and combined, or folded. The size and shape of the auxiliary markers 42 on the second calibration block 41 are the same as the ordinary positioning markers; the main difference between the two types of markers lies in their deployment position and function. Figure 4 Taking a calibration component consisting of one first calibration block and eight second calibration blocks 41 as an example, in practical applications, the user can remove these nine calibration blocks and place them on a flat surface. The first calibration block is preferably placed in the middle (it is not necessary to place it in the middle, as long as the cameras in the subsequent scanner can see the calibration block). The other eight second calibration blocks 42 are randomly arranged around it, requiring that the cameras in the subsequent scanner can easily see these small blocks.
[0155] Figure 5 This is a flowchart of another calibration method according to an embodiment of this application, such as... Figure 5 As shown, the process includes the following steps:
[0156] Step S501: Begin the calibration process; the user places the aforementioned calibration blocks on a flat surface, with the scanner facing the placed calibration device, and begins operation to capture images. The scanner includes a first camera, a second camera, and a color camera.
[0157] Step S502: Obtain the first scanned image G_l captured by the first camera, the second scanned image G_r captured by the second camera, and the color image C captured by the color camera. Marker point recognition is performed on the three images to obtain two-dimensional coordinate sets uv_l, uv_r, and uv_c. Each two-dimensional coordinate point contains the two-dimensional coordinates of the marker point and the lengths of the major and minor semi-axes of the ellipse.
[0158] Step S503, a threshold Y is set according to the length of the major and minor axes of each marker point in the uv_l, uv_r, uv_c set, and three large points in each set can be screened according to the detection of whether the length of the major and minor axes is greater than Y. In the above manner, the two-dimensional coordinate set sp_uv_l, sp_uv_r and sp_uv_c of the three large points of the first scan image, the second scan image and the color image are obtained respectively. Taking the first scan image as an example, according to the coordinates of the three large points, a temporary point p is calculated by calculating the mean value of the coordinates of the three large points, and the two-dimensional coordinate of the point closest to point p in the uv_l set is searched and added to the set sp_uv_l to obtain sp_uv_l'. The sp_uv_l' is the set of positioning marker points in the first calibration block. For the second scan image and the color image, the same logic can be used to calculate the corresponding sets sp_uv_r' and sp_uv_c'.
[0159] Step S504, for the pose calibration of the first camera and the second camera, first use the random consistency algorithm to calculate four matching point pairs in sp_uv_l' and sp_uv_r' and calculate the affine matrix H1 for a certain number of times, and then convert the two-dimensional points in uv_l to the two-dimensional coordinate system of the second camera through the matrix H1, and search for the two-dimensional points in the second scan image that are less than the threshold Y0 from the points in uv_r, to obtain the matching point pairs of the two-dimensional points between the first scan image and the second scan image. When the number of matching point pairs is greater than a certain threshold N, it is considered that the affine matrix H1 calculated this time is correct, and at this time the one-to-one matching relationship set match_lr of the two-dimensional points in uv_l and the two-dimensional points in uv_r is obtained. The initial internal and external parameters of the first camera and the second camera, and the two-dimensional point matching set match_lr are input, and the new pose transformation matrix RT_lr between the first camera and the second camera is calculated by optimization.
[0160] Step S505, the three-dimensional coordinate set POINT0 in the first camera coordinate system can be reconstructed by the new RT_lr and match_lr.
[0161] Step S506, for the pose calibration of the first camera and the color camera, first, using the random consistency algorithm, traversing a certain number of times to calculate the four matching point pairs in sp_uv_l' and sp_uv_c' and to calculate the affine matrix H2, and converting the two-dimensional points in uv_l to the two-dimensional coordinate system of the second camera through the matrix H2, and searching for the two-dimensional points in the color image which have a distance less than a threshold Y0 from the points in uv_r, to obtain the matching point pairs of the two-dimensional points between the first scan image and the color image. When the number of matching pairs is greater than a certain threshold N, it is considered that the affine matrix H2 calculated this time is correct. At this time, a one-to-one matching relationship set match_lc of the two-dimensional points in uv_l and the two-dimensional points in uv_c is obtained. According to match_lc and the three-dimensional coordinate set POINT0 calculated in the above step S5, a one-to-one correspondence relationship match_lc_2 between the two-dimensional points in the color image and the three-dimensional coordinate points in the three-dimensional coordinate set can be obtained. Finally, according to the intrinsic parameters of the color camera and the corresponding relationship match_lc_2 between the three-dimensional points and the two-dimensional points, the pose transformation matrix RT_lc of the color camera to the first camera can be calculated through the PNP method.
[0162] It should be noted that the steps shown in the above flow or the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from here.
[0163] The embodiment also provides a calibration device for a scanning system, the scanning system comprising a scanner and a calibration object, the calibration object comprising a first calibration block provided with positioning marker points and a second calibration block provided with auxiliary marker points; the first calibration block and the second calibration block are independently distributed calibration blocks; wherein the positioning marker points and the auxiliary marker points are used for calibration of the scanner, and the positioning marker points are also used to provide positioning of each marker point. The device is used to implement the above embodiment and preferred embodiment, which has been described. As used below, the terms "module", "unit", "sub-unit" and the like can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiment is preferably implemented in software, hardware, or a combination of software and hardware is also possible and contemplated.
[0164] Figure 6 is a structural block diagram of a calibration device according to an embodiment of the present application, as shown in Figure 6 The device comprises:
[0165] The acquisition module 61 is configured to acquire a scan image of the scanner scanning the calibration object.
[0166] The positioning module 62 is configured to identify positioning marker point data in the scanning image, and determine positioning information according to the positioning marker point data.
[0167] The generating module 63 is configured to perform calibration calculation on the scanning image based on the positioning information, and generate a calibration result of the scanner.
[0168] It should be noted that each of the above modules can be a functional module or a program module, and can be implemented by software or hardware. For the modules implemented by hardware, each of the above modules can be located in the same processor, or each of the above modules can be located in different processors in any combination. The specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation manners, and will not be described herein again.
[0169] The embodiment further provides a scanning system, Figure 7 as shown in the structural block diagram of a scanning system according to an embodiment of the present application, the system comprises a scanner 71, a calibration member 72 and a controller 73. Figure 7
[0170] The calibration member 72 comprises a first calibration block provided with positioning marker points and a second calibration block provided with auxiliary marker points; the first calibration block and the second calibration block are independently distributed calibration blocks; wherein the positioning marker points and the auxiliary marker points are used for calibration of the scanner, and the positioning marker points are further used for providing positioning of each marker point.
[0171] The controller 73 is connected to the scanner 71; the controller 73 stores a computer program, and the computer program is executed by a processor to implement the steps of the calibration method described in any of the above embodiments.
[0172] The embodiment further provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0173] Optionally, the electronic device can further comprise a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0174] Optionally, in the embodiment, the processor can be configured to perform the following steps through the computer program:
[0175] S1, obtaining a scanning image of a calibration member scanned by a scanner.
[0176] S2, identifying positioning marker point data in the scanning image, and determining positioning information according to the positioning marker point data.
[0177] S3, based on the positioning information, performing calibration calculation on each scanning image to generate a calibration result of the scanner.
[0178] It should be noted that the specific examples in the embodiments can refer to the examples described in the above embodiments and optional implementation manners, and the embodiments will not be described here.
[0179] In addition, in combination with the calibration method in the above embodiments, the embodiments of the present application can provide a storage medium for implementation. The storage medium has a computer program stored thereon. The computer program is executed by a processor to implement any one of the calibration methods in the above embodiments.
[0180] Those skilled in the art should understand that each technical feature of the above-described embodiments can be combined arbitrarily, and in order to make the description simple, each technical feature of the above-described embodiments has not been described all possible combinations, however, as long as the combination of these technical features does not exist contradictory, it should be considered as the scope of the present disclosure.
[0181] The above-described embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.
Claims
1. A calibration method characterized by, A scanning system comprises a scanner and a calibration object, the calibration object comprises a first calibration block provided with positioning mark points and a second calibration block provided with auxiliary mark points; the size, type or shape of the positioning mark points is different from that of the auxiliary mark points; The first calibration block and the second calibration block are independently distributed calibration blocks; the method comprises: acquiring a scanning image of the calibration object scanned by the scanner; identifying positioning mark point data in the scanning image, and determining positioning information according to the positioning mark point data; the positioning information is a topological positional relationship between the positioning mark points, or a positional affine relationship between a first positioning mark point and a second positioning mark point; the first positioning mark point is a positioning mark point corresponding to a first camera in the scanner, and the second positioning mark point is a positioning mark point corresponding to a second camera in the scanner; based on the positioning information, performing calibration calculation on each scanning image to generate a calibration result of the scanner, comprising: identifying mark point data of each mark point on the calibration object in the scanning image according to the positioning information, and then establishing a corresponding relationship according to the identified mark point data, and solving the internal parameters and external parameters of each camera by using a mathematical method.
2. The calibration method of claim 1, wherein The scanning image comprises a first scanning image of the calibration object scanned by a first camera of the scanner, and a second scanning image of the calibration object scanned by a second camera of the scanner; wherein the first scanning image comprises first positioning mark point data and first auxiliary mark point data, and the second scanning image comprises second positioning mark point data and second auxiliary mark point data; The identification of the positioning mark point data in the scanning image and the determination of the positioning information according to the positioning mark point data comprise: identifying the first positioning mark point data and the second positioning mark point data; determining a first affine relationship between the first positioning mark point data and the second positioning mark point data; the positioning information comprises the first affine relationship.
3. The calibration method of claim 2, wherein, The positioning mark points comprise feature positioning mark points having preset recognition features.
4. The calibration method of claim 3, wherein The identification of the first positioning mark point data and the second positioning mark point data comprises: based on feature information of the preset recognition features, searching for first feature positioning mark point data in the first scanning image; and acquiring the first positioning mark point data according to the first feature positioning mark point data; based on feature information of the preset recognition features, searching for second feature positioning mark point data in the second scanning image; and acquiring the second positioning mark point data according to the second feature positioning mark point data.
5. The calibration method of claim 4, wherein, The preset recognition features comprise size features with size data greater than a preset size threshold, and the method further comprises: Based on the size feature information of the size feature, the first feature positioning marker point data with size data greater than the preset size threshold in the first scan image is searched, and based on the size feature information, the first feature positioning marker point data with size data greater than the preset size threshold in the second scan image is searched.
6. The calibration method of claim 5, wherein, The positioning marker point further includes a common positioning marker point, and the common positioning marker point and the feature positioning marker point are arranged on the same first calibration block. The first feature positioning marker point data in the first scan image is searched, and first position information corresponding to the first feature positioning marker point data is acquired. Based on the first position information, the marker point data closest to the first feature positioning marker point in the first scan image is searched, and the marker point data closest to the first feature positioning marker point is determined as first common positioning marker point data. The first positioning marker point data is acquired according to the first feature positioning marker point data and the first common positioning marker point data. The second feature positioning marker point data in the second scan image is searched, and second position information corresponding to the second feature positioning marker point data is acquired. Based on the second position information, the marker point data closest to the second feature positioning marker point in the second scan image is searched, and the marker point data closest to the second feature positioning marker point is determined as second common positioning marker point data. The second positioning marker point data is acquired according to the first feature positioning marker point data and the second common positioning marker point data.
7. The calibration method of claim 2, wherein The first affine relationship between the first positioning marker point data and the second positioning marker point data is determined, including: The second matching point pair between the first positioning marker point data and the second positioning marker point data is iteratively calculated by using a random consistency algorithm; or The prior matching point pair between the first positioning marker point data and the second positioning marker point data is acquired, and the second matching point pair is determined based on the prior matching point pair; The first affine relationship is calculated based on the second matching point pair.
8. The calibration method of claim 2, wherein, The scan image is calibrated and calculated based on the positioning information to generate a calibration result of the scanner, including: The first matching point pair between the first scan image and the second scan image is determined based on the first affine relationship, and the calibration result is generated according to the first matching point pair.
9. The calibration method of claim 8, wherein, The first matching point pair between the first scan image and the second scan image is determined based on the first affine relationship, including: The marker point data in the first scan image in the first camera coordinate system is converted to the second camera coordinate system to obtain target marker point data based on the first affine relationship; The marker point distance between the target marker point data and each marker point data in the second scan image is determined, and the first matching point pair is determined according to the marker point distance and a preset distance threshold.
10. The calibration method of claim 8, wherein, The generating the calibration result according to the first matching point pair comprises: detecting whether the first affine relationship calculation is correct based on the number of the first matching point pairs; in the case of detecting that the first affine relationship calculation is correct, generating the calibration result according to the first matching point pair.
11. The calibration method of claim 8, wherein, The generating the calibration result according to the first matching point pair comprises: obtaining initial camera parameters of the scanner; calculating a first pose matrix between the first camera and the second camera according to the initial camera parameters and the first matching point pair, and obtaining the calibration result.
12. The calibration method of claim 8, wherein, The scanner further comprises a color camera; and the generating the calibration result of the scanner comprises: obtaining a third scanning image of the calibration object scanned by the color camera; the third scanning image comprises third positioning marker point data and third auxiliary marker point data; identifying the third positioning marker point data; determining a second affine relationship between the first positioning marker point data and the third positioning marker point data; the positioning information further comprises the second affine relationship; determining a third matching point pair between the first scanning image and the third scanning image based on the second affine relationship; reconstructing a three-dimensional point set in the first camera coordinate system according to the first matching point pair and the calculated first pose matrix between the first camera and the second camera; determining a corresponding relationship between a two-dimensional point in the third scanning image and a three-dimensional point in the three-dimensional point set according to the third matching point pair; obtaining a second pose matrix between the first camera and the color camera based on the corresponding relationship; the calibration result comprises the first pose matrix and the second pose matrix.
13. The calibration method of claim 8, wherein, The method further comprises: reconstructing a three-dimensional point set in the first camera coordinate system according to the first matching point pair and the calculated first pose matrix between the first camera and the second camera; determining three-dimensional point position information in the three-dimensional point set; in the case that the three-dimensional point position information is within a preset scanning distance range, generating the calibration result according to the first matching point pair.
14. A calibration device, characterized by The scanning system comprises a scanner and a calibration object; the calibration object comprises a first calibration block provided with positioning marker points and a second calibration block provided with auxiliary marker points; the size, type or shape of the positioning marker points is different from the size, type or shape of the auxiliary marker points; The first calibration block and the second calibration block are independently distributed calibration blocks; the device comprises: an acquisition module configured to acquire a scanning image of the calibration object scanned by the scanner; a positioning module configured to identify positioning marker point data in the scanning image, and determine positioning information according to the positioning marker point data; the positioning information is a topological position relationship between the positioning marker points, or a position affine relationship between a first positioning marker point and a second positioning marker point; the first positioning marker point is a positioning marker point corresponding to a first camera in the scanner, and the second positioning marker point is a positioning point corresponding to a second camera in the scanner; The generating module is configured to perform calibration calculation on the scanning image based on the positioning information to generate a calibration result of the scanner, including: identifying, according to the positioning information, mark point data of each mark point on the calibration member included in the scanning image, and then establishing a corresponding relationship according to the identified mark point data, and solving internal parameters and external parameters of each camera by using a mathematical method.
15. A scanning system characterized by, The system comprises a scanner, a calibration member and a controller. The calibration member comprises a first calibration block provided with positioning mark points and a second calibration block provided with auxiliary mark points; the size, type or shape of the positioning mark points are different from the size, type or shape of the auxiliary mark points; the first calibration block and the second calibration block are independently distributed calibration blocks. The controller is connected to the scanner; the controller stores a computer program, and the computer program is executed by a processor to realize the steps of the calibration method in any one of claims 1 to 13.
Citation Information
Patent Citations
Mistaking identification point removal method of scanner calibration plate image and calibration plate
CN103150721A
Point pair matching method and device, electronic equipment and storage medium
CN113591977A