Three-dimensional reconstruction method, apparatus, and system
The use of line segment fringes in three-dimensional reconstruction methods addresses the issue of low accuracy in code element matching, enhancing data capacity and scanning efficiency for precise three-dimensional data acquisition.
Patent Information
- Application Number
- JP2025507689
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-08-10
- Filing Date
- 2023-08-09
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-08-09
AI Technical Summary
Existing three-dimensional reconstruction methods using structural optical techniques suffer from low accuracy in matching code elements due to image blurriness, particularly in methods employing circular code elements and image blocks, leading to sparse data and low scanning efficiency.
A method involving the use of line segment fringes as target code elements, where first and second images are acquired by different devices, and matching pixel points are determined based on pixel coordinates and grayscale values to enhance accuracy, utilizing correlation coefficients and epipolar constraints for precise three-dimensional reconstruction.
Improves the accuracy of code element matching and enhances scanning efficiency by increasing data capacity in a single frame, allowing for high-speed and accurate reconstruction of three-dimensional data.
Smart Images

Figure 0007954800000004 
Figure 0007954800000005 
Figure 0007954800000006
Abstract
Description
[Technical Field]
[0001] <Cross-reference of related applications> This application claims priority to a Chinese patent application filed with the China National Intellectual Property Office on August 10, 2022, with application number 202210956350.X and application title "Three-Dimensional Reconstruction Method, Apparatus, and System," the entire contents of which are incorporated herein by reference.
[0002] This application relates to the field of three-dimensional reconstruction, and more specifically, to three-dimensional reconstruction methods, apparatus, and systems. [Background technology]
[0003] Structural optical 3D reconstruction is a 3D reconstruction technique that projects an optically encoded pattern onto the surface of an object under test and reconstructs the 3D data of the object's surface from the collected deformation patterns. It possesses characteristics such as high efficiency and interference resistance, and is widely applied to various 3D reconstruction scenes. The core problem in structural optical 3D reconstruction is the matching of corresponding pixel points. Different matching policies depend on different encoding methods. Depending on the encoding method of the projected pattern, structural optical techniques are divided into temporal encoding and spatial encoding. Temporal encoding requires projecting multiple frames of patterns onto the measurement scene in a time series, and usually requires the object under test and the projector to be relatively stationary. Therefore, it is not possible to achieve high frame rate scanning, and its application scenes are somewhat limited, and it is often used in static scanning scenes. Spatial coding typically allows for three-dimensional reconstruction by projecting a single pattern onto the scene under measurement. Currently, related technologies employ two methods: one uses a circular code element coding scheme that decodes by utilizing the relative displacement relationship of neighboring code elements, while the other acquires three-dimensional data through matching between image blocks. The former method has a small coding capacity for code elements, can only reconstruct sparse code element points, results in less single-frame data, and has low scanning efficiency. The latter method uses image blocks for matching, resulting in low accuracy. Currently, no effective solutions have been proposed to address the above problem. [Overview of the project] [Problems that the invention aims to solve]
[0004] The embodiments of the present invention provide a three-dimensional reconstruction method, apparatus, and system that at least solve the technical problem of low accuracy in matching code elements based on code element feature points due to the blurriness of the image. [Means for solving the problem]
[0005] According to one embodiment of the present invention, a three-dimensional reconstruction method is provided, the method comprising the steps of acquiring a first image and a second image, the first image and the second image being acquired by collecting predetermined code element images projected onto the surface of an object to be measured by different image acquisition devices, the predetermined code element images comprising a plurality of target code elements randomly distributed according to a predetermined direction, the target code elements being line segment fringes; acquiring a first target pixel point for each code element in the first image and determining a matching pixel point in the second image for each first target pixel point of each code element in the first image; and determining the three-dimensional coordinates of the first target pixel point based on at least the pixel coordinates of the predetermined first target pixel point in the first image and the pixel coordinates of the matching pixel point in the second image, thereby completing the three-dimensional reconstruction.
[0006] In some embodiments of the present invention, the step of determining the matching pixel point in the second image for a first target pixel point of each code element in the first image includes the steps of determining the pixel coordinates and grayscale values of the first target pixel point; determining a first region of a predetermined area in the first image, and setting the center point of the first region as the first target pixel point; determining a second region of a predetermined area from the second image, wherein the vertical coordinate of the center of the second region in the second image is the same as the vertical coordinate of the center of the first region in the first image; and determining a matching pixel point from the second region that matches the first target pixel point.
[0007] In some embodiments of the present application, the step of determining a matching pixel point that matches a first target pixel point from a second region includes the steps of determining a correlation coefficient for each pixel point in the second region, the correlation coefficient being used to characterize the correlation between the pixel point in the second region and the first target pixel point, and determining the pixel point in the second region with the largest correlation coefficient as the matching pixel point.
[0008] In some embodiments of the present application, the step of determining a correlation coefficient for each pixel point in the second region includes the steps of determining the average tone value of all pixel points in the first region as the first average tone value and determining the average tone value of all pixel points in the second region as the second average tone value, and determining the correlation coefficient between each pixel point in the second region and the first target pixel point based on the difference between the tone value of the first target pixel point in the first region and the first average tone value and the difference between the tone value of each pixel point in the second region and the second average tone value.
[0009] In some embodiments of the present application, the step of determining the pixel point with the largest correlation coefficient in the second region as the matching pixel point includes the steps of determining the pixel point with the largest correlation coefficient in the second region as a candidate matching point, determining the candidate matching point as the matching pixel point if the candidate matching point coincides with the second target pixel point in the second image, and determining the second target pixel point within a predetermined range around the candidate matching point as the matching pixel point if the candidate matching point does not coincide with the second target pixel point in the second image.
[0010] In some embodiments of the present invention, a predetermined code element image includes a plurality of target code elements randomly distributed according to a predetermined direction, and the target code elements are line segment fringes. The steps include determining a target region in which a target code element is located based on the length of the target code element, the width of the target code element, the pitch between the target code elements, and the pixel coordinates of the center pixel point of the target code element, wherein the pixel coordinates of the center pixel point of the target code element are randomly generated within the region in which the code element image is located; traversing all pixel points within the target region and, if no target code element is present in the target region, generating a target code element in the target region, wherein the target code element includes at least one line segment of predetermined length and two endpoints corresponding to the line segment of predetermined length; and generating target code elements in all target regions within the code element image region.
[0011] In some embodiments of the present application, the method further includes the steps of: determining a first neighbor code element set for any one code element in a first image and a plurality of second neighbor code element sets for a plurality of candidate code elements in a second image; determining the number of times that neighbor code elements in the plurality of second neighbor code element sets match neighbor code elements in the first neighbor code element set, and determining the second neighbor code element set with the largest number of matches among the plurality of second neighbor code element sets as the target second neighbor code element set; and determining a candidate code element corresponding to the target second neighbor code element set as the target code element.
[0012] In some embodiments of the present application, the method further includes the steps of determining a plurality of first target pixel points in a first image and a plurality of second target pixel points in a second image, and matching the plurality of first target pixel points one-to-one with the plurality of second target pixel points in the second image.
[0013] According to another embodiment of the present invention, a three-dimensional reconstruction apparatus is provided, the apparatus comprising: an acquisition module for acquiring a first image and a second image, the first and second images being acquired by collecting predetermined code element images projected onto the surface of an object to be measured by different image acquisition devices, the predetermined code element images comprising a plurality of target code elements randomly distributed according to a predetermined direction, the target code elements being line segment fringes; a matching module for acquiring a first target pixel point for each code element in the first image and determining a matching pixel point in the second image for the first target pixel point of each code element in the first image; and a reconstruction module for determining the three-dimensional coordinates of a first target pixel point based on at least the pixel coordinates of the predetermined first target pixel point in the first image and the pixel coordinates of the matching pixel point in the second image, thereby completing the three-dimensional reconstruction.
[0014] Another embodiment of the present invention provides a three-dimensional reconstruction system applicable to a three-dimensional reconstruction method, the system comprising at least two image acquisition devices, a projection device and a first processor, the projection device for projecting predetermined code element images onto the surface of an object to be measured, at least two image acquisition modules for acquiring predetermined code element images from the surface of an object to be measured to obtain a first image and a second image, the first processor for acquiring a first target pixel point for each code element in the first image and determining the matching pixel point of the first target pixel point for each code element in the first image in the second image, and further for determining the three-dimensional coordinates of the first target pixel point based on at least predetermined pixel coordinates of the first target pixel point in the first image and pixel coordinates of the matching pixel point in the second image to complete the three-dimensional reconstruction.
[0015] According to another aspect of the embodiments of the present application, a non-volatile storage medium is further provided. The non-volatile storage medium includes a stored program, wherein when the program is executed, a device in which the non-volatile storage medium is located is controlled to perform the above three-dimensional reconstruction method.
[0016] According to another aspect of the embodiments of the present application, an electronic device is further provided. The electronic device includes a memory and a processor, the processor is configured to execute a program, wherein when the program is executed, the above three-dimensional reconstruction method is performed. Effects of the Invention
[0017] In the embodiments of the present application, a first image and a second image are acquired. The first image and the second image are acquired by respectively collecting predetermined code element images projected onto the surface of the object to be measured by different image collection devices. The predetermined code element images include a plurality of target code elements randomly distributed according to a preset direction, and the target code elements are line segment fringes. A first target pixel point of each code element in the first image is acquired, and a matching pixel point in the second image of the first target pixel point of each code element in the first image is determined. Based at least on the pixel coordinates of the predetermined first target pixel point in the first image and the pixel coordinates of the matching pixel point in the second image, the three-dimensional coordinates of the first target pixel point are determined to complete three-dimensional reconstruction. By adopting the coding method of determining the matching pixel point in the second image of the first target pixel point of each code element in the first image, the purpose of replacing the coding method based on code element feature points is achieved, thereby realizing the technical effect of improving the matching accuracy of code elements, and further solving the technical problem of low accuracy of matching code elements based on code element feature points caused by blurred images. Brief Description of the Drawings
[0018] The drawings described herein are provided to further understand the present application, constitute a part of the present application, and the exemplary embodiments of the present application and the descriptions thereof are intended to interpret the present application, and do not unduly limit the present application. [Figure 1] This is a block diagram of the hardware structure of a computer terminal (or mobile device) using the three-dimensional reconstruction method according to the embodiment of the present application. [Figure 2] This is a schematic diagram of the three-dimensional reconstruction method according to the present application. [Figure 3] This is a schematic diagram of a preferred encoding pattern according to the embodiment of the present application. [Figure 4] This is a schematic diagram of five preferred code element shapes according to the embodiment of the present application. [Figure 5] This is a preferred three-dimensional reconstruction system according to the embodiment of the present application. [Figure 6] This is a preferred three-dimensional reconstruction apparatus according to the embodiment of the present application. DETAILED DESCRIPTION OF EMBODIMENTS FOR IMPLEMENTING THE INVENTION
[0019] To enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Apparently, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work shall all fall within the protection scope of the present application.
[0020] Furthermore, the terms "first," "second," etc., used in the specification, claims, and drawings of this application are for distinguishing similar subjects and are not necessarily intended to describe a specific order or sequence. The data used in this manner may be interchangeable where appropriate, thereby allowing the embodiments of this application described herein to be implemented in an order other than that illustrated or described herein. Also, the terms "includes" and "have" and any variations thereof are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus including a series of steps or units is not necessarily limited to the steps or units explicitly listed, but may include other steps or units not explicitly listed or specific to these processes, methods, products, or apparatus.
[0021] Embodiments of the present invention further provide embodiments of a model training method, wherein the steps shown in the flowcharts of the drawings may be executed by a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps may be shown or described in a different order.
[0022] Embodiments of the method provided by the embodiments of the present application can be implemented in a mobile terminal, computer terminal, cloud server, or similar computing device. Figure 1 shows a block diagram of the hardware structure of a computer terminal (or mobile device) for realizing a three-dimensional reconstruction method. As shown in Figure 1, the computer terminal 10 (or mobile device 10) may include one or more (indicated in the figure as 102a, 102b, ..., 102n) processors 102 (processors 102 may include, but are not limited to, processing units such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 used for communication functions. In addition, it may further include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. It will be understood by those skilled in the art that the structure shown in Figure 1 is illustrative and does not limit the structure of the above electronic device. For example, the computer terminal 10 may include more or fewer components than those shown in Figure 1, or it may include components different from those shown in Figure 1.
[0023] The one or more processors 102 and / or other data processing circuits described above are generally referred to as “data processing circuits” in this specification. All or part of the data processing circuits may be embodied as software, hardware, firmware, or any other combination. The data processing circuits may also be a single, independent processing module, or all or part of them may be incorporated into one of the other elements within the computer terminal 10 (or mobile device). As in the embodiments of this application, the data processing circuits are controlled as processors (e.g., by selecting variable resistor terminal paths connected to an interface).
[0024] Memory 104 is for storing software programs and modules of application software, such as program instructions / data storage devices corresponding to the three-dimensional reconstruction method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by executing the software programs and modules stored in memory 104, thereby realizing the three-dimensional reconstruction method of the application program. Memory 104 may include high-speed random-access memory and may further include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the network include, but are not limited to, the Internet, intranet, local area network, mobile communication network, and combinations thereof.
[0025] The transmission module 106 is for receiving or transmitting data over a network. Specific examples of the network include a wireless network provided by the telecommunications carrier of the computer terminal 10. In one example, the transmission module 106 includes a network interface controller (NIC), which is connected to other network devices via a base station, thereby enabling communication with the internet. In another example, the transmission module 106 may be a radio frequency (RF) module, which communicates with the internet wirelessly.
[0026] The display may be, for example, a touch-panel liquid crystal display (LCD), and the user can interact with the user interface of the computer terminal 10 (or mobile device) through this display.
[0027] Embodiments of the present application provide embodiments of a three-dimensional reconstruction method, wherein the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer-executable instructions, and although the flowchart shows a logical order, in some cases the steps shown or described may be executed in a different order. Figure 2 is a flowchart of a three-dimensional reconstruction method according to an embodiment of the present invention, and as shown in Figure 2, the method includes the following steps S202 to S206.
[0028] In step S202, a first image and a second image are acquired. The first and second images are acquired by collecting predetermined code element images projected onto the surface of the object to be measured using different image acquisition devices. The predetermined code element images include multiple target code elements randomly distributed according to a predetermined direction, and the target code elements are line segment fringes.
[0029] In step S204, the first target pixel point for each code element in the first image is obtained, and the matching pixel point in the second image for the first target pixel point of each code element in the first image is determined.
[0030] In step S206, the three-dimensional coordinates of the first target pixel point are determined based on at least the predetermined pixel coordinates of the first target pixel point in the first image and the pixel coordinates of the matching pixel point in the second image, thereby completing the three-dimensional reconstruction.
[0031] The above steps enable the achievement of replacing the coding method based on code element feature points with an coding method that determines the matching pixel point in the second image for the first target pixel point of each code element in the first image. This technically improves the accuracy of code element matching and solves the technical problem of low accuracy in matching code elements based on code element feature points due to the blurriness of the image.
[0032] Three-dimensional reconstruction involves establishing mathematical models suitable for computer display and processing of three-dimensional objects. It forms the basis for analyzing processing, manipulation, and properties of these models in a computer environment, and is also a technique for establishing virtual reality that represents objective events in a computer. Three-dimensional reconstruction techniques typically utilize structural optical time coding and spatial coding techniques. structured light spatial code transformation The difficulty lies in utilizing pixel space gradation information to perform stable and reliable coding for each pixel point. One method in related technologies involves encoding specific pixel points with certain code element information, and then coding each code element using various sizes of circular code elements, utilizing epipolar constraints and the relative displacement relationship between neighboring code elements and code elements in the image, thereby achieving reconstruction of each code element point. The drawbacks of this method are that the code element coding capacity is limited, only sparse code element points can be reconstructed, single-frame data is scarce, scanning efficiency is low, and the texture of the object surface has a significant impact. Another method involves performing corresponding point matching based on the correlation between pixel blocks in the form of random speckle. For example, a pseudo-random speckle image is projected onto the surface of the object under test using a projection device, and matching between image blocks is performed using an improved SGM (semi-global matching, stereo matching) algorithm, thereby obtaining three-dimensional data of the object's surface. The drawbacks of this method are that the space of the image blocks to which matching is applied is large, the accuracy and detail of the reconstructed data are poor, and it is difficult to reconstruct complex objects. In related technologies, the code element matching method is generally employed to complete the matching of code elements. However, if the image clarity is poor and the degree of blurring of feature points is high, the accuracy of feature point extraction decreases, which leads to a decrease in the accuracy of code element matching.
[0033] In the method proposed in this application, a coding scheme for line segment fringe code elements is used to obtain a first target pixel point in the line segment fringe, for example, the midpoint of the line segment fringe. Matching is performed using the first target feature point of the code element, replacing the method that uses the feature point of the code element for matching. This further improves the accuracy of code element matching when the image is unclear. Furthermore, by adopting line segment fringe code elements and increasing the coding capacity, the amount of data in a single frame image is improved, and scanning efficiency is further enhanced. In addition, the method proposed in this application is a line segment fringe distribution, and because the distribution density of code elements is high, the accuracy of the acquired reconstructed data is further improved.
[0034] The method proposed in this application can be applied to scanners such as intraoral scanners, face scanners, industrial scanners, and dedicated scanners, and can realize three-dimensional reconstruction of objects or scenes such as teeth, faces, human body, industrial products, industrial equipment, cultural properties, works of art, prosthetics, medical devices, and buildings.
[0035] In step S202, the first image is an image collected by the first image acquisition device, and the second image is an image collected by the second image acquisition device. Multiple target code elements in the first image are oriented in the same direction, and the pitch between the code elements is determined randomly. For example, the pitch between the first and second code elements is 100 μm, and the pitch between the second and third code elements is 80 μm. The code elements are distributed with random vertical fluctuations according to the horizontal direction of the image (camera epipolar direction). The features of the code elements include at least two extractable grayscale feature point patterns, and the feature points are distributed vertically at a preset pitch. Figure 3 shows a preferred code element image, in which the code elements are randomly distributed according to the vertical direction.
[0036] In step S204, the first target pixel point for each code element in the first image is obtained, and the matching pixel point in the second image for the first target pixel point of each code element in the first image is determined. Since the first and second images are obtained by different image acquisition devices that collect projected images onto the surface of the object being measured, it will be understood that the code element structure in the first image is the same as the code element structure in the second image. As can be seen from this, taking the first target pixel point as the midpoint of the line segment fringe in the first image as an example, the matching pixel point in the second image is the midpoint of the line segment fringe in the second image.
[0037] In step S206, the first target pixel point in the first image is associated one-to-one with the matching pixel point in the second image. Based on at least the pixel coordinates of the first target pixel point in the first image and the pixel coordinates of the corresponding matching pixel point in the second image, the three-dimensional coordinates of the first target pixel point are determined, and the reconstruction is completed.
[0038] Steps S202 to S206 described above will be explained in detail below with reference to specific examples.
[0039] In step S204, the matching pixel point in the second image for the first target pixel point can be determined using the pixel point coordinates and the grayscale value of the pixel point. Specifically, the pixel coordinates and grayscale value of the first target pixel point are determined. In the first image, a first region of a predetermined area is determined, and the center point of the first region is set as the first target pixel point. A second region of a predetermined area is determined from the second image, where the vertical coordinate of the center of the second region in the second image is the same as the vertical coordinate of the center of the first region in the first image. A matching pixel point that matches the first target pixel point is determined from the second region.
[0040] In one preferred form, the first and second regions may be image regions with an image size of m × n, where m and n are pixel values.
[0041] It should be noted that the above vertical coordinates are pixel coordinates, and the fact that the vertical coordinate of the center of the second region in the second image is the same as the vertical coordinate of the center of the first region in the first image indicates that the distance from the boundary of the first image in a predetermined direction to the center of the first region is the same as the distance from the same boundary of the second image in a predetermined direction to the center of the second region.
[0042] In one preferred form, the matching pixel can be determined by comparing the correlation coefficients between the first target pixel point and each pixel point in the second region. For example, the correlation coefficient for each pixel point in the second region is determined one by one, and the correlation coefficients characterize the correlation between the pixel point in the second region and the first target pixel point. The pixel point with the largest correlation coefficient in the second region is determined as the matching pixel point.
[0043] The correlation coefficient between each pixel point in the second region and the first target pixel point is determined by the following method: First, the average tonal value of all pixel points in the first region is determined as the first average tonal value, and the average tonal value of all pixel points in the second region is determined as the second average tonal value. Based on the difference between the tonal value of the first target pixel point in the first region and the first average tonal value, and the difference between the tonal value of each pixel point in the second region and the second average tonal value, the correlation coefficient between each pixel point in the second region and the first target pixel point is determined.
[0044] Specifically, the first target pixel point (u 1 , v 1 ) and its grayscale value is I 1 (u 1 , v 1 ) and one of the pixel points is taken as the center of the first region with image size m × n, and a second region is determined in the second image that is at the same pixel row position as the first region, and the image size of the second region is m × n. The correlation coefficient ω of each pixel point in the second region i Calculate each one individually, i=0, 1, 2、3、…、 W-1 integer Here, W is the pixel width of the first image. The formula for calculating the correlation coefficient is as follows:
[0045] JPEG0007954800000001.jpg29170
[0046] Furthermore, the correlation coefficient may be a zero-mean normalized correlation coefficient determined by matching using the zero-mean normalized correlation coefficient (ZNCC) method. This coefficient explains the similarity between two different image blocks, and a higher correlation coefficient indicates a higher similarity between the image blocks and a higher probability of them being matching points.
[0047] Taking the example that the first target pixel point is the midpoint of a line segment fringe in the first image, the above steps allow us to find one candidate matching point (the pixel point with the largest correlation coefficient) in the second image for each midpoint of a line segment fringe in the first image. As is clear, since the first target pixel point is the midpoint of a line segment fringe, the matching pixel point that matches the first target pixel point in the second image must be the midpoint of a line segment fringe in the second image. Based on the above principle, we traverse all candidate matching points, and if a candidate matching point overlaps with the second target pixel point in the second image, we determine the candidate matching point as the matching pixel point. If the candidate matching point does not overlap with the second target pixel point in the second image, we determine the second target pixel point within a predetermined range around the candidate matching point as the matching pixel point.
[0048] In another preferred form, after determining the matching pixel point, the first target pixel point is used as a feature point. Determine the set of first-neighbor code elements for any one code element in the first image, and the set of second-neighbor code elements for multiple candidate code elements in the second image. The number of times that neighbor code elements in multiple second neighbor code element sets match neighbor code elements in the first neighbor code element set. statistics Then, among multiple sets of second-neighbor code elements, select the set of second-neighbor code elements with the largest number of matches. Select the set of second-neighbor code elements with the most matching values. The target second neighbor code element set is determined, and the target second neighbor code element set inside Match the code element with one of the above code elements. the goal It may also be determined as a code element.
[0049] Specifically, the first neighbor code element set is Any one of the first images which is a neighboring code element set of a code element, for example, the 1 code element p in the image is exemplified as a line segment with a set length and two endpoints corresponding to the line segment, and the neighboring code element set of the code element p is {p 1 ,p 2 ,p 3 ,p 4}, the second neighboring code element set is a neighboring code element set of a candidate code element of any one code element in the second image, for example, the candidate code element of the code element p is a code element q, and the neighboring code element set of the code element q is {q 1 ,q 2 ,q 3 ,q 4}, and when there are three candidate code elements for the code element p, for example, q i , where i=1, 2, 3, there are three second neighboring code element sets, and when there are a plurality of code elements p, the situation is the same as the above, and the description thereof is omitted here.
[0050] Note that taking the code element p as an example, for each candidate code element q i of the code element p where i is a positive integer, first, the code element p 1 is the first neighboring code element of the candidate code element q1 JPEG0007954800000002.jpg44170 The candidate code element with the largest matching number is determined as the target code element, and taking the code element p as an example, when the matching number between the candidate code element q1 and the code element p is the largest, the candidate code element q1 is determined as the target code element that matches the code element p.
[0051] In step S202, the predetermined code element image is generated by the following method. Based on the length of the target code element, the width of the target code element, the pitch between target code elements, and the pixel coordinates of the center pixel point of the target code element, the target region where the target code element is located is determined. Here, the pixel coordinates of the center pixel point of the target code element are randomly generated within the region where the code element image is located. Traversing all pixel points within the target region, if no target code element exists in the target region, a target code element is generated in the target region. Here, the target code element includes at least one line segment of a predetermined length and two endpoints corresponding to the line segment of a predetermined length, and target code elements are generated in all target regions within the code element image region. As shown in Figure 4, five target code elements are shown, where code element 1 consists of one line segment and two circular endpoints corresponding to the line segment, and code element 2 Code element It is composed of one line segment of a first predetermined length and two line segments of a second predetermined length as its endpoints, the first predetermined length is greater than the second predetermined length, and the code element of reference numeral 3 is composed of one line segment of a first predetermined length and three line segments of a second predetermined length as its endpoints, reference numeral 4 Code element It consists of one line segment and the two endpoints of the line segment itself, and the code element of symbol 5 is formed by the intersection of one line segment and another line segment.
[0052] After the projection module and image acquisition module of the reconstruction system are determined, the projection equipment JPEG0007954800000003.jpg24170 The minimum length of a unit pixel in a projectable code element image of a projection device is l min To determine this, the minimum length of the fringe in the first image is L according to the formula. min This can be determined as follows: To ensure the randomness of the projection pattern with width W and height H, the maximum length L of the stripes in the pattern is determined. max To ensure that does not exceed H / 2, the length of each stripe is L i ∈[L min ,L max ]
[0053] In particular, the length L of the fringe in the projection pattern may be a fixed length value or a random length value. If it is a random length value, the length of each fringe is one pseudo-random sequence {L i The range of values for a pseudorandom sequence can be determined by}, and the range of values for a pseudorandom sequence is L i ∈[L min ,L max ]
[0054] If the first target pixel point is the midpoint of a line segment fringe in the first image, then the midpoint of the line segment fringe in the second image must be the point of match with the first target pixel point. The midpoint of the line segment fringe in the second image is determined as the second target pixel point, and the correlation coefficient between each second target pixel point and the first target pixel point is directly determined. The second target pixel point with the largest correlation coefficient is determined as the matching pixel point for the first target pixel point. This reduces the number of pixel point calculations and further improves matching efficiency.
[0055] In some embodiments of the present application, before determining which of several candidate code elements in the first image corresponds to any one code element in the second image, the method processes the first and second images. same This further includes the step of adjusting to a single plane.
[0056] In the field of stereoscopic vision, an epipolar constraint exists between the first and second images; that is, feature points that are on the same epipolarity in the projected image are also on the same epipolarity in the image acquired by the image acquisition device. By utilizing the epipolar correction principle, the epipolarity corresponding to the first and second images can be corrected in the same horizontal direction. After the correction is complete, the first and second images are subjected to filter smoothing, which includes, but is not limited to, a Gaussian filter.
[0057] The first and second images are generated by projecting the target image onto the surface of the object being measured, and the projection parameters of each code element can be determined based on the pre-set orientation results.
[0058] Based on the above method, the present invention can achieve high-speed and accurate reconstruction of three-dimensional data of the surface of an object to be measured. The method for reconstructing the fringe center points in the present invention can achieve accurate acquisition of three-dimensional data, and the random fringe method increases the number of coded points (any single pixel point at the center of a fringe is a coded point), improves data redundancy, and further improves scanning efficiency.
[0059] Embodiments of the present invention further provide a three-dimensional reconstruction system, as shown in Figure 5, which includes at least two image acquisition devices 503, a projection device 504, and a first processor 502, wherein the projection device 504 projects predetermined code element images onto the surface of an object under test; at least two image acquisition modules 503 collect predetermined code element images from the surface of an object under test 501 to obtain a first image and a second image; the first processor 502 acquires first target pixel points for each code element in the first image and determines matching pixel points in the second image for each first target pixel point of each code element in the first image; and further determines the three-dimensional coordinates of the first target pixel points based on predetermined image parameters of the first and second images to complete the three-dimensional reconstruction.
[0060] However, the image acquisition device 503 includes but is not limited to a grayscale camera and a color camera, and the projection method of the projection device 504 includes but is not limited to projection methods such as DLP (Digital Light Processing), MASK (mask projection), and DOE (diffraction projection), and can project a structural light pattern. In one preferred embodiment, there may be multiple image acquisition devices.
[0061] In one preferred embodiment, a first processor 502 pre-sets and generates a code element image, transmits it to a projection device 504, projects the code element image onto the surface of the object to be measured 501, and then two image acquisition devices 503 collect a first image and a second image, respectively, and transmit them to the first processor 502 to perform code element matching. After completing the code element matching, the three-dimensional coordinates of each code element in the first image are determined, and the three-dimensional reconstruction is completed.
[0062] In some embodiments of the present invention, by connecting the first processor 502 to an interactive device, generation instructions can be input, code element images can be displayed on the display interface, the displayed code element images can be modified, and multiple types of data in the reconstruction process can be displayed on the interactive device, thereby facilitating real-time monitoring.
[0063] Embodiments of the present invention further provide a model training apparatus, as shown in Figure 6, which includes an acquisition module 60 configured to acquire a first image and a second image, the first and second images being acquired by collecting predetermined code element images projected onto the surface of an object under test by different image acquisition equipment, the predetermined code element images including a plurality of target code elements randomly distributed according to a predetermined direction, the target code elements being line segment fringes; a matching module 62 configured to acquire a first target pixel point for each code element in the first image and to determine the matching pixel point in the second image for the first target pixel point of each code element in the first image; and a reconstruction module 64 configured to determine the three-dimensional coordinates of the first target pixel point based on predetermined image parameters of the first and second images and to complete three-dimensional reconstruction.
[0064] The matching module 62 includes a first determination submodule, which determines the pixel coordinates and grayscale values of a first target pixel point, determines a first region of a predetermined area in the first image, sets the center point of the first region as the first target pixel point, determines a second region of a predetermined area from the second image, where the vertical coordinate of the center of the second region in the second image is the same as the vertical coordinate of the center of the first region in the first image, and determines a matching pixel point that matches the first target pixel point from the second region.
[0065] The first decision submodule includes a first decision unit and a second decision unit. The first decision unit determines a correlation coefficient for each pixel point in the second region, and the correlation coefficient is used to characterize the correlation between the pixel point in the second region and the first target pixel point. The first decision unit is configured to determine the pixel point with the largest correlation coefficient in the second region as the matching pixel point. The second decision unit determines the average tone value of all pixel points in the first region as the first average tone value, and the average tone value of all pixel points in the second region as the second average tone value. Based on the difference between the tone value of the first target pixel point in the first region and the first average tone value, and the difference between the tone value of each pixel point in the second region and the second average tone value, the second decision unit is configured to determine the correlation coefficient between each pixel point in the second region and the first target pixel point.
[0066] The first decision unit includes a decision subunit, which determines the pixel point with the largest correlation coefficient in the second region as the candidate matching point. If the candidate matching point coincides with the second target pixel point in the second image, it determines the candidate matching point as the matching pixel point. If the candidate matching point does not coincide with the second target pixel point in the second image, it determines the second target pixel point within a predetermined range around the candidate matching point as the matching pixel point.
[0067] The matching module 62 further includes a matching submodule, which determines a plurality of first target pixel points in the first image and a plurality of second target pixel points in the second image, and is positioned to match the plurality of first target pixel points one-to-one with the plurality of second target pixel points in the second image.
[0068] According to another embodiment of the present invention, a non-volatile storage medium is provided, the non-volatile storage medium containing a stored program, wherein when the program is executed, the device in which the non-volatile storage medium is located controls to perform the three-dimensional reconstruction method described above.
[0069] According to another embodiment of the present invention, a processor is further provided which is configured to execute a program, wherein the three-dimensional reconstruction method is performed when the program is executed.
[0070] The above processor is configured to execute a program that performs the following functions: it acquires a first image and a second image, the first and second images are acquired by collecting predetermined code element images projected onto the surface of the object to be measured by different image acquisition devices, the predetermined code element images include a plurality of target code elements randomly distributed according to a predetermined direction, the target code elements are line segment fringes, it acquires the first target pixel point of each code element in the first image, and determines the matching pixel point in the second image for the first target pixel point of each code element in the first image, and determines the three-dimensional coordinates of the first target pixel point based on at least the pixel coordinates of the predetermined first target pixel point in the first image and the pixel coordinates of the matching pixel point in the second image, thereby completing three-dimensional reconstruction.
[0071] The above processor performs the above three-dimensional reconstruction method and achieves the objective of replacing the coding method using code element feature points by determining the matching pixel point in the second image for the first target pixel point of each code element in the first image using an coding method. This thereby realizes the technical effect of improving the accuracy of code element matching and further solves the technical problem of low accuracy in matching code elements based on code element feature points due to the blurriness of the image.
[0072] In the embodiments described above, each embodiment has its own emphasis, and for parts not detailed in one embodiment, you can refer to the relevant descriptions in other embodiments.
[0073] In addition, in some embodiments provided by this application, the disclosed technical content can be implemented in other ways. Herein, the embodiments of the apparatus described above are merely illustrative, and for example, the division of units may be a division of logical functions, other division methods may exist when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. In other words, the combinations, direct combinations or communication connections between them that are shown or discussed may be indirect combinations or communication connections via some interfaces, units or modules, and may be in electrical or other forms.
[0074] The units described as separating members may or may not be physically separated, the members shown as units may or may not be physical units, they may be located in one place, or they may be distributed among multiple units. Depending on the actual needs, some or all of these units can be selected to achieve the objective of the solution of this embodiment.
[0075] Furthermore, each functional unit in each embodiment of the present application may be integrated into a single processing unit, each unit may exist physically independently, or two or more units may be integrated into a single unit. The integrated unit may be implemented in hardware form or in the form of a software functional unit.
[0076] When an integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored on a single computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially, or contributes to the prior art, or all or part of the technical solution can be implemented in the form of a software product, which is stored on a single storage medium and contains several instructions for causing a single computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of each embodiment of the present application. The aforementioned storage mediums include various media capable of storing program code, such as U disks, read-only memory (ROM), random access memory (RAM), portable hard disks, magnetic disks, or optical disks.
[0077] The foregoing are merely preferred embodiments of the present application, and those skilled in the art can make several improvements and modifications without departing from the principles of the present application, and these improvements and modifications should also be considered within the scope of protection of the present application. [Industrial applicability]
[0078] The technical solution provided in the embodiment of the present application can be applied to the field of three-dimensional reconstruction, in the embodiment of the present application, a first image and a second image are acquired, the first image and the second image are acquired by collecting predetermined code element images projected onto the surface of the object to be measured by different image acquisition equipment, the predetermined code element image includes a plurality of target code elements randomly distributed according to a predetermined direction, the target code elements are line segment fringes, a first target pixel point of each code element in the first image is acquired, and the matching pixel point in the second image of the first target pixel point of each code element in the first image is determined, at least in advance This method employs a system that determines the three-dimensional coordinates of the first target pixel point based on the pixel coordinates of the first target pixel point in the first image and the pixel coordinates of the matching pixel point in the second image, thereby completing three-dimensional reconstruction. By using an encoding method that determines the matching pixel point in the second image for the first target pixel point of each code element in the first image, it achieves the objective of replacing the encoding method using code element feature points, thereby realizing the technical effect of improving the accuracy of code element matching and further solving the technical problem of low accuracy in matching code elements based on code element feature points due to the blurriness of the image. [Explanation of Symbols]
[0079] 501…Object to be measured 502…First processor 503…Image acquisition equipment 504…Projection equipment
Claims
1. A step of acquiring a first image and a second image, wherein the first image and the second image are acquired by collecting predetermined code element images projected onto the surface of an object to be measured by different image acquisition devices, the predetermined code element images include a plurality of target code elements randomly distributed according to a predetermined direction, the target code elements are line segment fringes, and the target code elements include at least one line segment of a predetermined length and two endpoints corresponding to the line segment of the predetermined length, The steps include obtaining a first target pixel point for each code element in the first image and determining the matching pixel point in the second image for each first target pixel point of each code element in the first image, A three-dimensional reconstruction method comprising the step of determining the three-dimensional coordinates of a first target pixel point based on at least the pixel coordinates of the first target pixel point in the first image and the pixel coordinates of the matching pixel point in the second image, thereby completing the three-dimensional reconstruction.
2. The step of determining the matching pixel point in the second image for the first target pixel point of each code element in the first image is: The steps include determining the pixel coordinates of the first target pixel point and the grayscale value of the first target pixel point, The first image is defined by the steps of determining a first region of a predetermined area and setting the center point of the first region as the first target pixel point, A step of determining a second region of a predetermined area from a second image, wherein the vertical coordinate of the center of the second region in the second image is the same as the vertical coordinate of the center of the first region in the first image, The method according to claim 1, comprising the step of determining a matching pixel point that matches the first target pixel point from the second region.
3. The step of determining a matching pixel point that matches the first target pixel point from the second region is: A step of determining a correlation coefficient for each pixel point in the second region, wherein the correlation coefficient is for characterizing the correlation between the pixel point in the second region and the first target pixel point, The method according to claim 2, comprising the step of determining the pixel point with the largest correlation coefficient in the second region as the matching pixel point.
4. The step of determining the correlation coefficient for each pixel point in the second region is as follows: The steps include determining the average tone value of all pixel points in the first region as the first average tone value, and determining the average tone value of all pixel points in the second region as the second average tone value, The method according to claim 3, comprising the step of determining a correlation coefficient between each pixel point in the second region and the first target pixel point based on the difference between the grayscale value of the first target pixel point in the first region and the first average grayscale value, and the difference between the grayscale value of each pixel point in the second region and the second average grayscale value.
5. The step of determining the pixel point with the largest correlation coefficient in the second region as the matching pixel point is as follows: The steps include determining the pixel point with the largest correlation coefficient in the second region as a candidate matching point, If the candidate matching point coincides with the second target pixel point in the second image, the step of determining the candidate matching point as the matching pixel point, The method according to claim 3, comprising the step of determining the second target pixel point within a predetermined range surrounding the candidate matching point as the matching pixel point if the candidate matching point does not overlap with the second target pixel point in the second image.
6. The predetermined code element image includes a plurality of target code elements randomly distributed according to a predetermined direction, and the step in which the target code elements are line segment fringes is: A step of determining a target region in which the target code element is located, based on the length of the target code element, the width of the target code element, the pitch between the target code elements, and the pixel coordinates of the center pixel point of the target code element, wherein the pixel coordinates of the center pixel point of the target code element are randomly generated within the region in which the code element image is located. The steps include: traversing all pixel points within the target region, and if the target code element does not exist in the target region, generating the target code element in the target region; The method according to claim 1, comprising the step of generating the target code elements in all of the target regions within the code element image.
7. The steps include determining the first neighbor code element set of any one code element in the first image and the multiple second neighbor code element sets of multiple candidate code elements in the second image, The steps include determining the number of neighbor code elements in the plurality of second neighbor code element sets that match with neighbor code elements in the first neighbor code element set, and determining the second neighbor code element set with the largest number of matches among the plurality of second neighbor code element sets as the target second neighbor code element set. The method according to claim 1, further comprising the step of determining the candidate code element corresponding to the target second neighbor code element set as the target code element.
8. The steps include determining a plurality of first target pixel points in the first image and a plurality of second target pixel points in the second image, The method according to claim 1, further comprising the step of matching the plurality of first target pixel points with a plurality of second target pixel points in the second image in a one-to-one correspondence.
9. An acquisition module installed to acquire a first image and a second image, wherein the first image and the second image are acquired by collecting predetermined code element images projected onto the surface of an object to be measured by different image acquisition devices, the predetermined code element images include a plurality of target code elements randomly distributed according to a predetermined direction, the target code elements are line segment fringes, and the target code elements include at least one line segment of a predetermined length and two endpoints corresponding to the line segment of the predetermined length, A matching module is installed to acquire a first target pixel point for each code element in the first image and to determine the matching pixel point in the second image for the first target pixel point of each code element in the first image, A three-dimensional reconstruction apparatus comprising: a reconstruction module configured to determine the three-dimensional coordinates of a first target pixel point based on at least the pixel coordinates of the first target pixel point in a first image and the pixel coordinates of the matching pixel point in a second image, thereby completing the three-dimensional reconstruction.
10. It includes at least two image acquisition devices, a projection device, and a first processor, The aforementioned projection device is for projecting a predetermined code element image onto the surface of the object to be measured. The at least two image acquisition devices are for acquiring a first image and a second image by acquiring the predetermined code element images from the surface of the object to be measured, wherein the predetermined code element images include a plurality of target code elements randomly distributed according to a predetermined direction, the target code elements are line segment fringes, and the target code elements include at least one line segment of a predetermined length and two endpoints corresponding to the line segment of the predetermined length, A three-dimensional reconstruction system comprising: a first processor for acquiring a first target pixel point for each code element in the first image and determining a matching pixel point in the second image for the first target pixel point of each code element in the first image; and further for determining the three-dimensional coordinates of the first target pixel point based on at least the predetermined pixel coordinates of the first target pixel point in the first image and the pixel coordinates of the matching pixel point in the second image, thereby completing the three-dimensional reconstruction.
11. A non-volatile storage medium, wherein the non-volatile storage medium includes a stored program, and the non-volatile storage medium controls the equipment in which it is located to perform the three-dimensional reconstruction method according to any one of claims 1 to 8 when the program is executed.
12. An electronic device including memory and a processor, wherein the processor is configured to execute a program, and when the program is executed, the electronic device performs the three-dimensional reconstruction method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and system for three-dimensional surface reconstruction of objects
JP2006528770A
Three-dimensional measurement device, illumination device, pattern generation device, and method
JP2017053812A
