Calibration method and device and scanning system
By using independently distributed calibration blocks and auxiliary marking points in the three-dimensional scanning system, the problem of calibration accuracy and low efficiency in the prior art is solved, disordered, fast and accurate calibration is achieved, and the efficiency and accuracy of calibration is improved.
Patent Information
- Application Number
- CN202411960887.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-28
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2044-12-28
AI Technical Summary
In the existing three-dimensional scanning technology, the accuracy and efficiency of calibration are inefficient, mainly because the three-dimensional coordinates of the marking points on the calibration plate need to be rebuilt before leaving the factory, and the marking points need to be arranged in order, which can easily lead to incorrect splicing of marking points.
Using a calibration component composed of an independently distributed first calibration block and a second calibration block, positioning marking points are deployed on the first calibration block and auxiliary marking points are deployed on the second calibration block. By obtaining the scanned image of the scanner scanning calibration component, identifying the positioning mark point data, determining the positioning information, and performing calibration calculations based on this to generate the calibration result of the scanner.
A disordered, fast and accurate calibration method is realized, which avoids marking point splicing errors, improves calibration efficiency and accuracy, and does not require pre-reconstruction of the three-dimensional coordinates on the calibration plate.
Smart Images

Figure CN119958461A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of three-dimensional scanning, and in particular to a calibration method, device and scanning system. Background Art
[0002] With the development and maturity of digital image processing, digital projection display and computer processing technology, 3D scanning technology has developed rapidly. The 3D scanning system can project light onto the surface of an object, and the camera device can capture the image under the projection of light. According to the shape of the captured image, the 3D reconstruction algorithm is used to reconstruct the 3D size information of the object surface. In order to ensure the accuracy of the reconstruction, the scanner in the scanning system needs to be calibrated with external parameters.
[0003] In the related art, the scanner is usually calibrated using a calibration plate arranged at the calibration site, and the marking points on the calibration plate need to be arranged in an orderly and neat manner. Therefore, the above calibration method is prone to cause marking point splicing errors during the actual scanning process with the scanner, and requires that the three-dimensional coordinates of the marking points on the calibration plate must be reconstructed before leaving the factory, thereby affecting the accuracy and efficiency of the calibration.
[0004] Currently, no effective solution has been proposed to address the problems of low accuracy and efficiency of calibration in related technologies. Summary of the invention
[0005] The embodiments of the present application provide a calibration method, device and scanning system to at least solve the problems of low accuracy and efficiency of calibration in the related art.
[0006] In a first aspect, an embodiment of the present application provides a calibration method, characterized in that it is used for a scanning system, the scanning system includes a scanner and a calibration piece, the calibration piece includes a first calibration block provided with a positioning mark point and a second calibration block provided with an auxiliary mark point; the first calibration block and the second calibration block are independently distributed calibration blocks; the method includes:
[0007] Acquire a scanned image of the calibration piece scanned by the scanner;
[0008] Identifying positioning mark point data in the scanned image, and determining positioning information based on the positioning mark point data;
[0009] Based on the positioning information, a calibration calculation is performed on the scanned image to generate a calibration result of the scanner.
[0010] In some embodiments, the scanned image includes a first scanned image of the calibration object scanned by the first camera of the scanner, and a second scanned image of the calibration object scanned by the second camera of the scanner; wherein the first scanned image includes first positioning mark point data and first auxiliary mark point data, and the second scanned image includes second positioning mark point data and second auxiliary mark point data;
[0011] The step of identifying the positioning mark point data in the scanned image and determining the positioning information according to the positioning mark point data includes:
[0012] Identify the first positioning mark point data and the second positioning mark point data; determine a first affine relationship between the first positioning mark point data and the second positioning mark point data; and the positioning information includes the first affine relationship.
[0013] In some embodiments, the positioning mark points include: feature positioning mark points having preset identification features.
[0014] In some embodiments, the identifying the first positioning mark point data and the second positioning mark point data includes:
[0015] Based on the feature information of the preset identification feature, searching for first feature positioning mark point data in the first scanned image; and acquiring the first positioning mark point data according to the first feature positioning mark point data;
[0016] Based on the feature information of the preset identification feature, the second feature positioning mark point data in the second scanned image is searched; and according to the second feature positioning mark point data, the second positioning mark point data is acquired.
[0017] In some embodiments, the preset identification feature includes a size feature whose size data is greater than a preset size threshold, and the method further includes:
[0018] Based on the size feature information of the size feature, search for the first feature positioning mark point data in the first scanned image whose size data is greater than the preset size threshold, and based on the size feature information, search for the first feature positioning mark point data in the second scanned image whose size data is greater than the preset size threshold.
[0019] In some embodiments, the positioning mark point further includes: a common positioning mark point, and the common positioning mark point and the characteristic positioning mark point are arranged on the same first calibration block; the identifying of the first positioning mark point data and the second positioning mark point data includes:
[0020] Searching for first feature positioning mark point data in the first scanned image, and obtaining first position information corresponding to the first feature positioning mark point data;
[0021] Based on the first position information, searching the first scanned image for the mark point data that is closest to the first feature positioning mark point, and determining the mark point data as the first common positioning mark point data;
[0022] Acquire the first positioning mark point data according to the first characteristic positioning mark point data and the first common positioning mark point data;
[0023] Searching for second feature positioning mark point data in the second scanned image, and acquiring second position information corresponding to the second feature positioning mark point data;
[0024] Based on the second position information, searching the second scanned image for the mark point data that is closest to the second characteristic positioning mark point, and determining the mark point data as the second common positioning mark point data;
[0025] The second positioning mark point data is acquired according to the first characteristic positioning mark point data and the second common positioning mark point data.
[0026] In some embodiments, determining a first affine relationship between the first positioning mark point data and the second positioning mark point data includes:
[0027] Iteratively calculating a second matching point pair between the first positioning mark point data and the second positioning mark point data using a random consistency algorithm; or,
[0028] Acquire a preset a priori matching point pair between the first positioning mark point data and the second positioning mark point data, and determine the second matching point pair based on the a priori matching point pair;
[0029] Based on the second matching point pair, the first affine relationship is calculated.
[0030] In some embodiments, the step of performing calibration calculation on the scanned image based on the positioning information to generate a calibration result of the scanner includes:
[0031] Based on the first affine relationship, a first matching point pair between the first scanned image and the second scanned image is determined, and the calibration result is generated according to the first matching point pair.
[0032] In some embodiments, determining a first pair of matching points in the first scanned image and the second scanned image based on the first affine relationship includes:
[0033] Based on the first affine relationship, the marker point data in the first scanned image in the first camera coordinate system is converted to the second camera coordinate system to obtain target marker point data;
[0034] Determine the target marking point data and the marking point distance between each marking point data in the second scanned image, and determine the first matching point pair according to the marking point distance and a preset distance threshold.
[0035] In some embodiments, generating the calibration result according to the first matching point pair includes:
[0036] Based on the number of the first matching point pairs, detecting whether the first affine relationship is calculated correctly;
[0037] When it is detected that the first affine relationship is calculated correctly, the calibration result is generated according to the first matching point pair.
[0038] In some embodiments, generating the calibration result according to the first matching point pair includes:
[0039] Obtaining initial camera parameters of the scanner;
[0040] A first posture matrix between the first camera and the second camera is calculated according to the initial camera parameters and the first matching point pair, and the calibration result is obtained.
[0041] In some embodiments, the scanner further includes a color camera; and generating a calibration result of the scanner includes:
[0042] Acquire a third scanned image of the calibration piece scanned by the color camera; the third scanned image includes third positioning mark point data and third auxiliary mark point data;
[0043] Identify the third positioning mark point data; determine a second affine relationship between the first positioning mark point data and the third positioning mark point data; the positioning information also includes the second affine relationship;
[0044] Based on the second affine relationship, determining a third matching point pair between the first scanned image and the third scanned image;
[0045] Reconstructing a three-dimensional point set in a first camera coordinate system according to the first matching point pair and the calculated first posture matrix between the first camera and the second camera;
[0046] Determining, according to the third matching point pair, a correspondence between the two-dimensional points in the third scanned image and the three-dimensional points in the three-dimensional point set;
[0047] Based on the corresponding relationship, a second posture matrix between the first camera and the color camera is obtained; and the calibration result includes the first posture matrix and the second posture matrix.
[0048] In some embodiments, the method further comprises:
[0049] Reconstructing a three-dimensional point set in a first camera coordinate system according to the first matching point pair and the calculated first posture matrix between the first camera and the second camera;
[0050] Determining three-dimensional point position information in the three-dimensional point set;
[0051] When the three-dimensional point position information is within a preset scanning distance range, the calibration result is generated according to the first matching point pair.
[0052] In a second aspect, an embodiment of the present application provides a calibration device for a scanning system, wherein the scanning system includes a scanner and a calibration member, wherein the calibration member includes a first calibration block provided with positioning marking points and a second calibration block provided with auxiliary marking points; the first calibration block and the second calibration block are independently distributed calibration blocks; the device includes:
[0053] An acquisition module, used for acquiring a scanned image of the calibration piece scanned by the scanner;
[0054] A positioning module, used to identify positioning mark point data in the scanned image, and determine positioning information according to the positioning mark point data;
[0055] A generation module is used to perform calibration calculation on the scanned image based on the positioning information to generate a calibration result of the scanner.
[0056] In a third aspect, an embodiment of the present application provides a scanning system, the system comprising a scanner, a calibration element and a controller;
[0057] The calibration piece comprises a first calibration block provided with positioning marking points and a second calibration block provided with auxiliary marking points; the first calibration block and the second calibration block are independently distributed calibration blocks;
[0058] The controller is connected to the scanner; a computer program is stored on the controller, and when the computer program is executed by the processor, the steps of the calibration method described in the first aspect are implemented.
[0059] Compared with the related art, the calibration method, device and scanning system provided by the embodiment of the present application, the scanning system includes a scanner and a calibration part, the calibration part includes 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; the scanning image of the calibration part is obtained by the scanner; the positioning mark point data in the scanning image is identified, and the positioning information is determined according to the positioning mark point data; based on the positioning information, the calibration calculation is performed on each of the scanning images to generate the calibration result of the scanner. Based on this, each mark point can be arranged arbitrarily on the calibration part, so there is no need to set a calibration plate with the mark points arranged in an orderly manner in a certain order, and there is no need to rebuild and store the three-dimensional coordinates of each mark point on the calibration plate when the calibration plate leaves the factory, thereby realizing a disordered, fast and accurate calibration method, and effectively improving the efficiency and accuracy of calibration.
[0060] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0062] Figure 1 It is a hardware structure block diagram of a terminal of a calibration method in an embodiment of the present application;
[0063] Figure 2 is a flow chart 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 schematic structural diagram of a calibration component according to an embodiment of the present application;
[0067] Figure 5 is a flow chart 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 It is a structural block diagram of a scanning system according to an embodiment of the present application. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.
[0071] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0072] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0073] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 is a hardware structure block diagram of a terminal of a calibration method in an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0074] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a calibration method in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a 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 a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0075] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0076] This embodiment provides a calibration method for a scanning system, the scanning system includes a scanner and a calibration member, the calibration member includes a first calibration block provided with positioning marking points and a second calibration block provided with auxiliary marking points. Specifically, different numbers of positioning marking points and auxiliary marking points are installed and set in blocks on the calibration member. The positioning marking points and the auxiliary marking points are used for calibration of the scanner, and the positioning marking points are also used to provide positioning of each marking point.
[0077] The above-mentioned positioning mark points are carefully deployed on the first calibration block and have clear geometric features and position information. In the embodiment of the present application, in addition to participating in the calibration of the scanner, each positioning mark point can provide a positioning reference for all other mark points (including the auxiliary mark points on the second calibration block). That is, the positions of all mark points can be determined and recorded relative to the positioning mark points.
[0078] The auxiliary marking points are deployed on the second calibration block and work together with the positioning marking points on the first calibration block; and based on the above analysis, the auxiliary marking points can be randomly arranged on the second calibration block. It should be understood that there can be at least one second calibration block, as long as the number of auxiliary marking points is sufficient so that the scanner can be accurately calibrated.
[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 with independent positioning mark points or auxiliary mark points, and there is no direct physical connection or dependency between them. In actual application, the placement of each calibration block can be freely arranged and combined; the user only needs to place each calibration block on a platform or the ground at will and scan it with a scanner. The positioning mark points and the auxiliary mark points are attached separately to different calibration boards, and there is no need to use a complete calibration board for calibration, which is conducive to saving the space occupied by the calibration board. And the above-mentioned independently distributed calibration blocks allow users to flexibly arrange their positions and directions as needed, which effectively improves the flexibility and convenience of the calibration device; in addition, as the calibration requirements increase or change, users can easily add more independent calibration blocks to expand the coverage of the calibration device or improve the calibration accuracy. This scalability enables the calibration device to adapt to different application scenarios and accuracy requirements.
[0080] Figure 2 is a flow chart of a calibration method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0081] Step S210, obtaining a scanned image of the calibration object scanned by a scanner.
[0082] Step S220, identifying the positioning mark point data in the scanned image, and determining the positioning information according to the positioning mark point data.
[0083] In order for the computer program to be able to quickly distinguish the positioning mark points from the scanned image of the calibration device by the scanner during the calibration process, the size, type or shape of the positioning mark points can be designed to be different from the size, type or shape of the auxiliary mark points. For example, non-standard or complex specific geometric shapes can be used as positioning mark points, such as polygons (non-rectangular, non-circular), stars, circles with specific gaps, etc. For another example, if the scanner supports color recognition, the positioning mark points can be given a specific color or color combination to form a sharp contrast with the background or other auxiliary marks. For another example, the positioning mark points can be designed to be larger than other surrounding mark points or background elements, which can make them more prominent in the image and easier to be captured by the detection algorithm. Therefore, for this type of positioning mark points, in this step, image processing algorithms (such as edge detection, template matching, etc.) can be used to identify the positioning mark points in the scanned image.
[0084] Afterwards, all the marking points on the calibration part are positioned based on the identified positioning marking points. Specifically, since the positioning marking points have been determined, the positions of other marking points can be determined based on the positional relationship between each marking point on the calibration part and the positioning marking points in the scanned image; therefore, in this step, the position information of each positioning marking point can be determined based on the above-identified positioning marking point data, and then the positioning information that can be used to provide positioning for each marking point can be determined based on the positional information of each positioning marking point. For example, the topological positional relationship between each positioning marking point in the identified positioning marking point data (that is, the positional information of the above-mentioned positioning marking points) can be used as the positioning information; for another example, for the external parameter calibration between the first camera and the second camera in the scanner, the first positioning marking point corresponding to the first camera and the second positioning marking point corresponding to the second camera can be identified based on the scanned images collected by the first camera and the second camera, and the positional affine relationship between the first positioning marking point and the second positioning marking point (that is, the positional information of the above-mentioned positioning marking points) can be calculated, and the positional affine relationship can be used as the positioning information.
[0085] Step S230: performing calibration calculation on each scanned image based on the positioning information to generate a calibration result of the scanner.
[0086] After obtaining the positioning information, the marking point data of each marking point on the calibration part can be identified in the scanned image according to the positioning information, and then the corresponding relationship can be established based on the identified marking point data, and mathematical methods (such as least squares method, iterative optimization, etc.) 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.
[0087] In the related art, when calibrating a scanner, it is often required that the marking points on the calibration plate used for calibration must be arranged in order; during the calibration process, the scanner scans the calibration plate frame by frame, and splices each frame image according to the arrangement order of the marking points on the calibration plate, and finally calibrates the scanner. However, the above method is easily affected by light conditions, scanning speed, scanning angle, etc., causing frame loss and other problems, resulting in marking point splicing errors.
[0088] The embodiment of the present application provides a calibration piece consisting of an independently distributed first calibration block and a second calibration block through the above-mentioned calibration method. Positioning mark points that can provide the positioning of each marking point are deployed on the first calibration block. Therefore, the marking points on the calibration plate do not need to be arranged in a certain order. The positioning mark point data is identified and the positioning information is determined based on the scanning image of the calibration piece scanned by the scanner. Finally, the calibration structure of the scanner is generated. There is no need to splice the scanned images of each frame according to the arrangement order of the marking points, thereby avoiding the problem of marking point splicing errors that are easy to cause during the actual scanning process with the scanner, and effectively improving the calibration accuracy and flexibility of the scanner.
[0089] In some embodiments, the scanned image includes a first scanned image of the calibration object scanned by a first camera of the scanner, and a second scanned image of the calibration object scanned by a second camera of the scanner; wherein the first scanned image includes first positioning mark point data and first auxiliary mark point data, and the second scanned image includes second positioning mark point data and second auxiliary mark point data;
[0090] Specifically, at least two cameras of the scanner calibrate the parts and scan them respectively to obtain their respective first scanned images and second scanned images. Mark point feature processing is performed on each scanned image to obtain marker point feature data for subsequent calibration. It should also be understood that the first scanned image scanned by the first camera of the above-mentioned scanner and the second scanned 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 their respective corresponding scanned images at the same time.
[0091] The above-mentioned identifying the positioning mark point data in the scanned image and determining the positioning information according to the positioning mark point data may also include the following steps:
[0092] Identify the first positioning mark point data and the second positioning mark point data; determine the first affine relationship between the first positioning mark point data and the second positioning mark point data; the positioning information includes the first affine relationship.
[0093] Among them, since the role and expression form of the positioning mark point are different from those of the auxiliary mark point, the mark point feature data extracted from each scanned image can be further distinguished to obtain the corresponding positioning mark point data and auxiliary mark point data. For example, positioning mark points of specific geometric shapes can be used. In actual applications, the scanned images scanned by each camera of the scanner are processed with mark point features, and the mark point data containing the above-mentioned specific geometric shapes are determined from the extracted features. This type of mark point data is the positioning mark point data.
[0094] Then, the first affine relationship is calculated based on the first positioning mark point data identified in the first scanned image scanned by the first camera and the second positioning mark point data identified in the second scanned 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 mark point to the two-dimensional coordinates of the second positioning mark point; under normal circumstances, the first affine relationship can be expressed in the form of an affine matrix.
[0095] Specifically, the one-to-one matching relationship between the first positioning mark point data and the second positioning mark point data can be determined, and then the affine matrix is calculated according to the coordinate data of the matching point pairs between the two, so as to obtain the above-mentioned first affine relationship. Alternatively, in another embodiment, the matching point pairs between the first positioning mark point data and the second positioning mark 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 mark point data and the second positioning mark point data scanned by different cameras in the scanner, and positioning is provided for each mark point data. Each mark point can be arranged arbitrarily on the calibration part. Therefore, there is no need to set a calibration plate in which the mark points are arranged in an orderly manner in a certain order, and there is no need to rebuild and store the three-dimensional coordinates of each mark point on the calibration plate when the calibration plate leaves the factory, 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 include: feature positioning mark points with preset identification features. The preset identification features refer to features that have been determined when designing or making the calibration part, and are set specifically to distinguish the positioning mark points from the auxiliary mark points so that they can be identified by the computer program. The preset identification features can include various types, such as shape, color, pattern, texture, size, position, etc. For example, the preset identification feature can be a preset size threshold, that is, when making the calibration part, based on the preset identification feature, a mark point with a size larger than the size of the auxiliary mark point is pasted at any position on the first calibration block, and this type of mark point is the above-mentioned feature positioning mark point. The above-mentioned preset size threshold can be set in advance according to the actual application situation. For example, the preset size threshold can be determined according to the maximum size of the auxiliary mark point, or the preset size threshold can be determined according to the size average of each mark point. In this embodiment, the number of feature positioning mark points should be greater than or equal to four.
[0098] The above-mentioned identification of the first positioning mark point data and the second positioning mark point data may also include the following steps: based on the feature information of the preset recognition feature, searching for the first feature positioning mark point data in the first scanned image; according to the first feature positioning mark point data, obtaining the first positioning mark point data; based on the feature information of the preset recognition feature, searching for the second feature positioning mark point data in the second scanned image; according to the second feature positioning mark point data, obtaining the second positioning mark point data.
[0099] Among them, since the positioning mark points arranged on the first calibration block are pre-set as feature positioning mark points; based on this feature, it is convenient to accurately extract the data of the positioning mark points from the scanned image data based on various feature data of the extracted mark point data during the calibration process. The feature data can be dimensional data such as the diameter, side length or area of the mark point, or other feature data of the same type as the feature recognition feature. For example, the feature positioning mark point uses a circular mark point with a radius greater than the corresponding preset radius threshold. In the scanned image scanned by each camera in the scanner, the radius size of the mark point data that can be extracted is detected, and the mark point with a radius greater than the preset radius threshold is determined as the positioning mark point.
[0100] Taking the above-mentioned preset identification feature including a size feature whose size data is greater than a preset size threshold as an example, the above-mentioned method further includes the following steps:
[0101] Based on the size feature information of the size feature, first feature positioning mark point data whose size data is greater than a preset size threshold is searched in the first scanned image, and based on the size feature information, first feature positioning mark point data whose size data is greater than the preset size threshold is searched in the second scanned image.
[0102] More specifically, see Figure 3A , a first calibration block 31 is provided with four large-sized feature positioning marking points 32, and the arrangement order of the feature positioning marking points 32 on the first calibration block 31 can be random. Figure 3A Taking the first calibration block 31 shown as an example, the process of determining the positioning marker point data in the scanned image is briefly described below. The marker points are identified for the first scanned image and the second scanned image respectively to obtain a marker point data set in each camera coordinate system; wherein each marker point data includes the two-dimensional coordinates of the marker point and the length of the major and minor axes of the ellipse. A corresponding preset size threshold is set according to the length of the major and minor axes of each marker point in the marker point data set, and four feature positioning marker point 32 data whose major and minor axis lengths in each set are greater than the preset size threshold are respectively selected from each marker point data set, and then the affine matrix between each marker point data in the two types of scanned images can be calculated based on the feature positioning marker point 32 data.
[0103] Alternatively, in another embodiment, the positioning mark points include characteristic positioning mark points and also include common positioning mark points, and the common positioning mark points and the characteristic positioning mark points are arranged on the same first calibration block. The common positioning mark points refer to mark points that do not have preset identification features compared to the auxiliary mark points, that is, they are identical or similar to the auxiliary mark points in appearance, and are difficult to be directly distinguished and identified from the auxiliary mark points using a computer program. In this embodiment, the sum of the number of characteristic positioning mark points and the number of common positioning mark points is greater than or equal to four.
[0104] The above-mentioned identifying the first positioning mark point data may further include the following steps:
[0105] Search for the first feature positioning marker point data in the first scanned image, and obtain the first position information corresponding to the first feature positioning marker point data; based on the first position information, search for the marker point data in the first scanned image that is closest to the first feature positioning marker point, and determine the marker point data as the first common positioning marker point data; obtain the first positioning marker point data based on the first feature positioning marker point data and the first common positioning marker point data.
[0106] First, through the above-mentioned method of detecting the characteristic positioning mark points, the data of the first characteristic positioning mark points included in the first positioning mark point data can be determined from the first scanned image. Secondly, considering that the first common positioning mark data in the first positioning mark point data, its feature data such as size is 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 in the positioning mark points based on the feature data; and the characteristic positioning mark points and the common positioning mark points are both arranged together as positioning mark points on the first calibration block. Therefore, based on the above analysis, for the common positioning mark points, they can be searched and determined based on the position information of the above-mentioned determined characteristic positioning mark points.
[0107] Specifically, all remaining marking points of the first scanned image (excluding the first major feature positioning marking point) can be traversed, and the distances between them and the first feature positioning marking point can be calculated in sequence according to the first position information of the first feature positioning marking point data and the position information of the traversed marking points; when the number of common positioning marking points is known, the marking point with the closest distance that meets the number of common positioning marking points can be determined from the remaining traversed marking points as the common positioning marking point. Then the above-mentioned first positioning marking point data includes the first feature positioning marking point data and the first common positioning marking point data.
[0108] Alternatively, in another embodiment, in order to improve the efficiency and accuracy of screening common positioning mark points, a temporary point setting method can be adopted. For example, the coordinate mean can be calculated based on the mark point coordinates of each feature positioning mark point data that has been determined, that is, the above-mentioned first position information, and a temporary point under the coordinate mean can be determined. All remaining mark points are traversed, and the distance between them and the temporary point coordinates is calculated, and finally the first common positioning mark point is determined.
[0109] Similarly, the above-mentioned identification of the second positioning mark point data may also include the following steps:
[0110] Search for the second feature positioning marker point data in the second scanned image, and obtain the second position information corresponding to the second feature positioning marker point data; based on the second position information, search for the marker point data in the second scanned image that is closest to the second feature positioning marker point, and determine the marker point data as the second common positioning marker point data; obtain the second positioning marker point data based on the first feature positioning marker point data and the second common positioning marker point data.
[0111] See also Figure 3B, a first calibration block 31 is provided with three characteristic positioning mark points 32 and one common positioning mark point 33. In addition, in order to improve the accuracy of the scanner in determining the positioning mark point data from the scanned image, in this embodiment, when there are at least two characteristic positioning mark points 32, the deployment position of the common positioning mark point 33 on the first calibration block 31 is located at the center of the deployment position of the characteristic positioning mark point 32 on the first calibration block 31. Figure 3B Taking the first calibration block 31 shown as an example, the process of determining the positioning mark point data in the scanned image is briefly described below. First, based on the comparison result between the data of each mark point in the scanned image and the above-mentioned preset size threshold, the three characteristic positioning mark point 32 data are determined. Next, for the three characteristic positioning mark point 32 data in each scanned image, the coordinate mean of the three mark points is calculated to obtain the corresponding temporary point p. Search the mark point data set corresponding to the scanned image for the two-dimensional coordinate point closest to point p. The searched two-dimensional point is the common positioning mark point 33, and then the positioning mark point data in the two camera coordinate systems can be obtained and the affine matrix can be calculated.
[0112] Through the above embodiment, by setting positioning mark points with different sizes from the auxiliary mark points, an affine relationship between different camera coordinate systems can be provided, thereby achieving accurate positioning of each mark point. There is no need to arrange the mark points in a certain order, which is beneficial to improving the calibration efficiency and accuracy of the scanner.
[0113] In some embodiments, the determining of the first affine relationship between the first positioning mark point data and the second positioning mark point data may further include the following steps:
[0114] Using a random consistency algorithm, iteratively calculate the second matching point pair between the first positioning marker point data and the second positioning marker point data; or, obtain a priori matching point pair between the preset first positioning marker point data and the second positioning marker point data, and determine the second matching point pair based on the prior matching point pair; based on the second matching point pair, calculate the first affine relationship.
[0115] In this embodiment, the matching point pairs between the first positioning mark point data and the second positioning mark point data can be calculated and determined by a random consistency algorithm. Among them, by randomly selecting an initial matching point pair candidate set from the first positioning mark point data and the second positioning mark point data, the matching point pair candidate set is used to calculate the parameters of the affine transformation (i.e., the affine matrix), and the calculated affine matrix is used to test all other points in the data set to see if they satisfy this model. The satisfied points are called "inside points", and the unsatisfied points are called "outside points" or "noise points". Repeat the above steps multiple times (usually setting a maximum number of iterations or setting a threshold according to the change in the number of inliers), and a new random sample set is used for each iteration. After each iteration, the model with the largest number of inliers is recorded as the current optimal model. Finally, the optimal model after the iteration is determined as the above first affine relationship. It should be understood that in the above-mentioned method of iteratively calculating the first affine relationship by a random consistency algorithm, abnormal points in the data can be automatically processed, which helps to improve the accuracy of the calculation of the first affine relationship. By determining the second matching point pair through a random consistency algorithm, there is no need to know or determine 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 there is only one first calibration block, no matter how the calibration blocks are placed randomly during actual calibration, the positional relationship between the positioning mark points or the topological structure formed is fixed; based on this, the prior matching point pair between the first positioning mark point data and the second positioning mark point data can be obtained by scanning in advance or by obtaining the process data when the calibration piece is made, and then the second matching point pair can be determined based on the prior matching point pair. By determining the second matching point pair based on the prior matching point pair, it is helpful to quickly obtain the matching point pair between the positioning mark points, thereby improving the calibration efficiency.
[0117] Next, the affine matrix is calculated based on the second matching point pair, and finally the first affine relationship is obtained. Through the above embodiment, different methods for calculating the second matching point pair are provided, so that the calculation process can be more suitable for different application scenarios.
[0118] In some embodiments, the calibration calculation of the scanned image based on the positioning information to generate the calibration result of the scanner may also include the following steps:
[0119] Based on the first affine relationship, a first matching point pair between the first scanned image and the second scanned image is determined, and a calibration result of the scanner is generated according to the first matching point pair.
[0120] The above-mentioned first matching point pair refers to the matching pair between each marking point in the first scanned image and each marking point in the second scanned image. After the first affine relationship is calculated through the above steps, the coordinate system of each marking point data extracted from the first scanned image can be transformed based on the first affine relationship, and the coordinates of each marking point data in the first scanned image are transformed to the coordinate system of the second scanned image to obtain the marking point data after the coordinate transformation. Next, the marking point data after the coordinate transformation is matched with the marking point data in the second scanned image to find the nearest neighbor or the matching point pair that meets a certain distance threshold, so as to obtain the above-mentioned first matching point pair.
[0121] Afterwards, all or part of the (usually high-quality and sufficient) matching point pairs are used to optimize the initial posture transformation matrix between the first camera and the second camera in the scanner, and the posture matrix (including rotation matrix and translation matrix) between the optimized cameras is calculated to generate a calibration result for the scanner.
[0122] Through the above-mentioned embodiment, the geometric transformation between images, such as rotation, scaling and translation, is considered based on the first affine relationship, thereby improving the accuracy of the matching point pairs and facilitating the generation of more accurate calibration results.
[0123] In some embodiments, the determining of the first matching point pair in the first scanned image and the second scanned image based on the first affine relationship may further include the following steps:
[0124] Based on the first affine relationship, the marker point data in the first scanned image in the first camera coordinate system is converted to the second camera coordinate system to obtain the target marker point data; the marker point distance between the target marker point data and each marker point data in the second scanned image is determined, and the first matching point pair is determined based on the comparison result between the marker point distance and the preset distance threshold.
[0125] The above-mentioned marker point data extracted from the first scanned image includes the marker point data of each marker point; at this time, the marker point data is located in the three-dimensional space coordinate system constructed with the first camera as the origin, that is, the first camera coordinate system. In order to facilitate the accurate search of matching point pairs in the two types of scanned images, in this step, the first affine relationship calculated above can be used to transform the coordinates of each marker point data in the first camera coordinate system to the three-dimensional space coordinate system constructed with the second camera as the origin, that is, the second camera coordinate system. The transformed data point set is the above-mentioned target marker point data. After the marker point data in the first scanned image is transformed by the above steps, the marker point data of the first scanned image can be unified to the coordinate system where the second scanned image is located, so as to perform point pair matching on the two types of images later.
[0126] Next, the target marker data is traversed, and the distance between the target marker data currently traversed and each marker data in the second scanned image is compared in turn, and it is determined whether the distance between each marker and each marker data in the second scanned 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 marker data of the target marker data currently traversed is close to the position distance between the markers in the second scanned image currently being compared, and the point pair currently being compared can be regarded as a matching pair. Otherwise, the distance between the marker in the target marker data and other marker data in the second scanned image is continuously compared until the marker data matching the marker data in the target marker data currently traversed is detected in the marker data of the second scanned image. For the marker data in the next traversed target marker data, the matching point search is also performed based on the above distance threshold until all target marker data are traversed, or a sufficient number of matching pairs are detected by a computer program, and finally a first matching point pair set is generated.
[0127] Through the above embodiment, the data coordinates of each marking point in the first scanned image are converted to the coordinate system of the second scanned image through the first affine relationship, so as to accurately search for matching point pairs of each marking point in the two types of images, thereby realizing the affine relationship constructed based on the positioning marking points, and accurately locating the marking points scanned by each camera in the scanner, thereby improving the accuracy of calibration.
[0128] In some embodiments, the step of generating a calibration result of the scanner according to the first matching point pair may further include the following steps:
[0129] Based on the number of the first matching point pairs, it is detected whether the first affine relationship is calculated correctly; when it is detected that the first affine relationship is calculated correctly, a calibration result is generated according to the first matching point pairs.
[0130] In this step, after determining the first matching point pairs between each marker point data in the first scanned image and each marker point data in the second scanned image by any of the above methods, the number of the determined first matching point pairs can be detected to determine whether the current scanned image is qualified. Specifically, a matching pair number threshold for comparing the number of matching point pairs in the current frame can be preset.
[0131] When it is detected that the number of first matching point pairs is greater than or equal to the preset matching pair number threshold, it means that based on the above-mentioned first affine relationship, the number of matching point pairs between the marker point data determined from the currently scanned first scanned image and the second scanned image is sufficient, and the currently corresponding calculated first affine relationship can be considered to be a correct calculation. At this time, the currently determined first matching point pairs can be used to optimize the calculation of the posture relationship of each camera in the scanner, and finally generate the calibration result of the scanner.
[0132] When it is detected that the number of the first matching point pairs is less than the preset matching pair number threshold, it can be considered that there may be errors in the calculation of the first affine relationship calculated based on the current scanned image, resulting in errors in the matching between the marker point data in the scanned image collected by each camera of the scanner at the current moment, and failure to match a sufficient number of matching point pairs. 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 this frame do not participate in the calibration calculation, but instruct each camera in the scanner to continue to perform the scanning of the next frame and the calculation of matching point pairs until the number of matching point pairs corresponding to the frame is detected to reach the above-mentioned matching point pair number threshold, and then the posture conversion relationship between each camera is optimized and calculated based on the matching point pairs, and the corresponding calibration results are generated.
[0133] Through the above-mentioned embodiment, during the calibration process of the scanner, the detection of the number of matching point pairs in the current frame is also provided to determine whether the currently calculated first affine relationship is correct, thereby avoiding the problem of calibration errors or inability to continue normal calibration due to miscalculation of the first affine relationship, thereby effectively improving the accuracy and efficiency of the calibration.
[0134] In some embodiments, the step of generating a calibration result of the scanner according to the first matching point pair may further include the following steps:
[0135] Acquire initial camera parameters of the scanner; calculate a first posture matrix between the first camera and the second camera according to the initial camera parameters and the first matching point pair, and obtain a calibration result.
[0136] The above-mentioned 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 leaves the factory. Among them, the initial camera extrinsic parameters include the initial posture transformation matrix between the first camera and the second camera in the scanner. The above-mentioned first matching point pair provides the coordinate information of the corresponding points in the field of view of the two cameras; these points can be used to estimate the relative posture 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 pair can be input based on a computer program, and then the new posture matrix between the first camera and the second camera can be optimized and calculated. Specifically, the initial posture transformation matrix can be used as the starting point, and the optimization algorithm can be started in combination with the intrinsic parameters, distortion parameters and the first matching point pair. In each iteration, the algorithm calculates the reprojection error of the matching point pair according to the current posture matrix. The gradient is calculated based on the error, and the parameters of the posture matrix (rotation and translation components) are updated to reduce the reprojection error. Repeat the above steps until the preset number of iterations, error threshold or other convergence conditions are reached. After iterative optimization, the posture matrix between the first camera and the second camera is obtained as the calibration result. The posture matrix describes the transformation relationship from the first camera coordinate system to the second camera coordinate system.
[0138] Through the above-mentioned embodiment, a method for optimizing and calibrating initial camera parameters based on matching point pairs is provided, which is helpful to improve the accuracy of calibration.
[0139] In addition, considering that the scanner may 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 the 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 may also be included:
[0140] Obtain a third scanned image of the calibration part scanned by the color camera; the third scanned image includes third positioning mark point data and third auxiliary mark point data. It should be supplemented that the third scanned image scanned by the color camera, the first scanned image scanned by the first camera of the scanner, and the second scanned image scanned by the second camera of the scanner are images scanned at the same time.
[0141] Identify the third positioning mark point data; determine the second affine relationship between the first positioning mark point data and the third positioning mark point data; the positioning information also includes the second affine relationship; based on the second affine relationship, determine the third matching point pair between the first scanned image and the third scanned image.
[0142] The second affine relationship refers to the linear transformation relationship from the two-dimensional coordinates of the first positioning mark point to the two-dimensional coordinates of the third positioning mark point. The second affine relationship is determined in a similar manner to the first affine relationship. For example, the matching point pairs between the first positioning mark point data and the third positioning mark point data can be iteratively calculated through a random consistency algorithm, and the second affine relationship can be calculated.
[0143] The third matching point pair refers to the matching pair between each marking point in the first scanned image and each marking point in the third scanned image. Similarly, the third matching point pair can also be determined based on the second affine relationship, by converting the coordinates of each marking point data extracted from the first scanned image to the coordinate system of the third scanned image to obtain the marking point data after coordinate conversion. Next, the marking point data after such coordinate conversion is matched with each marking point data in the third scanned image to find the nearest neighbor or the matching point pair that meets a certain distance threshold, so as to obtain the third matching point pair.
[0144] It should be understood that in the above-mentioned process of calibrating the scanner including the color camera, for the calculated third matching point pairs, the number of the third matching point pairs and the corresponding second affine relationship can also be detected by the above-mentioned method of detecting the number of the first matching point pairs to determine whether the first affine relationship is calculated correctly. If it is detected that both the first affine relationship and the second affine relationship are 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 calculated first posture matrix between the first camera and the second camera, a three-dimensional point set located in the first camera coordinate system is reconstructed. Specifically, in the above-mentioned process of calibrating the external parameters between the first camera and the second camera, the optimized posture matrix between the first camera and the second camera can be calculated by any of the above-mentioned embodiments, that is, the above-mentioned first posture matrix can be obtained. For example, the initial camera parameters of the first camera and the second camera can be input, combined with the first matching point pair, and the first posture matrix can be obtained by optimization calculation.
[0146] Afterwards, the three-dimensional point set in the first camera coordinate system can be reconstructed through the above-mentioned first matching point pair and the first posture 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 calculating through a stereo matching algorithm, or by using a binocular stereo vision camera composed of a first camera and a second camera; based on the depth information, each two-dimensional point is converted into a three-dimensional space point; using the first posture matrix, the coordinates of the three-dimensional points in the second camera coordinate system are unified to the first camera coordinate system, and finally the above-mentioned three-dimensional point set is obtained.
[0147] According to the third matching point pair, the correspondence between the two-dimensional points in the third scanned image and the three-dimensional points in the three-dimensional point set is determined. The third matching point pair has determined the correspondence between the two-dimensional points in the third scanned image and the two-dimensional points in the first scanned image, and the correspondence between the two-dimensional points in the scanned image of the binocular camera and the three-dimensional space points is also determined through the reconstructed three-dimensional point set. Therefore, based on the above analysis, the one-to-one correspondence between the two-dimensional points in the third scanned image and the three-dimensional space points can also be determined in this step.
[0148] Finally, based on the correspondence, the second posture matrix between the first camera and the color camera is obtained; the calibration result includes the first posture matrix and the second posture matrix. Specifically, according to the camera parameters such as the intrinsic parameters and distortion parameters of the color camera, combined with the correspondence between the above two-dimensional points and three-dimensional points, the second posture matrix from the color camera to the first camera can be calculated using the perspective-n-point (PNP) algorithm. Finally, through the above method, the external parameter calibration between each camera in the scanner is realized.
[0149] Through the above embodiment, a calibration method for a scanner including a color camera is also provided, which effectively expands the application scenarios of calibration. In addition, in the calibration process of the color camera, the corresponding relationship between the two-dimensional points and the three-dimensional points is used for calculation, which also helps to improve the accuracy of the 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 posture matrix between the first camera and the second camera, a three-dimensional point set located in the first camera coordinate system is reconstructed; the three-dimensional point position information in the three-dimensional point set is determined; when the three-dimensional point position information is within a preset scanning distance range, a calibration result is generated according to the first matching point pair.
[0152] Among them, for the above-mentioned reconstructed three-dimensional point set, its three-dimensional point position information can be determined by calculating the mean of the three-dimensional coordinates of each three-dimensional point in the set; the mean of the three-dimensional coordinates can be used to characterize the value of the Z-axis coordinate of the scanner, that is, the distance value between the scanner and the calibration part in the current frame. Therefore, the three-dimensional point position information is compared with the scanning distance range pre-set by the staff based on the actual situation. When it is detected that the three-dimensional point position information is within the scanning distance range, it means that the distance of the current scanner meets the error range of the set scanning distance threshold. At this time, when it is detected that each camera in the above-mentioned scanner can calculate the corresponding posture matrix, the rapid calibration can be ended to generate the calibration result in the current frame. Otherwise, it is necessary to continue scanning and calibrating the next frame until it is detected that the scanning position of the scanner meets the scanning distance threshold.
[0153] Through the above embodiment, the real-time scanning position of the scanner is determined by calculating the three-dimensional point position information to ensure that the scanning position of the scanner during calibration meets a certain distance range, thereby avoiding the problem that the scanner is too close or too far away from the calibration object during scanning, which affects the accuracy of the calibration result or causes calibration failure, thereby further improving the accuracy of the calibration.
[0154] The following describes it in detail with reference to specific embodiments. Figure 4 is a schematic diagram of the structure of a calibration component according to an embodiment of the present application, such as Figure 4 As shown, the calibration component includes a first calibration block with positioning marking points, and a second calibration block 41 with auxiliary marking points 42. The first calibration block is independently distributed from the other second calibration blocks 41, and each calibration block can be freely arranged and combined, and can also be folded. Among them, the size and shape of the auxiliary marking points 42 on the second calibration block 41 are the same as those of the ordinary positioning marking points in the positioning marking points. The difference between the two types of marking points mainly lies in their different deployment locations and functions. Figure 4 A calibration component including one first calibration block and eight second calibration blocks 41 is used as an example. In actual application, the user can take out these nine calibration blocks and place them on a plane, among which 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), and the other eight second calibration blocks 42 are randomly arranged around, requiring that the cameras in the subsequent scanner can easily see these small blocks.
[0155] Figure 5 is a flow chart of another calibration method according to an embodiment of the present application. Figure 5 As shown, the process includes the following steps:
[0156] Step S501, start the calibration process; the user places the above calibration blocks on a plane, and the scanner faces the placed calibration device, starts working and takes pictures. The scanner includes a first camera, a second camera and a color camera.
[0157] Step S502, obtain the first scanned image G_1 taken by the first camera, the second scanned image G_r taken by the second camera, and the color image C taken by the color camera. Perform marker point recognition on the three images to obtain two-dimensional coordinate sets uv_1, uv_r, uv_c respectively. Each two-dimensional coordinate point includes the two-dimensional coordinates of the marker point and the length of the major and minor semi-axis of the ellipse.
[0158] Step S503, a threshold value Y is set according to the length of the major and minor semi-axis of each marked point in the uv_l, uv_r, uv_c set, and the three large points in each set can be screened out according to the detection of whether the size of the major and minor semi-axis is greater than Y. In the above manner, the two-dimensional coordinate sets sp_uv_l, sp_uv_r and sp_uv_c of the three large points of the first scanned image, the second scanned image and the color image are respectively obtained. Taking the first scanned image as an example, according to the coordinates of the three large points, the average value of the coordinates of the three large points is calculated to obtain a temporary point p, and the two-dimensional coordinates of the point closest to point p in the uv_l set are searched, and the point is added to the set sp_uv_l to obtain sp_uv_l'. Among them, sp_uv_l' is the set of positioning mark points in the first calibration block. For the second scanned image and the color image, the same logical calculation can be used to obtain the corresponding sets sp_uv_r' and sp_uv_c'.
[0159] Step S504, for the posture calibration of the first camera and the second camera, first use the random consistency algorithm, traverse a certain number of times to calculate the four matching point pairs in sp_uv_l' and sp_uv_r' and calculate the affine matrix H1, transfer 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 scanned image whose distance from the points in uv_r is less than the threshold Y0, and obtain the matching point pairs of the two-dimensional points between the first scanned image and the second scanned 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 a correct calculation, and then the one-to-one matching relationship set match_lr between the two-dimensional points in uv_l and the two-dimensional points in uv_r is obtained. Input the initial internal and external parameters of the first camera and the second camera, as well as the two-dimensional point matching set match_lr, and the new posture transformation matrix RT_lr between the first camera and the second camera can be optimized and calculated.
[0160] Step S505: The three-dimensional coordinate set POINT0 in the first camera coordinate system can be reconstructed through the new RT_lr and match_lr.
[0161] Step S506, for the posture calibration of the first camera and the color camera, first use the random consistency algorithm to traverse a certain number of times to calculate the four matching point pairs in sp_uv_l' and sp_uv_c' and calculate the affine matrix H2, transfer the two-dimensional points in uv_l to the two-dimensional coordinate system of the second camera through the matrix H2, and search for the two-dimensional points in the color image whose distance from the points in uv_r is less than the threshold Y0, and obtain the matching point pairs of the two-dimensional points between the first scanned 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 a correct calculation. At this time, a one-to-one matching relationship set match_lc between 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 correspondence relationship match_lc_2 between the three-dimensional point and the two-dimensional point, the posture transformation matrix RT_lc from the color camera to the first camera can be calculated by the PNP method.
[0162] It should be noted that the steps shown in the above process or the flowchart in 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 that shown here.
[0163] This embodiment also provides a calibration device for a scanning system, the scanning system includes a scanner and a calibration part, the calibration part includes a first calibration block provided with positioning marking points and a second calibration block provided with auxiliary marking points; the first calibration block and the second calibration block are independently distributed calibration blocks; wherein the positioning marking points and the auxiliary marking points are used for the calibration of the scanner, and the positioning marking points are also used to provide the positioning of each marking point. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been explained will not be repeated. As used below, the terms "module", "unit", "subunit" and the like can implement a combination of software and / or hardware for predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0164] Figure 6 is a structural block diagram of a calibration device according to an embodiment of the present application, such as Figure 6 As shown, the device comprises:
[0165] An acquisition module 61 is used to acquire a scanned image of a calibration piece scanned by a scanner;
[0166] A positioning module 62, used to identify positioning mark point data in the scanned image and determine positioning information based on the positioning mark point data;
[0167] The generation module 63 is used to perform calibration calculation on the scanned image based on the positioning information to generate a calibration result of the scanner.
[0168] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination. For specific examples in this embodiment, reference can be made to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.
[0169] This embodiment also provides a scanning system. Figure 7 is a structural block diagram of a scanning system according to an embodiment of the present application, such as Figure 7 As shown, the system includes: a scanner 71, a calibration piece 72 and a controller 73;
[0170] The calibration member 72 includes a first calibration block provided with a positioning mark point and a second calibration block provided with an auxiliary mark point; the first calibration block and the second calibration block are independently distributed calibration blocks; wherein the positioning mark point and the auxiliary mark point are used for calibration of the scanner, and the positioning mark point is also used to provide positioning of each mark point;
[0171] The controller 73 is connected to the scanner 71 ; a computer program is stored on the controller 73 , and when the computer program is executed by the processor, the steps of the calibration method described in any of the above embodiments are implemented.
[0172] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0173] Optionally, the electronic device may further include 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 this embodiment, the processor may be configured to perform the following steps through a computer program:
[0175] S1, obtaining a scanned image of a calibration object scanned by a scanner.
[0176] S2, identifying the positioning mark point data in the scanned image, and determining the positioning information according to the positioning mark point data.
[0177] S3, based on the positioning information, perform calibration calculation on each scanned image to generate a calibration result of the scanner.
[0178] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0179] In addition, in combination with the calibration method in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the calibration methods in the above embodiment is implemented.
[0180] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0181] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A calibration method, characterized in that: Used in a scanning system, the scanning system comprises a scanner and a calibration piece, the calibration piece comprises a first calibration block provided with positioning marking points and a second calibration block provided with auxiliary marking points; The first calibration block and the second calibration block are independently distributed calibration blocks; the method comprises: Acquire a scanned image of the calibration piece scanned by the scanner; Identifying positioning mark point data in the scanned image, and determining positioning information based on the positioning mark point data; Based on the positioning information, calibration calculation is performed on each of the scanned images to generate a calibration result of the scanner.
2. The calibration method according to claim 1, characterized in that: The scanned image includes a first scanned image of the calibration object scanned by the first camera of the scanner, and a second scanned image of the calibration object scanned by the second camera of the scanner; wherein the first scanned image includes first positioning mark point data and first auxiliary mark point data, and the second scanned image includes second positioning mark point data and second auxiliary mark point data; The step of identifying the positioning mark point data in the scanned image and determining the positioning information according to the positioning mark point data includes: Identify the first positioning mark point data and the second positioning mark point data; determine a first affine relationship between the first positioning mark point data and the second positioning mark point data; and the positioning information includes the first affine relationship.
3. The calibration method according to claim 2, characterized in that: The positioning mark points include: feature positioning mark points with preset identification features.
4. The calibration method according to claim 3, characterized in that: The identifying the first positioning mark point data and the second positioning mark point data comprises: Based on the feature information of the preset identification feature, searching for first feature positioning mark point data in the first scanned image; and acquiring the first positioning mark point data according to the first feature positioning mark point data; Based on the feature information of the preset identification feature, the second feature positioning mark point data in the second scanned image is searched; and according to the second feature positioning mark point data, the second positioning mark point data is acquired.
5. The calibration method according to claim 4, characterized in that: The preset identification feature includes a size feature whose size data is greater than a preset size threshold, and the method further includes: Based on the size feature information of the size feature, search for the first feature positioning mark point data in the first scanned image whose size data is greater than the preset size threshold, and based on the size feature information, search for the first feature positioning mark point data in the second scanned image whose size data is greater than the preset size threshold.
6. The calibration method according to claim 5, characterized in that: The positioning mark point also includes: a common positioning mark point, and the common positioning mark point and the characteristic positioning mark point are arranged on the same first calibration block; the identifying of the first positioning mark point data and the second positioning mark point data includes: Searching for first feature positioning mark point data in the first scanned image, and obtaining first position information corresponding to the first feature positioning mark point data; Based on the first position information, searching the first scanned image for the mark point data that is closest to the first feature positioning mark point, and determining the mark point data as the first common positioning mark point data; Acquire the first positioning mark point data according to the first characteristic positioning mark point data and the first common positioning mark point data; Searching for second feature positioning mark point data in the second scanned image, and acquiring second position information corresponding to the second feature positioning mark point data; Based on the second position information, searching the second scanned image for the mark point data that is closest to the second characteristic positioning mark point, and determining the mark point data as the second common positioning mark point data; The second positioning mark point data is acquired according to the first characteristic positioning mark point data and the second common positioning mark point data.
7. The calibration method according to claim 2, characterized in that: The determining a first affine relationship between the first positioning mark point data and the second positioning mark point data comprises: Iteratively calculating a second matching point pair between the first positioning mark point data and the second positioning mark point data using a random consistency algorithm; or, Acquire a preset a priori matching point pair between the first positioning mark point data and the second positioning mark point data, and determine the second matching point pair based on the a priori matching point pair; Based on the second matching point pair, the first affine relationship is calculated.
8. The calibration method according to claim 2, characterized in that: The step of performing calibration calculation on the scanned image based on the positioning information to generate a calibration result of the scanner includes: Based on the first affine relationship, a first matching point pair between the first scanned image and the second scanned image is determined, and the calibration result is generated according to the first matching point pair.
9. The calibration method according to claim 8, characterized in that: The determining, based on the first affine relationship, a first pair of matching points in the first scanned image and the second scanned image comprises: Based on the first affine relationship, the marker point data in the first scanned image in the first camera coordinate system is converted to the second camera coordinate system to obtain target marker point data; Determine the target marking point data and the marking point distance between each marking point data in the second scanned image, and determine the first matching point pair according to the marking point distance and a preset distance threshold.
10. The calibration method according to claim 8, characterized in that: Generating the calibration result according to the first matching point pair includes: Based on the number of the first matching point pairs, detecting whether the first affine relationship is calculated correctly; When it is detected that the first affine relationship is calculated correctly, the calibration result is generated according to the first matching point pair.
11. The calibration method according to claim 8, characterized in that: Generating the calibration result according to the first matching point pair includes: Obtaining initial camera parameters of the scanner; A first posture matrix between the first camera and the second camera is calculated according to the initial camera parameters and the first matching point pair, and the calibration result is obtained.
12. The calibration method according to claim 8, characterized in that: The scanner also includes a color camera; and generating a calibration result of the scanner includes: Acquire a third scanned image of the calibration piece scanned by the color camera; the third scanned image includes third positioning mark point data and third auxiliary mark point data; Identify the third positioning mark point data; determine a second affine relationship between the first positioning mark point data and the third positioning mark point data; the positioning information also includes the second affine relationship; Based on the second affine relationship, determining a third matching point pair between the first scanned image and the third scanned image; Reconstructing a three-dimensional point set in a first camera coordinate system according to the first matching point pair and the calculated first posture matrix between the first camera and the second camera; Determining, according to the third matching point pair, a correspondence between the two-dimensional points in the third scanned image and the three-dimensional points in the three-dimensional point set; Based on the corresponding relationship, a second posture matrix between the first camera and the color camera is obtained; and the calibration result includes the first posture matrix and the second posture matrix.
13. The calibration method according to claim 8, characterized in that: The method further comprises: Reconstructing a three-dimensional point set in a first camera coordinate system according to the first matching point pair and the calculated first posture matrix between the first camera and the second camera; Determining three-dimensional point position information in the three-dimensional point set; When the three-dimensional point position information is within a preset scanning distance range, the calibration result is generated according to the first matching point pair.
14. A calibration device, characterized in that: Used in a scanning system, the scanning system comprises a scanner and a calibration piece, the calibration piece comprises a first calibration block provided with positioning marking points and a second calibration block provided with auxiliary marking points; The first calibration block and the second calibration block are independently distributed calibration blocks; the device comprises: An acquisition module, used for acquiring a scanned image of the calibration piece scanned by the scanner; A positioning module, used to identify positioning mark point data in the scanned image, and determine positioning information according to the positioning mark point data; A generation module is used to perform calibration calculation on the scanned image based on the positioning information to generate a calibration result of the scanner.
15. A scanning system, characterized in that: The system includes a scanner, a calibration piece and a controller; The calibration piece comprises a first calibration block provided with positioning marking points and a second calibration block provided with auxiliary marking points; the first calibration block and the second calibration block are independently distributed calibration blocks; The controller is connected to the scanner; a computer program is stored on the controller, and when the computer program is executed by the processor, the steps of the calibration method described in any one of claims 1 to 13 are implemented.
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
Calibration board feature region extraction method, calibration method and calibration board
CN114445493A
Calibration device and method of three-dimensional scanning equipment and electronic device
CN117036493A
Laser galvanometer scanning calibration method under large field of view
CN117367319A