Scanning processing method, device, scanning equipment and storage medium
By using multiple shooting devices to collect ruler images in 3D scanning technology, reconstruct the ruler length and adjust the translation vector, the problem of external parameter deviation caused by changes in ambient temperature is solved, and the accuracy of temperature compensation and the 3D scanning effect are improved.
Patent Information
- Application Number
- CN202410901843.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-07-05
AI Technical Summary
In existing three-dimensional scanning technology, extrinsic parameter deviations caused by changes in ambient temperature affect scanning quality, and existing temperature compensation methods are limited by the accuracy of ambient temperature measurement and have poor effects.
At least two shooting devices are used to collect an image sequence of a preset ruler. By reconstructing the length of the ruler, the temperature compensation coefficient is determined, and the translation vector is adjusted in real time to compensate for temperature changes and improve the accuracy of temperature compensation.
Without relying on temperature and ruler position, it effectively compensates for temperature changes, improves the accuracy and effect of three-dimensional scanning, and reduces equipment costs.
Smart Images

Figure CN118424108B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of three-dimensional scanning technology, and in particular, relates to a scanning processing method, device, scanning equipment and storage medium. Background Art
[0002] 3D scanning technology is an important research direction in the field of computer vision technology and image processing. It has broad application prospects in autonomous driving, robot autonomous navigation, cultural relics protection, architectural design, clinical medicine, etc. However, affected by the ambient temperature, the length of the beam in the 3D scanner will change, resulting in deviations between the external parameters previously calibrated and the external parameters during real-time measurement, affecting the quality of 3D scanning. Therefore, it is necessary to perform temperature compensation on the 3D scanner.
[0003] In the related art, temperature compensation is performed on the 3D scanner according to the ambient temperature to reduce the measurement error. However, the above method is limited by the accuracy of ambient temperature acquisition, and the temperature compensation effect is poor, resulting in poor 3D scanning effect. Summary of the invention
[0004] The embodiments of the present application provide a scanning processing method, an apparatus, a scanning device and a storage medium to solve the problem of poor three-dimensional scanning effect caused by poor temperature compensation effect.
[0005] In a first aspect, an embodiment of the present application provides a scanning processing method, which is applied to a scanning device, wherein the scanning device includes at least two shooting devices, and the scanning processing method includes: using the at least two shooting devices to collect an image sequence of a preset scale at a first moment to obtain multiple groups of synchronous images, wherein the ends of the preset scale include preset marker points; in each group of synchronous images, determining the image point coordinates corresponding to the preset marker points, and reconstructing the three-dimensional coordinates corresponding to the preset marker points based on preset calibration data and the image point coordinates; determining a first scale length corresponding to the preset scale at the first moment according to the three-dimensional coordinates corresponding to the multiple groups of synchronous images; determining a second scale length corresponding to the preset scale at the second moment based on the image sequence of the preset scale collected by the at least two shooting devices at the second moment; determining a second translation vector based on the first translation vector corresponding to the at least two shooting devices at the first moment, the first scale length and the second scale length, and controlling the scanning device to scan the target object according to the second translation vector.
[0006] Further, in the above-mentioned scanning processing method provided in the embodiment of the present application, the at least two shooting devices include a first shooting device and a second shooting device, and the at least two shooting devices are used to capture an image sequence of a preset scale at a first moment to obtain multiple groups of synchronous images, including: using the first shooting device to capture multiple frames of first images of the preset scale at the first moment to obtain a first image sequence, and using the second shooting device to capture multiple frames of second images of the preset scale at the first moment to obtain a second image sequence; determining the first frame information corresponding to each first image and the second frame information corresponding to each second image; selecting the first image and the second image with the same first frame information and the same second frame information to form a group of synchronous images to obtain multiple groups of synchronous images.
[0007] Furthermore, in the above-mentioned scanning processing method provided in the embodiment of the present application, the determining of the image point coordinates corresponding to the preset marker point includes: in each group of synchronized images, determining the first image point corresponding to the preset marker point in the first image, and determining the second image point corresponding to the preset marker point in the second image; determining the first image point coordinates of the first image point in the first image, and the second image point coordinates of the second image point in the second image; and using the first image point coordinates and the second image point coordinates as the image point coordinates corresponding to the preset marker point.
[0008] Furthermore, in the above-mentioned scanning processing method provided in the embodiment of the present application, the three-dimensional coordinates corresponding to the preset mark point are reconstructed based on the preset calibration data and the image point coordinates, including: determining the intrinsic parameter matrix and the extrinsic parameter matrix of the at least two shooting devices according to the preset calibration data; determining the three-dimensional coordinates corresponding to the preset mark point according to the intrinsic parameter matrix, the extrinsic parameter matrix and the image point coordinates.
[0009] Furthermore, in the above-mentioned scanning processing method provided in the embodiment of the present application, determining the first scale length corresponding to the preset scale at the first moment according to the three-dimensional coordinates corresponding to the multiple groups of synchronous images includes: in each group of synchronous images, determining the scale length corresponding to the preset scale according to the three-dimensional coordinates; determining the first scale length according to multiple scale lengths.
[0010] Furthermore, in the above-mentioned scanning processing method provided in the embodiment of the present application, the method also includes: parsing the external parameter matrix to obtain the translation vector of the at least two shooting devices as the first translation vector corresponding to the at least two shooting devices at the first moment.
[0011] Furthermore, in the above-mentioned scanning processing method provided in an embodiment of the present application, the second translation vector is determined based on the first translation vector corresponding to the at least two shooting devices at the first moment, the first scale length and the second scale length, including: determining a temperature compensation coefficient according to the first scale length and the second scale length; adjusting the first translation vector according to the temperature compensation coefficient to obtain the second translation vector.
[0012] In a second aspect, an embodiment of the present application provides a scanning processing device, which is applied to a scanning device, wherein the scanning device includes at least two shooting devices, and the scanning processing device includes: a synchronous image acquisition module, which is used to use the at least two shooting devices to acquire an image sequence of a preset scale at a first moment to obtain multiple groups of synchronous images, and the end of the preset scale includes a preset mark point; a three-dimensional coordinate reconstruction module, which is used to determine the image point coordinates corresponding to the preset mark point in each group of synchronous images, and reconstruct the three-dimensional coordinates corresponding to the preset mark point based on preset calibration data and the image point coordinates; a first length determination module, which is used to determine the first scale length corresponding to the preset scale at the first moment according to the three-dimensional coordinates corresponding to the multiple groups of synchronous images; a second length determination module, which is used to determine the second scale length corresponding to the preset scale at the second moment based on the image sequence of the preset scale acquired by the at least two shooting devices at the second moment; a second vector determination module, which is used to determine the second translation vector based on the first translation vector corresponding to the at least two shooting devices at the first moment, the first scale length and the second scale length, and control the scanning device to scan the target object according to the second translation vector.
[0013] In a third aspect, an embodiment of the present application further provides a scanning device, comprising: a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes any one of the scanning processing methods described above.
[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein a computer program is stored in the storage medium. When the computer program is executed by a processor, the scanning processing method described in any one of the above items is implemented.
[0015] The scanning processing method provided by the embodiment of the present application utilizes the at least two shooting devices to collect an image sequence of a preset scale at a first moment to obtain multiple groups of synchronous images, wherein the end of the preset scale includes a preset mark point; in each group of synchronous images, the image point coordinates corresponding to the preset mark point are determined, and based on preset calibration data and the image point coordinates, the three-dimensional coordinates corresponding to the preset mark point are reconstructed; according to the three-dimensional coordinates corresponding to the multiple groups of synchronous images, the first scale length corresponding to the preset scale at the first moment is determined; based on the image sequence of the preset scale collected by the at least two shooting devices at the second moment, the second scale length corresponding to the preset scale at the second moment is determined; based on the first translation vector corresponding to the at least two shooting devices at the first moment, the first scale length and the second scale length, the second translation vector is determined, and according to the second translation vector, the scanning device is controlled to scan the target object. The above method reconstructs the first scale length of the preset scale at the first moment and the second scale length at the second moment, and adjusts the translation vectors of at least two shooting devices in the scanning device in real time according to the first scale length and the second scale length. It can compensate for the influence of temperature changes at different moments on the translation vector without relying on temperature and scale position, and can improve the accuracy of temperature compensation, thereby improving the effect of three-dimensional scanning. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] Figure 1 It is a schematic diagram of an application scenario of the scanning processing method provided in an embodiment of the present application.
[0018] Figure 2 It is a schematic flow chart of the scanning processing method provided in an embodiment of the present application.
[0019] Figure 3 It is a flow chart of the image sequence acquisition method provided in the embodiment of the present application.
[0020] Figure 4 It is a flow chart of a method for determining image point coordinates provided in an embodiment of the present application.
[0021] Figure 5 It is a flow chart of a method for determining three-dimensional coordinates provided in an embodiment of the present application.
[0022] Figure 6 This is a flow chart of a method for determining the length of a first ruler provided in an embodiment of the present application.
[0023] Figure 7 It is a flow chart of a method for determining a second translation vector provided in an embodiment of the present application.
[0024] Figure 8 It is a schematic diagram of the structure of the scanning processing device provided in an embodiment of the present application.
[0025] Fig. 9 This is an application device diagram of the scanning processing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art in the technical field in this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, "at least one" refers to one or more. "Multiple" refers to two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations.
[0029] Some of the terms that appear in the embodiments of the present application are explained below.
[0030] External parameters, including rotation matrices and translation vectors, are used to define the transformation relationship between the camera coordinate system and the world coordinate system. The accuracy of the external parameters directly determines the mapping accuracy from image data to the actual physical world.
[0031] Intrinsic parameters are a set of parameters that describe the internal properties of the scanning device, which are crucial for accurately interpreting the scan data. Parameters usually include focal length, principal point (optical center) coordinates, and distortion coefficients.
[0032] Binocular scanner,Binocular scanner uses two cameras to capture images of objects.,The two cameras capture images of the same object from slightly different,angles. By comparing the difference between the two images (i.e.,,parallax), the depth information of the object can be calculated,,thus obtaining the three-dimensional data of the object.
[0033] Multi-camera scanners can process more complex visual scenes by synchronizing data from multiple cameras and combining advanced algorithms. It can acquire data from multiple angles at the same time, greatly improving the integrity of the scan and the richness of details.
[0034] Tracker, also known as tracking 3D scanning equipment, is a high-precision 3D data acquisition tool that uses optical tracking technology to locate the spatial position of the scanning head in real time. The tracker uses blue laser and can handle the scanning of black and shiny surface materials, and can quickly complete the scanning task without powder spraying.
[0035] The ruler is used to calibrate and verify the measurement accuracy of the scanner. By using the ruler, the positioning and orientation of the scanner in space can be accurately determined, thereby ensuring the accuracy and reliability of its measurement results.
[0036] Scanning technology is an important research direction in the field of computer vision technology and graphics and image processing. It has broad application prospects in autonomous driving, robot autonomous navigation, cultural relics protection, architectural design, clinical medicine, etc. In scanning equipment, the beam is a key component of the scanning equipment, which is used to support and fix the camera device and other important components. However, affected by the ambient temperature, the length of the beam in the scanning equipment will change, and the external parameters of the camera device will also change accordingly, resulting in the previously calibrated external parameters not being applicable to the current camera device, which reduces the scanning accuracy of the scanning equipment. Therefore, it is necessary to perform real-time temperature compensation on the external parameters of the scanning equipment when the temperature changes, so as to reduce the impact of temperature changes on scanning accuracy.
[0037] In the related art, temperature compensation is performed on the scanning device according to the ambient temperature to reduce the measurement error. For example, a preset ruler is placed in the field of view of the scanning device, and the preset ruler is used to calibrate the external parameters of the shooting device in the scanning device. The external parameter compensation amount of the shooting device in the scanning device is obtained by comparing the ruler length reconstructed in real time by the scanning device with the reference length of the ruler, and the external parameter of the shooting device is compensated according to the external parameter compensation amount.
[0038] However, in the above compensation method, it is necessary to measure the ambient temperature, and then calculate the reference length of the preset ruler at the current temperature based on the thermal expansion coefficient of the ruler material, while the ambient temperature is not consistent with the internal temperature change of the scanning device; and the temperature distribution in the environment is not necessarily uniform, and the ambient temperature change at the location of the scanning device is not consistent with the ambient temperature change at the location of the preset ruler. Therefore, the above method is limited by the accuracy of ambient temperature acquisition, and the temperature compensation effect is poor. In addition, due to the distortion of the lens of the camera device, if the preset ruler is placed at different positions in the field of view of the scanning device, the length of the ruler reconstructed by the scanning device may be different. Therefore, when comparing the length of the ruler reconstructed by the scanning device with the reference length of the ruler, the external parameter compensation amount will differ with the placement position of the preset ruler. In summary, when the relevant technology performs temperature compensation on the scanning device, it is limited by the ambient temperature measurement and the placement position of the ruler, and the temperature compensation effect is poor, resulting in poor three-dimensional scanning effect.
[0039] In view of the above problems, it is necessary to provide a scanning processing method that can compensate for the impact of temperature changes at different times on the scanning device without relying on temperature and scale position, and can improve the accuracy of temperature compensation, thereby improving the effect of three-dimensional scanning.
[0040] Figure 1 Schematic diagram of the application scenario of the scanning processing method provided in the embodiment of the present application. Figure 1 As shown, the application scenario of the scanning processing method includes a preset ruler 10 and a scanning device 20. The preset ruler 10 is made of a material with a small thermal expansion coefficient. For example, the preset ruler 10 can be a carbon fiber ruler, which is not limited here. The scanning device 20 can refer to any photogrammetric device with image processing and computing capabilities. For example, the scanning device 20 can be a binocular scanner, a multi-eye scanner, and a tracker, etc., which is not limited here. This application takes the scanning device 20 as a binocular scanner as an example for explanation. The binocular scanner includes two camera devices, which are used to capture images. The positional relationship between the two camera devices can be set according to actual needs, which is not limited here.
[0041] In some embodiments, in the application scenario of the scanning processing method, the preset ruler 10 is placed in the field of view of the scanning device 20, so that each camera device in the scanning device 20 can capture a complete ruler image. The scanning device 20 captures multiple sets of synchronous images of the preset ruler 10 at different times, and reconstructs the ruler length of the preset ruler 10 at different times based on the multiple sets of synchronous images; then, according to the change of the ruler length reconstructed by the preset ruler 10 at different times, the temperature compensation coefficient is obtained, and the scanning device 20 is temperature compensated according to the temperature compensation coefficient.
[0042] In the above application scenario, temperature compensation of the scanning device is completed by using two devices, the scanning device and the preset scale, avoiding the introduction of other measuring elements (for example, temperature sensors), which can reduce the cost of the equipment.
[0043] The present application will describe the technical solution of the present application in detail through specific embodiments below. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0044] In at least one embodiment of the present application, the external parameters of the scanning device include a rotation matrix and a translation vector, wherein the rotation matrix is used to identify the angular relationship between the cameras in the scanning device, and the translation vector is used to identify the linear displacement between the cameras. The impact of ambient temperature changes on the scanning device is mainly reflected in the impact on the translation vector between the cameras, and has less impact on the angular relationship between the cameras and the intrinsic parameters of the cameras. Therefore, the present application adjusts the translation vector between the cameras in real time, which can compensate for the impact of ambient temperature on the scanning device and improve the effect of scanning processing. Figure 2 is a schematic flow chart of the scanning processing method provided in the embodiment of the present application. Figure 2 As shown, the scanning processing method is applied to a scanning device and includes the following steps:
[0045] S11, using the at least two shooting devices to capture an image sequence of a preset scale at a first moment to obtain a plurality of groups of synchronous images, wherein the ends of the preset scale include preset marking points.
[0046] In at least one embodiment of the present application, the number of the photographing devices in the scanning device may be two or more than two. The embodiment of the present application takes the number of the photographing devices as two as an example, for example, the scanning device includes a first photographing device and a second photographing device. The preset ruler is placed in the field of view of at least two photographing devices, so that any one of the photographing devices can capture a complete image of the preset ruler. In some embodiments, the at least two photographing devices are used to synchronously capture multiple frames of complete images of the preset ruler at a first moment to obtain an image sequence. Following the above embodiment, the first photographing device and the second photographing device are used to synchronously capture multiple frames of complete images of the preset ruler at a first moment to obtain an image sequence. Among them, the number of frames collected can be determined according to the frame rate of the photographing device, for example, the number of frames can be 50 frames, 60 frames, 70 frames, etc. In some embodiments, the same frame of complete images captured by the first photographing device and the second photographing device is taken as a group of synchronous images, so that multiple groups of synchronous images can be obtained. In some embodiments, at least two shooting devices of the scanning device can synchronously shoot a preset scale in real time to obtain multiple sets of synchronous images, or can synchronously shoot a preset scale at a preset time interval to obtain multiple sets of synchronous images, wherein the preset time interval can be set according to actual needs, for example, the preset time interval can be 2 seconds, 5 seconds, etc.
[0047] In at least one embodiment of the present application, a preset mark point is provided on the end of the preset ruler, and the mark point may refer to a graphic with a marking function made by active light emission or back-light reflecting material (for example, the mark point may be a dot of a specific size, but is not limited to a dot). Different mark points may have different characteristics, such as diameter, color, etc., but are not limited to diameter and color. In some embodiments, the preset ruler includes two ends, namely a first end and a second end, wherein a preset mark point is provided on the first end, recorded as the first mark point, and a preset mark point is provided on the second end, recorded as the second mark point. The number of preset mark points at each end may be one or more, and is not limited here.
[0048] S12, in each group of synchronous images, determining the image point coordinates corresponding to the preset marker point, and reconstructing the three-dimensional coordinates corresponding to the preset marker point based on preset calibration data and the image point coordinates.
[0049] In at least one embodiment of the present application, in each group of synchronous images, each preset marker point appears in both the image captured by the first camera (referred to as the "first image" in the embodiment of the present application) and the image captured by the second camera (referred to as the "second image" in the embodiment of the present application). The point where the preset marker point is projected in the first image is referred to as the first image point, and the point where the preset marker point is projected in the second image is referred to as the second image point. The image point coordinates of the first image point and the second image point are respectively determined as the image point coordinates corresponding to the preset marker point.
[0050] In at least one embodiment of the present application, the preset calibration data may be data obtained by calibrating the internal and external parameters of at least two shooting devices in the scanning device using a preset scale. The preset calibration data may include the internal parameters of each shooting device and the external parameters between the shooting devices, wherein the internal parameters may include the focal length, the optical center coordinates, and the distortion coefficient, and the external parameters may include the rotation matrix and the translation vector. In some embodiments, based on the preset calibration data and the image point coordinates, the three-dimensional coordinates of the marker point corresponding to the image point coordinates can be reconstructed using the epipolar matching method. In some embodiments, the three-dimensional coordinates may refer to the coordinates of the marker point in the world coordinate system, wherein the world coordinate system may be understood as a coordinate system established in the three-dimensional space in order to describe the positional relationship between the shooting device and the target object in the three-dimensional space, and the coordinate system can be expressed in terms of the coordinate system. w X w Y w Z w To mark, O w is the origin of the coordinate system, X w is the x-axis component of the coordinate system, Y w is the y-axis component of the coordinate system, Z w is the z-axis component of the coordinate system. The origin of the world coordinate system can be set according to actual needs. w , Y w , Z w ) to mark the coordinates of the landmark points in the three-dimensional space (referred to as “three-dimensional coordinates” in this embodiment of the application).
[0051] S13, determining a first scale length corresponding to the preset scale at the first moment according to the three-dimensional coordinates corresponding to the multiple groups of synchronous images.
[0052] In at least one embodiment of the present application, the first scale length refers to the length reconstructed by the preset scale at the first moment, and the first scale length can be obtained according to the three-dimensional coordinates reconstructed corresponding to the marker points at the two ends of the preset scale. Continuing from the above embodiment, the preset scale includes two ends, namely a first end and a second end, wherein a first marker point is provided on the first end, and a second marker point is provided on the second end. In each group of synchronized images, the first three-dimensional coordinates corresponding to the first marker point and the second three-dimensional coordinates corresponding to the second marker point are determined; the scale length is reconstructed according to the first three-dimensional coordinates and the second three-dimensional coordinates; and then the scale lengths corresponding to the multiple groups of synchronized images are correlated to obtain the first scale length.
[0053] S14: Determine a second scale length corresponding to the preset scale at the second moment based on a sequence of images of the preset scale captured by the at least two photographing devices at the second moment.
[0054] In at least one embodiment of the present application, the second moment may be the moment when the scanning device scans the i-th frame image of the target object, where i is a natural number greater than 1. Following the above embodiment, at least two shooting devices of the scanning device can synchronously shoot the preset ruler in real time to obtain multiple sets of synchronous images, or can synchronously shoot the preset ruler at preset time intervals to obtain multiple sets of synchronous images. In this way, the multiple sets of synchronous images of the present application are continuously generated, and the multiple sets of synchronous images all have corresponding timestamps, which are used to indicate the image acquisition moment. In some embodiments, the synchronous image closest to the second moment is selected from the timestamps of the multiple sets of synchronous images (referred to as the "changed synchronous image" in this application), and then based on the multiple sets of changed synchronous images and the preset calibration data, the second ruler length corresponding to the preset ruler at the second moment is obtained using the contents described in the above steps S11-S13.
[0055] S15, determining a second translation vector based on the first translation vectors corresponding to the at least two shooting devices at the first moment, the first scale length, and the second scale length, and controlling the scanning device to scan the target object according to the second translation vector.
[0056] In at least one embodiment of the present application, the first translation vector refers to the linear displacement of the first camera device and the second camera device at the first moment. The first moment may refer to the moment when the scanning device starts to scan the target object, and the target object may be a car, a mechanical part, etc. Since the thermal expansion coefficient of the preset ruler is small, the length of the preset ruler is less affected by the ambient temperature and can be ignored. The ambient temperature will affect the translation vector between at least two camera devices in the scanning device. In this way, at least two camera devices are used to collect multiple sets of synchronous images of the preset ruler at different moments, and the ruler length of the preset ruler at different moments is reconstructed based on the multiple sets of synchronous images. For example, the ruler length of the preset ruler reconstructed at the first moment is the first ruler length, and the ruler length of the preset ruler reconstructed at the second moment is the second ruler length. According to the first ruler length and the second ruler length, the length change information of the reconstructed preset ruler at different moments can be determined, thereby obtaining the information on the influence of the ambient temperature on the translation vector between at least two camera devices. Considering that the length of the preset scale is proportional to the translation vector of the scanning device, the temperature compensation coefficient is determined according to the first scale length and the second scale length, and then the first translation vector of the scanning device is temperature compensated according to the temperature compensation coefficient to obtain the second translation vector corresponding to the scanning device at the second moment.
[0057] The above-mentioned scanning processing method provided in the embodiment of the present application adjusts the translation vector of at least two shooting devices in the scanning equipment in real time according to the first scale length and the second scale length of the preset scale, and can compensate for the influence of temperature changes at different times on the translation vector without relying on temperature and scale position, and can improve the accuracy of temperature compensation, thereby improving the effect of three-dimensional scanning.
[0058] In at least one embodiment of the present application, a preset ruler is placed in the field of view of at least two shooting devices so that any one of the shooting devices can capture a complete image of the preset ruler, and then at least two shooting devices are used to synchronously capture multiple frames of images of the preset ruler at the same time to obtain an image sequence. Figure 3 is a flow chart of an image sequence acquisition method provided in an embodiment of the present application, and the image sequence acquisition method is applied to a scanning device. Figure 3 As shown, the following steps are included:
[0059] S21, using the first shooting device to capture multiple frames of first images of the preset scale at the first moment to obtain a first image sequence, and using the second shooting device to capture multiple frames of second images of the preset scale at the first moment to obtain a second image sequence.
[0060] In at least one embodiment of the present application, the first camera and the second camera collect multiple frames of images of a preset scale at the same time under the same trigger signal, and the multiple frames of first images collected by the first camera form a first image sequence, and the multiple frames of second images collected by the second camera form a second image sequence. The number of collected frames can be determined according to the frame rate of the camera, for example, the number of frames can be 50 frames, 60 frames, 70 frames, etc.
[0061] S22, determining first frame information corresponding to each first image and second frame information corresponding to each second image.
[0062] In at least one embodiment of the present application, each first image in the first image sequence has corresponding first frame information, and the first frame information indicates the frame number corresponding to when the first image is captured. For example, when the first frame information is 1 frame, it indicates that the first image is captured in the 1st frame; when the first frame information is 2 frames, it indicates that the first image is captured in the 2nd frame. Each second image in the second image sequence has corresponding second frame information, and the second frame information indicates the frame number corresponding to when the second image is captured. For example, when the second frame information is 3 frames, it indicates that the second image is captured in the 3rd frame; when the second frame information is 10 frames, it indicates that the second image is captured in the 10th frame.
[0063] S23, selecting a first image and a second image having the same first frame information and second frame information to form a group of synchronous images, thereby obtaining a plurality of groups of synchronous images.
[0064] In at least one embodiment of the present application, a first image and a second image having the same first frame information and second frame information are selected to form a group of synchronous images, thereby obtaining multiple groups of synchronous images. For example, taking the number of frames as 50, a first image having 1 frame of first frame information and a second image having 1 frame of second frame information are selected as the first group of synchronous images; a first image having 2 frames of first frame information and a second image having 2 frames of second frame information are selected as the second group of synchronous images; ... until a first image having 50 frames of first frame information and a second image having 50 frames of second frame information are selected as the 50th group of synchronous images, thus obtaining 50 groups of synchronous images.
[0065] In the above method provided in the embodiment of the present application, the first shooting device is used to capture multiple frames of first images of the preset ruler at a first moment to obtain a first image sequence, and the second shooting device is used to capture multiple frames of second images of the preset ruler at a first moment to obtain a second image sequence, and the end images of the same frame information in the first image sequence and the second image sequence are used as synchronization images to facilitate the subsequent determination of the scale length of the preset ruler at the first moment based on multiple groups of synchronization images.
[0066] In at least one embodiment of the present application, in each set of synchronous images, each preset marker point has a corresponding image point in the image captured by the first camera (referred to as the "first image" in the present embodiment) and the image captured by the second camera (referred to as the "second image" in the present embodiment). By extracting valuable information from the image points, three-dimensional reconstruction of the marker point is achieved. Figure 4 is a flow chart of a method for determining image point coordinates provided in an embodiment of the present application, and the method for determining image point coordinates is applied to a scanning device. Figure 4 As shown, the following steps are included:
[0067] S31, in each group of synchronous images, determining a first image point corresponding to the preset mark point in the first image, and determining a second image point corresponding to the preset mark point in the second image.
[0068] In at least one embodiment of the present application, following the above embodiment, the preset scale includes a first end and a second end, the first end is provided with a first marking point, and the second end is provided with a second marking point. Taking the first marking point as an example, the point projected by the first marking point in the first image is called the first image point, and the point projected by the first marking point in the second image is called the second image point.
[0069] S32: Determine first image point coordinates of the first image point in the first image and second image point coordinates of the second image point in the second image.
[0070] In at least one embodiment of the present application, the first image point coordinates and the second image point coordinates may be determined by image processing algorithms such as centroid positioning, edge fitting, or key point detection. Taking the use of the centroid positioning algorithm to determine the first image point coordinates as an example, the centroid position of the first image point may be obtained by calculating the weighted average of the coordinates of all pixels in the region where the first image point is located, and the centroid position is used as the first image point coordinate of the first image point in the first image.
[0071] S33: Use the first image point coordinates and the second image point coordinates as the image point coordinates corresponding to the preset marker point.
[0072] In the above method provided in an embodiment of the present application, the first image point of the preset marker point in the first image and the second image point in the second image are determined, and then the first image point coordinates of the first image point and the second image point coordinates of the second image point are determined. By extracting valuable information from the image points, three-dimensional reconstruction of the subsequent marker points can be achieved.
[0073] Figure 5 is a flow chart of a method for determining three-dimensional coordinates provided in an embodiment of the present application, and the method for determining three-dimensional coordinates is applied to a scanning device. Figure 5 As shown, the following steps are included:
[0074] S41, determining an intrinsic parameter matrix and an extrinsic parameter matrix of the at least two shooting devices according to the preset calibration data.
[0075] In at least one embodiment of the present application, taking at least two shooting devices including a first shooting device and a second shooting device as an example, the intrinsic parameter matrices of the first shooting device and the second shooting device may be the same or different. The embodiment of the present application takes the same intrinsic parameter matrices of the first shooting device and the second shooting device as an example. The first shooting device corresponds to the first extrinsic parameter matrix, and the second shooting device corresponds to the second extrinsic parameter matrix. The method of constructing the intrinsic parameter matrix and the extrinsic parameter matrix according to the calibration data is a prior art and will not be described in detail here.
[0076] S42, determining the three-dimensional coordinates corresponding to the preset marker point according to the intrinsic parameter matrix, the extrinsic parameter matrix and the image point coordinates.
[0077] In at least one embodiment of the present application, following the above embodiment, the image point coordinates include first image point coordinates corresponding to the first image point of the preset marker point projected in the first image and second image point coordinates corresponding to the second image point of the preset marker point projected in the second image. In some embodiments, the first image point coordinates are normalized according to the intrinsic parameter matrix to obtain the first normalized coordinates, and the second image point coordinates are normalized according to the intrinsic parameter matrix to obtain the second normalized coordinates. Afterwards, based on the principle of triangulation, the three-dimensional coordinates corresponding to the preset marker point can be obtained according to the first external parameter matrix and the first normalized coordinates and the second external parameter matrix and the second normalized coordinates.
[0078] In the above method provided in the embodiment of the present application, the three-dimensional coordinates of the marker point are determined according to the preset calibration data and the image point coordinates. Without the need for complicated equipment and calculation process, the three-dimensional coordinates can be determined quickly and accurately, thereby improving the accuracy and rate of temperature compensation.
[0079] Figure 6 is a flow chart of a method for determining the length of a first scale provided in an embodiment of the present application, and the method for determining the length of a first scale is applied to a scanning device. Figure 6 As shown, the following steps are included:
[0080] S51, in each group of synchronous images, determining a scale length corresponding to the preset scale according to the three-dimensional coordinates.
[0081] In at least one embodiment of the present application, the preset scale includes two ends, namely a first end and a second end, wherein one or more first marking points are provided on the first end, and one or more second marking points are provided on the second end. Taking the number of the first marking point as one and the number of the second marking point as one as an example, in each group of synchronous images, the first three-dimensional coordinate corresponding to the first marking point and the second three-dimensional coordinate corresponding to the second marking point are determined; the scale length is reconstructed according to the first three-dimensional coordinate and the second three-dimensional coordinate. Taking the number of the first marking point as multiple and the number of the second marking point as multiple as an example, in each group of synchronous images, the first three-dimensional coordinate corresponding to each first marking point is determined to obtain multiple first three-dimensional coordinates, and the multiple first three-dimensional coordinates are correlated to obtain the processed first three-dimensional coordinates; the second three-dimensional coordinate corresponding to each second marking point is determined to obtain multiple second three-dimensional coordinates, and the multiple second three-dimensional coordinates are correlated to obtain the processed second three-dimensional coordinates; the scale length is reconstructed according to the processed first three-dimensional coordinates and the processed second three-dimensional coordinates. Among them, the correlation processing of the multiple first three-dimensional coordinates may include taking the average value. The above method can improve the accuracy of determining the length of the ruler by setting multiple marking points on the end of the preset ruler.
[0082] S52: Determine the first scale length according to a plurality of scale lengths.
[0083] In at least one embodiment of the present application, each group of synchronized images has a corresponding scale length, and multiple scale lengths are correlated to obtain a first scale length. For example, multiple scale lengths are averaged, and the average value is used as the first scale length; for another example, multiple scale lengths are medianed, and the selected median is used as the first scale length; for another example, the maximum value is selected from multiple scale lengths, and the maximum value is used as the first scale length.
[0084] In the above method provided in the embodiment of the present application, by determining the first scale length of the preset scale at the first moment, and then adjusting the translation vector of at least two shooting devices in the scanning device in combination with the first scale length, it is possible to compensate for the influence of temperature changes at different moments on the translation vector without relying on temperature and scale position, thereby improving the accuracy of temperature compensation and thus improving the effect of three-dimensional scanning.
[0085] In at least one embodiment of the present application, in a three-dimensional space, when at least two shooting devices shoot the same object, the relative position and posture between them can be described by a rotation matrix and a translation vector. Wherein, the translation vector refers to the linear displacement between the two shooting devices. In some embodiments, the preset calibration data contains internal and external parameters of at least two shooting devices, and the external parameters include a rotation matrix and a translation vector. In this way, the method also includes: determining the external parameter matrix of at least two shooting devices according to the preset calibration data; parsing the external parameter matrix to obtain the translation vector of the at least two shooting devices as the first translation vector corresponding to the at least two shooting devices at the first moment. Wherein, the external parameter matrix may include a rotation matrix and a translation vector, and the translation vector can be obtained by parsing the external parameter matrix. By parsing the preset calibration data, the embodiment of the present application can accurately obtain the first translation vector corresponding to the at least two shooting devices at the first moment, improve the effect of temperature compensation, and thus improve the effect of three-dimensional scanning.
[0086] Figure 7 is a flow chart of a method for determining a second translation vector provided in an embodiment of the present application, and the method for determining a second translation vector is applied to a scanning device. Figure 7 As shown, the following steps are included:
[0087] S71, determining a temperature compensation coefficient according to the first scale length and the second scale length.
[0088] In at least one embodiment of the present application, the ratio of the first scale length to the second scale length is calculated, and the ratio is used as the temperature compensation coefficient. In other embodiments, other mathematical processing can be performed on the first scale length and the second scale length to obtain a processed value, and the processed value is used as the temperature compensation coefficient.
[0089] S72: Adjust the first translation vector according to the temperature compensation coefficient to obtain the second translation vector.
[0090] In at least one embodiment of the present application, the temperature compensation coefficient is multiplied by the first translation vector, and the result of the multiplication is used as the second translation vector.
[0091] The above-mentioned scanning processing method provided in the embodiment of the present application adjusts the translation vector of at least two shooting devices in the scanning equipment in real time according to the first scale length and the second scale length of the preset scale, and can compensate for the influence of temperature changes at different times on the translation vector without relying on temperature and scale position, and can improve the accuracy of temperature compensation, thereby improving the effect of three-dimensional scanning.
[0092] Figure 8 Schematic diagram of the structure of the scanning processing device provided in the embodiment of the present application. Figure 8As shown, the scanning processing device 100 may include multiple functional modules composed of computer program segments. The computer programs of each program segment in the scanning processing device 100 may be stored in the memory 21 of the scanning device 20 and executed by the processor 22 to perform the three-dimensional scanning function.
[0093] In some embodiments, the scanning processing device 100 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a synchronous image acquisition module 101, a three-dimensional coordinate reconstruction module 102, a first length determination module 103, a second length determination module 104 and a second vector determination module 105.
[0094] The module referred to in this application refers to a series of computer program segments that can be executed by the processor 22 and can complete fixed functions, which are stored in the memory 21. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0095] The synchronous image acquisition module 101 can be used to use the at least two shooting devices to acquire an image sequence of a preset scale at a first moment to obtain multiple groups of synchronous images, and the end of the preset scale includes a preset marking point.
[0096] The three-dimensional coordinate reconstruction module 102 can be used to determine the image point coordinates corresponding to the preset marker points in each set of synchronized images, and reconstruct the three-dimensional coordinates corresponding to the preset marker points based on preset calibration data and the image point coordinates.
[0097] The first length determination module 103 may be configured to determine a first scale length corresponding to the preset scale at the first moment according to the three-dimensional coordinates corresponding to the multiple groups of synchronous images.
[0098] The second length determination module 104 may be configured to determine a second scale length corresponding to the preset scale at the second moment based on a sequence of images of the preset scale captured by the at least two photographing devices at the second moment.
[0099] The second vector determination module 105 can be used to determine a second translation vector based on the first translation vector corresponding to the at least two shooting devices at the first moment, the first scale length and the second scale length, and control the scanning device to scan the target object according to the second translation vector.
[0100] It can be understood that the scanning processing device 100 and the scanning processing method of the above embodiment belong to the same inventive concept, and the specific implementation method of each module of the scanning processing device 100 corresponds to each step of the scanning processing method in the above embodiment, which will not be repeated in this application.
[0101] The module division described above is a logical function division, and there may be other division methods in actual implementation. In addition, the functional modules in each embodiment of the present application may be integrated in the same processing unit, or each module may exist physically separately, or two or more modules may be integrated in the same unit. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0102] Fig. 9 1 is an application diagram of the scanning processing method provided in the embodiment of the present application. Fig. 9 As shown, the scanning device 20 includes a memory 21, at least one processor 22 and at least one communication bus 23. The processor 22 is used to implement a scanning processing method when executing a computer program stored in the memory 21. The at least one communication bus 23 is configured to implement connection and communication between the memory 21 and the processor 22.
[0103] Fig. 9 The structure of the scanning device shown does not constitute a limitation on the embodiments of the present application. The scanning device 20 may also include more or less other hardware or software than shown in the figure, or a different arrangement of components.
[0104] In some embodiments of the present application, the scanning device 20 can also be connected to a client device, which includes but is not limited to any electronic product that can interact with a user through a keyboard, mouse, remote control, touchpad or voice control device, such as a personal computer, a tablet computer, a smart phone, a digital camera, etc.
[0105] It should be noted that the scanning device 20 is only an example, and other existing or future electronic products that are suitable for the present application should also be included in the protection scope of the present application and included here by reference.
[0106] In some embodiments, the scanning device 20 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0107] In some embodiments, a computer program is stored in the memory 21, and when the computer program is executed by the processor 22, all or part of the steps in the scanning processing method are implemented. The memory 21 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0108] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the scanning device 20, etc.
[0109] In some embodiments, at least one processor 22 is the control core (Control Unit) of the scanning device 20, and uses various interfaces and lines to connect various components of the entire scanning device 20, and executes various functions of the scanning device 20 and processes data by running or executing programs or modules stored in the memory 21, and calling data stored in the memory 21. For example, when at least one processor 22 executes the computer program stored in the memory, it implements all or part of the steps of the scanning processing method in the embodiment of the present application; or implements all or part of the functions of the three-dimensional scanning device. At least one processor 22 can be composed of an integrated circuit, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits with the same function or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips.
[0110] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling an electronic device (which can be a personal computer, an electronic device, or a network device, etc.) or a processor to execute parts of the methods of various embodiments of the present application.
[0111] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation.
[0112] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0113] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0114] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or, and the singular does not exclude the plural. Multiple units or devices stated in the specification can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A scanning processing method, applied to a scanning device, characterized in that: The scanning device includes at least two shooting devices, and the scanning processing method includes: Using the at least two photographing devices to capture an image sequence of a preset scale at a first moment to obtain a plurality of groups of synchronous images, wherein the end of the preset scale includes a preset marking point; In each group of synchronized images, the image point coordinates corresponding to the preset marker point are determined, and based on the preset calibration data and the image point coordinates, the three-dimensional coordinates corresponding to the preset marker point are reconstructed; Determining a first scale length corresponding to the preset scale at the first moment according to the three-dimensional coordinates corresponding to the multiple groups of synchronous images; Determining a second scale length corresponding to the preset scale at the second moment based on a sequence of images of the preset scale captured by the at least two photographing devices at the second moment; Determining a second translation vector based on the first translation vectors, the first scale length, and the second scale length corresponding to the at least two photographing devices at the first moment includes: determining a temperature compensation coefficient according to the first scale length and the second scale length; adjusting the first translation vector according to the temperature compensation coefficient to obtain the second translation vector; The scanning device is controlled to scan the target object according to the second translation vector.
2. The scanning processing method according to claim 1, characterized in that: The at least two shooting devices include a first shooting device and a second shooting device, and using the at least two shooting devices to collect an image sequence of a preset scale at a first moment to obtain a plurality of sets of synchronous images includes: Using the first shooting device to capture multiple frames of first images of the preset scale at the first moment to obtain a first image sequence, and using the second shooting device to capture multiple frames of second images of the preset scale at the first moment to obtain a second image sequence; Determine first frame information corresponding to each first image and second frame information corresponding to each second image; A first image and a second image having the same first frame information and second frame information are selected to form a group of synchronous images, thereby obtaining multiple groups of synchronous images.
3. The scanning processing method according to claim 2, characterized in that: The determining the image point coordinates corresponding to the preset marker point includes: In each group of synchronous images, determining a first image point corresponding to the preset marker point in the first image, and determining a second image point corresponding to the preset marker point in the second image; Determining first image point coordinates of the first image point in the first image and second image point coordinates of the second image point in the second image; The first image point coordinates and the second image point coordinates are used as the image point coordinates corresponding to the preset marker point.
4. The scanning processing method according to claim 3, characterized in that: The reconstructing the three-dimensional coordinates corresponding to the preset marker points based on the preset calibration data and the image point coordinates includes: Determine the intrinsic parameter matrix and the extrinsic parameter matrix of the at least two shooting devices according to the preset calibration data; The three-dimensional coordinates corresponding to the preset marker points are determined according to the intrinsic parameter matrix, the extrinsic parameter matrix and the image point coordinates.
5. The scanning processing method according to claim 1, characterized in that: The determining, according to the three-dimensional coordinates corresponding to the multiple groups of synchronous images, a first scale length corresponding to the preset scale at the first moment, comprises: In each group of synchronized images, determining a scale length corresponding to the preset scale according to the three-dimensional coordinates; The first scale length is determined according to a plurality of scale lengths.
6. The scanning processing method according to claim 4, characterized in that: The method further comprises: The extrinsic parameter matrix is parsed to obtain translation vectors of the at least two shooting devices as the first translation vectors corresponding to the at least two shooting devices at the first moment.
7. A scanning processing device, applied to a scanning device, characterized in that: The scanning device includes at least two shooting devices, and the scanning processing device includes: A synchronous image acquisition module, used to acquire an image sequence of a preset scale at a first moment using the at least two shooting devices to obtain a plurality of sets of synchronous images, wherein the end of the preset scale includes a preset marking point; A three-dimensional coordinate reconstruction module, used to determine the image point coordinates corresponding to the preset marker point in each group of synchronous images, and reconstruct the three-dimensional coordinates corresponding to the preset marker point based on preset calibration data and the image point coordinates; A first length determination module, configured to determine a first scale length corresponding to the preset scale at the first moment according to the three-dimensional coordinates corresponding to the multiple sets of synchronous images; A second length determination module, configured to determine a second scale length corresponding to the preset scale at the second moment based on a sequence of images of the preset scale acquired by the at least two photographing devices at the second moment; A second vector determination module is configured to determine a second translation vector based on the first translation vectors corresponding to the at least two photographing devices at the first moment, the first scale length, and the second scale length, including: determining a temperature compensation coefficient according to the first scale length and the second scale length; and adjusting the first translation vector according to the temperature compensation coefficient to obtain the second translation vector; The second vector determination module is further used to control the scanning device to scan the target object according to the second translation vector.
8. A scanning device, characterized in that: include: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the scanning processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the scanning processing method according to any one of claims 1 to 6 is implemented.
