CN111311731A - Random gray level map generation method and device based on digital projection and computer equipment - Google Patents

Random gray level map generation method and device based on digital projection and computer equipment Download PDF

Info

Publication number
CN111311731A
CN111311731A CN202010076340.8A CN202010076340A CN111311731A CN 111311731 A CN111311731 A CN 111311731A CN 202010076340 A CN202010076340 A CN 202010076340A CN 111311731 A CN111311731 A CN 111311731A
Authority
CN
China
Prior art keywords
target
sequence
phase
random signal
gray
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010076340.8A
Other languages
Chinese (zh)
Other versions
CN111311731B (en
Inventor
陈海龙
曹良才
何进英
刘梦龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Esun Display Co ltd
Tsinghua University
Original Assignee
Shenzhen Esun Display Co ltd
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Esun Display Co ltd, Tsinghua University filed Critical Shenzhen Esun Display Co ltd
Priority to CN202010076340.8A priority Critical patent/CN111311731B/en
Publication of CN111311731A publication Critical patent/CN111311731A/en
Application granted granted Critical
Publication of CN111311731B publication Critical patent/CN111311731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The application relates to a random gray level map generation method and device based on digital projection and computer equipment. The method comprises the following steps: acquiring a candidate random signal sequence and a target random signal sequence set; acquiring target correlation degrees between the candidate random signal sequences and each target random signal sequence to obtain a first correlation degree set; when the correlation degrees in the first correlation degree set are all smaller than a preset correlation degree threshold value, adding the candidate random signal sequence into a target random signal sequence set; generating a candidate gray-scale map according to the target random signal sequence set; obtaining a first target gray-scale image and a second target gray-scale image corresponding to the target object according to the projection of the candidate gray-scale image on the target object; and performing homologous point positioning according to the first target gray-scale image and the second target gray-scale image so as to perform three-dimensional reconstruction on the target object. The method can improve the three-dimensional reconstruction accuracy.

Description

Random gray level map generation method and device based on digital projection and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a random grayscale map based on digital projection, a computer device, and a storage medium.
Background
With the development of computer technology, three-dimensional Reconstruction (3D Reconstruction) technology has emerged. Three-dimensional reconstruction refers to the establishment of a mathematical model suitable for computer representation and processing of a three-dimensional object, is the basis for processing, operating and analyzing the properties of the three-dimensional object in a computer environment, and is also a key technology for establishing virtual reality expressing an objective world in a computer.
At present, a three-dimensional reconstruction technology projects a coding pattern onto the surface of an object, and a camera acquires an image modulated by the surface of the object, so that three-dimensional reconstruction is performed according to the image, but the accuracy of the image acquired by the camera is low when the same-name point is positioned, so that the accuracy of the three-dimensional reconstruction is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a computer device and a storage medium for generating a random grayscale map based on digital projection, which can improve the three-dimensional reconstruction accuracy.
A method for random grayscale map generation based on digital projection, the method comprising: acquiring a candidate random signal sequence; acquiring a target random signal sequence set, wherein the correlation degree between target random signal sequences in the target random signal sequence set is smaller than a first preset correlation degree threshold value; obtaining target correlation degrees between the candidate random signal sequences and each target random signal sequence to obtain a first correlation degree set corresponding to the candidate random signal sequences; when the correlation degree in the first correlation degree set is smaller than a first preset correlation degree threshold value, adding the candidate random signal sequence into the target random signal sequence set; generating a candidate gray-scale map according to the target random signal sequence set; obtaining a first target gray-scale image and a second target gray-scale image corresponding to the target object according to the projection of the candidate gray-scale image on the target object; and performing corresponding point positioning according to the first target gray-scale image and the second target gray-scale image so as to perform three-dimensional reconstruction on the target object.
A random gray scale map generation apparatus based on digital projection, the apparatus comprising: a candidate random signal sequence obtaining module, configured to obtain a candidate random signal sequence; the device comprises a target random signal sequence set acquisition module, a target random signal sequence set acquisition module and a target random signal sequence acquisition module, wherein the target random signal sequence set acquisition module is used for acquiring a target random signal sequence set, and the correlation degree between target random signal sequences in the target random signal sequence set is smaller than a first preset correlation degree threshold value; a first correlation set obtaining module, configured to obtain a target correlation between the candidate random signal sequence and each target random signal sequence, and obtain a first correlation set corresponding to the candidate random signal sequence; a candidate random signal sequence adding module, configured to add the candidate random signal sequence to the target random signal sequence set when a correlation degree in the first correlation degree set is smaller than a first preset correlation degree threshold; the candidate gray-scale image generation module is used for generating a candidate gray-scale image according to the target random signal sequence set; a target gray-scale image obtaining module, configured to obtain a first target gray-scale image and a second target gray-scale image corresponding to a target object according to projection of the candidate gray-scale image on the target object; and the homonymous point positioning module is used for performing homonymous point positioning according to the first target gray-scale image and the second target gray-scale image so as to perform three-dimensional reconstruction on the target object.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above-described method for generating random gray scale maps based on digital projection when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned digital projection-based random gray scale map generation method.
The random gray level image generation method based on digital projection, the device, the computer equipment and the storage medium obtain candidate random signal sequences, obtain a target random signal sequence set, obtain target correlation degrees between the candidate random signal sequences and each target random signal sequence, obtain a first correlation degree set corresponding to the candidate random signal sequences, when the correlation degrees in the first correlation degree set are smaller than a first preset correlation degree threshold value, add the candidate random signal sequences into the target random signal sequence set, generate a candidate gray level image according to the target random signal sequence set, obtain a first target gray level image and a second target gray level image corresponding to a target object according to the projection of the candidate gray level image on the target object, perform corresponding point positioning according to the first target gray level image and the second target gray level image to perform three-dimensional reconstruction on the target object, the candidate gray-scale images are generated according to the target random signal sequences, and the correlation degree between the target random signal sequences is smaller than the first preset correlation degree threshold value, so that the reliability of the candidate gray-scale images is improved, the accuracy of the homonymous points is improved when the homonymous points are positioned according to the first target gray-scale image and the second target gray-scale image, and the accuracy of three-dimensional reconstruction is improved.
Drawings
FIG. 1 is a diagram of an application scenario of a random gray scale map generation method based on digital projection in some embodiments;
FIG. 2 is a flow diagram of a method for generating random gray scale maps based on digital projection in some embodiments;
FIG. 3A is a flow diagram illustrating a method for generating random gray scale maps based on digital projection according to some embodiments;
FIG. 3B is a schematic diagram of target random signal sequence determination in some embodiments;
FIG. 3C is an exemplary graph of a candidate gray scale map in some embodiments;
FIG. 4 is a flow chart illustrating a correlation obtaining step in some embodiments;
FIG. 5 is a schematic flow chart of the three-dimensional reconstruction step in some embodiments;
FIG. 6 is a flow chart illustrating the sub-phase sequence obtaining step in some embodiments;
FIG. 7 is a schematic flow chart of the three-dimensional reconstruction step in some embodiments;
FIG. 8 is a schematic flow chart of a homonym derivation step in some embodiments;
FIG. 9 is a block diagram of a random gray scale map generation apparatus based on digital projection in some embodiments;
FIG. 10 is a diagram of the internal structure of a computer device in some embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The random gray scale map generation method based on digital projection can be applied to the application environment shown in fig. 1. The application environment includes a projector 102, a left camera 104, a right camera 106, an object under test 108, and a terminal 110. The projector 102, the left camera 104, the right camera 106, and the terminal 110 perform data transmission therebetween by wire, wireless, or a memory card.
Specifically, the terminal 110 may generate a gray scale image, transmit the generated gray scale image to the projector 102, the projector 102 may project the gray scale image onto the object to be measured 108, the left camera 104 and the right camera 106 may perform image acquisition on the object to be measured 108 projected by the gray scale image to obtain an acquired gray scale image, and transmit the acquired gray scale image to the terminal 110, so that the terminal 110 analyzes and processes the acquired gray scale image, thereby performing three-dimensional reconstruction on the object to be measured. When generating the gray scale map, the terminal 110 may obtain a candidate random signal sequence and a target random signal sequence set, where a correlation degree between target random signal sequences in the target random signal sequence set is smaller than a first preset correlation degree threshold, obtain a target correlation degree between the candidate random signal sequence and each target random signal sequence, obtain a first correlation degree set corresponding to the candidate random signal sequence, add the candidate random signal sequence to the target random signal sequence set when correlation degrees in the first correlation degree set are smaller than the first preset correlation degree threshold, and generate the candidate gray scale map according to the target random signal sequence set. The terminal 110 may further obtain projection images of the candidate gray-scale maps on the target object, which are acquired by the left camera and the right camera, obtain a first target gray-scale map and a second target gray-scale map corresponding to the target object according to the projection images of the candidate gray-scale maps on the target object, and perform corresponding point positioning according to the first target gray-scale map and the second target gray-scale map to perform three-dimensional reconstruction on the target object. The terminal 110 may be, but is not limited to, various personal computers, notebook computers, and tablet computers.
In some embodiments, as shown in fig. 2, a random gray scale map generation method based on digital projection is provided, which is described by taking the method as an example applied to the terminal 110 in fig. 1, and includes the following steps:
s202, acquiring a candidate random signal sequence.
Specifically, the candidate random signal sequence may be a random signal sequence generated by the terminal, for example, a binary random signal sequence generated by the terminal. The candidate random signal sequence includes gray scale values corresponding to a plurality of pixels, i.e., can be understood as a gray scale signal sequence for a pixel.
S204, a target random signal sequence set is obtained, and in the target random signal sequence set, the correlation degree between target random signal sequences is smaller than a first preset correlation degree threshold value.
Specifically, the first preset correlation threshold may be set empirically, and the fact that the correlation between the target random signal sequences is smaller than the first preset correlation threshold means that weak correlation is satisfied between the target random signal sequences. The first predetermined correlation threshold is used to ensure that weak correlation between target random signal sequences is satisfied, and therefore, the first predetermined correlation threshold should be less than a certain value, for example, 0.5. The length of the target random signal sequence in the set of target random signal sequences is the same as the length of the candidate random signal sequence. The correlation degree between the target random signal sequences is smaller than a first preset correlation degree threshold, which may be directly calculating the correlation degree between the target random signal sequences, and the obtained correlation degree is smaller than the first preset correlation degree threshold, or processing the target random signal sequences, and calculating the correlation degree between the processed target random signal sequences as the correlation degree between the target random signal sequences.
S206, obtaining target correlation degrees between the candidate random signal sequences and each target random signal sequence to obtain a first correlation degree set corresponding to the candidate random signal sequences.
Specifically, the correlation between the candidate random signal sequence and each target random signal sequence may be calculated by a correlation function, and the calculated correlation is used as a target correlation, and a first correlation set is obtained according to each target correlation combination. The Correlation function is, for example, ZNCC (Zero Mean Normalized Cross Correlation).
In some embodiments, the candidate random signal sequence may be filtered, the target random signal sequence may be filtered in the same manner, and the correlation degrees of the filtered candidate random signal sequence and each filtered target random signal sequence are respectively calculated to obtain a first correlation degree set corresponding to the candidate random signal sequence.
And S208, when the correlation degree in the first correlation degree set is smaller than a first preset correlation degree threshold value, adding the candidate random signal sequence into the target random signal sequence set.
Specifically, the candidate random signal sequence may be added to the target random signal sequence set when the correlations in the first correlation set are all smaller than a first preset correlation threshold, or the candidate random signal sequence may be added to the target random signal sequence set when the correlations in the first correlation set that are smaller than the first preset correlation threshold are greater than a preset number or a preset ratio.
In some embodiments, the candidate random signal sequence is added to the set of target random signal sequences when the relationship between the candidate random signal sequence and each target random signal sequence satisfies equation (1). Wherein formula (1) is as follows:
Figure BDA0002378579580000051
where L represents the length of the candidate random signal sequence and the target random signal sequence, and may also be understood as the number of pixels, e.g., 20 pixels, n represents the number of target random signal sequences in the set of target random signal sequences, and f represents the number of target random signal sequences in the set of target random signal sequences(n)(x) Representing candidate random signal sequences, g(m)(xi) For the mth target random signal sequence with length L, PH represents the first preset correlation threshold, and may refer to an empirical value, for example, PH is preset to be 0.5, x represents a pixel, and x represents a pixeliDenotes the ith pixel, i ═ 1,2,3, …, L. S.t. in formula (1) is an abbreviation for subject to, meaning constrained, and can be understood as "such.
When the candidate random signal sequence is added to the target random signal sequence set, the candidate random signal sequence becomes the target random signal sequence in the target random signal sequence set, and thus the number of target random signal sequences in the target random signal sequence set is the largest. It is understood that, except for the first obtained target random signal sequence in the target random signal sequence set, steps S202 to S208 may be adopted to determine each target random signal sequence in the target random signal sequence set, so that the signals in the target random signal sequence set satisfy the weak correlation. For example, a random signal sequence may be generated as a first target random signal sequence, and when a second random signal sequence is generated, if the correlation between the second random signal sequence and the first target random signal sequence is lower than a first preset correlation threshold, the second random signal sequence is added to the target random signal sequence set. And when a third random signal sequence is generated, if the correlation degrees of the third random signal sequence, the first target random signal sequence and the second target random signal sequence are lower than a first preset correlation degree threshold value, adding the third random signal sequence into the target random signal sequence set.
And S210, generating a candidate gray-scale map according to the target random signal sequence set.
Specifically, the candidate grayscale images are grayscale images that need to be generated, and when the target random signal sequences in the target random signal sequence set reach a certain number, the target random signal sequences in the target random signal sequence set may be combined into the candidate grayscale images according to a certain order, for example, the candidate grayscale images may be combined according to the order obtained by each target random signal sequence, or the candidate grayscale images may be obtained by sorting according to the size of the pixel value corresponding to each target random signal sequence. And each target random signal sequence for generating the candidate gray-scale map is a signal sequence corresponding to one period in the candidate gray-scale map. Since weak correlation is satisfied between the target random signal sequences in the target random signal sequence set, the candidate gray scale map generated according to the target random signal sequence set satisfies local weak correlation, that is, weak correlation is satisfied between the signal sequence in one period and the signals in other periods in the candidate gray scale map.
S212, according to the projection of the candidate gray-scale image on the target object, a first target gray-scale image and a second target gray-scale image corresponding to the target object are obtained.
Specifically, the target object is an object that needs to be three-dimensionally reconstructed, and may be, for example, a table or a chair that needs to be three-dimensionally reconstructed. The candidate gray-scale image can be projected onto a target object through the projector, the projected target object is collected through the left camera to obtain a first target gray-scale image, and the projected target object is collected through the right camera to obtain a second target gray-scale image.
In some embodiments, the first target grayscale map may be obtained by performing at least one of grayscale correction or projection correction on the image acquired by the left camera, and the second target grayscale map may be obtained by performing at least one of grayscale correction or projection correction on the image acquired by the right camera.
S214, performing corresponding point positioning according to the first target gray scale image and the second target gray scale image to perform three-dimensional reconstruction on the target object.
In particular, a homonym point may be understood as a position in the first target grayscale image, an equivalent position in the second target grayscale image. For example, pixel position a1 in the first target grayscale image and pixel position a2 in the second target grayscale image are equivalent positions, and pixel position a1 and pixel position a2 may be referred to as a pair of homologous points, or pixel position a2 may be referred to as a homologous point of pixel position a 1.
In one embodiment, the N-step phase shift diagram may be projected onto a target object, a left phase shift diagram is acquired by a left camera, a left folding phase sequence corresponding to the left phase shift diagram is calculated as a phase sequence corresponding to a first target gray scale diagram, a right phase shift diagram is acquired by a right camera, and a right folding phase sequence corresponding to the right phase shift diagram is calculated as a phase sequence corresponding to a second target gray scale diagram. And performing correlation calculation through the first target gray level image and the second target gray level image, performing phase level matching on the left folding phase sequence and the right folding phase sequence to obtain folding phase pairs of the same level, performing sub-pixel interpolation on the target gray level image in the folding phase pairs of the same level to obtain homonymy points, and performing three-dimensional reconstruction on the target object according to the obtained homonymy points. The folded phase sequence may be divided into a plurality of sub-regions according to a period, and one sub-region corresponds to one phase order. The phase order matching is used to find a sub-region in the right folded phase sequence corresponding to a sub-region in the left folded phase sequence.
In the above random gray-scale image generation method based on digital projection, a candidate random signal sequence is obtained, a target random signal sequence set is obtained, a target correlation degree between the candidate random signal sequence and each target random signal sequence is obtained, a first correlation degree set corresponding to the candidate random signal sequence is obtained, when the correlation degree in the first correlation degree set is smaller than a first preset correlation degree threshold value, the candidate random signal sequence is added into the target random signal sequence set, a candidate gray-scale image is generated according to the target random signal sequence set, a first target gray-scale image and a second target gray-scale image corresponding to a target object are obtained according to the projection of the candidate gray-scale image on the target object, a homonymy point is positioned according to the first target gray-scale image and the second target gray-scale image to perform three-dimensional reconstruction on the target object, because the candidate gray-scale image is generated according to the target random signal sequence, and the correlation degree between the target random signal sequences is less than a first preset correlation degree threshold, so that the influence of the local correlation of the candidate gray-scale image on the gray-scale correlation search can be reduced, the reliability of the candidate gray-scale image is improved, and the accuracy of the gray-scale correlation search is improved.
In some embodiments, as shown in fig. 3A, the step S206 of obtaining the target correlation between the candidate random signal sequence and each target random signal sequence to obtain the first correlation set corresponding to the candidate random signal sequence includes:
and S302, filtering the candidate random signal sequence to obtain a filtered candidate random signal sequence.
Specifically, the candidate random signal sequence may be filtered by a filter function, so as to obtain a filtered candidate random signal sequence. For example, the candidate random signal sequence after filtering may be obtained by convolving the candidate random signal sequence with a filter Function, for example, a gaussian kernel Function (RBF), whose formula may be expressed as
Figure BDA0002378579580000081
The parameters a, b, and c are empirical values, and may be, for example, a ═ 0.2, b ═ 0, and c ═ 1.25. The gaussian kernel function can simulate the low-pass filtering property of an optical system (such as a camera), so that the similarity between the filtered candidate random signal sequence and the actual gray signal sequence acquired by the optical system (such as the camera) is high.
S304, obtaining a filtered target random signal sequence, wherein the filtered target random signal sequence is obtained by filtering the target random signal sequence.
Specifically, the target random signal sequence may be filtered by a filter function, so as to obtain a filtered target random signal sequence. The specific filtering processing manner may refer to the relevant description corresponding to step S302.
S306, respectively calculating the correlation degree between the filtered candidate random signal sequence and each filtered target random signal sequence to serve as the target correlation degree between the candidate random signal sequence and each target random signal sequence, and obtaining a first correlation degree set corresponding to the candidate random signal sequence according to each target correlation degree.
Specifically, the method of calculating the correlation between the candidate random signal sequence after filtering and the target random signal sequence after filtering may be the same as the method of calculating the correlation between the candidate random signal sequence and the target random signal sequence.
In the embodiment of the application, the low-pass filtering characteristic of the optical system is fully considered, the correlation calculation is performed on the filtered candidate random signal sequence and the filtered target random signal sequence to obtain the first correlation set, and whether the candidate random signal sequence is added into the target random signal sequence set is judged according to the first correlation set, so that the weak correlation between the target random signal sequences in the target random signal sequence set is improved, and the local weak correlation of the generated candidate gray-scale map is improved.
For example, as shown in fig. 3B, the diagram illustrates filtering the candidate random signal sequence by a gaussian kernel function. The first graph in fig. 3b (a) is a candidate random signal sequence, and it can be seen that the length of the candidate random signal sequence is 20 pixels, the second graph in fig. 3b (a) is a gaussian kernel function, the curve identified by the convention in the third graph in fig. 3b (a) is a filtered candidate random signal sequence obtained by convolving the candidate random signal sequence with the gaussian kernel function, and the curve identified by the Actual in the third graph in fig. 3b (a) is a gray signal sequence projected onto the surface of the whiteboard by the projector and actually acquired by the camera. It can be seen that the filtered candidate random signal sequence is substantially consistent with the gray signal sequence actually acquired by the camera.
In fig. 3b (b), After convergence identifies a 3-cycle filtered target random signal sequence, and The binary specific signal identifies a corresponding 3-cycle target random signal sequence, that is, a 3-cycle gray signal sequence corresponding to The candidate gray map. When the correlation value between the candidate filtered random signal sequence in the third graph of fig. 3b (a) and each target filtered random signal sequence in fig. 3b (b) is lower than the first preset correlation threshold, adding the candidate random signal sequence to the target random signal sequence set as the gray signal sequence of the 4 th period of the candidate gray graph. In the same manner, the gray signal sequences of each period in the candidate gray map can be sequentially obtained. Fig. 3C shows a specific candidate gray scale map obtained by the method of the present application.
In some embodiments, as shown in fig. 4, the step S306 of calculating the correlation between the filtered candidate random signal sequence and each of the filtered target random signal sequences respectively includes:
s402, calculating a signal mean value corresponding to the filtered candidate random signal sequence as a first signal mean value.
Specifically, the first signal mean value may be an average value of gray values corresponding to respective pixels in the filtered candidate random signal sequence.
S404, calculating a signal mean value corresponding to each filtered target random signal sequence as a second signal mean value.
Specifically, the second signal mean value may be an average value of gray values corresponding to respective pixels in the filtered target random signal sequence.
S406, calculating the difference between each signal in the filtered candidate random signal sequence and the first signal mean value to obtain a first difference, and calculating the difference between each signal in the filtered target random signal sequence and the corresponding second signal mean value to obtain a second difference.
Specifically, each signal in the filtered candidate random signal sequence may be a gray scale value corresponding to each pixel, and each signal in the filtered target random signal sequence may be a gray scale value corresponding to each pixel. The difference between the gray value corresponding to each pixel in the filtered candidate random signal sequence and the first signal mean value may be calculated to obtain a first difference. The difference between the gray value corresponding to each pixel in the filtered target random signal sequence and the second signal mean value can be calculated to obtain a second difference.
And S408, calculating the correlation according to the first differences and the second differences to obtain the correlation between the filtered candidate random signal sequence and the filtered target random signal sequence.
Specifically, since the candidate random signal sequence and the target random signal sequence have the same length, the filtered candidate random signal sequence and the filtered target random signal sequence have the same length, and therefore the number of first differences corresponding to the filtered candidate random signal sequence is the same as the number of second differences corresponding to the filtered target random signal sequence, and therefore, the products of the first differences and the second differences obtained by each corresponding pixel may be calculated, and the sum of the products is used as the correlation between the filtered candidate random signal sequence and the filtered target random signal sequence. For example, assuming that the filtered candidate random signal sequence is [20,30,40], the filtered target random signal sequence is [100,60,70], [20,30,40] obtains a first mean value of (20+30+40)/3, the [100,60,70] obtains a second mean value of (100+60+70)/3, the first differences include 20- (20+30+40)/3, 30- (20+30+40)/3 and 40- (20+30+40)/3, the second differences include 100- (100+60+70)/3, 60- (100+60+70)/3 and 70- (100+60+70)/3, and the correlation between the filtered candidate random signal sequence and the filtered target random signal sequence is [20- (20+30+40)/3] × [100- (100+60+70)/3] + [30- (20+30 ]/[ 3] 40) [60- (100+60+70)/3] + [40- (20+30+40)/3] × [70- (100+60+70)/3 ].
It should be noted that the correlation between signal sequences may also be calculated in other manners, and the method for calculating the correlation is not limited in the present application.
In some embodiments, as shown in fig. 5, the step S214 of performing the same-name point positioning according to the first target gray scale map and the second target gray scale map to perform the three-dimensional reconstruction of the target object includes:
s502, a first sub-phase sequence corresponding to the first phase shift diagram and a second sub-phase sequence corresponding to the second phase shift diagram are obtained, where the first sub-phase sequence is obtained by dividing the first phase sequence corresponding to the first phase shift diagram according to a phase period, the second sub-phase sequence is obtained by dividing the second phase sequence corresponding to the second phase shift diagram according to a phase period, the first phase shift diagram corresponds to the first target gray scale diagram, and the second phase shift diagram corresponds to the second target gray scale diagram.
Specifically, the phase shift diagram can be an N (N ≧ 3) step phase shift diagram. And projecting the sinusoidal fringe pattern onto a target object, and acquiring the target object to obtain a phase shift pattern. The first phase shift graph and the first target gray scale graph correspond to each other, namely the first phase shift graph and the first target gray scale graph are obtained according to images acquired by the same camera at the same angle, the second phase shift graph and the second target gray scale graph correspond to each other, namely the first phase shift graph and the first target gray scale graph are obtained according to images acquired by the same camera at the same angle, for example, a sine stripe graph is projected onto a target object, the left camera is used for acquiring the target object to obtain the first phase shift graph, the right camera is used for acquiring the target object to obtain the second phase shift graph, a gray scale graph generated by a computer is projected onto the target object, the left camera is used for acquiring the target object to obtain the first target gray scale graph, and the right camera is used for acquiring the target object to obtain the second target gray scale graph.
In some embodiments, the first phase sequence may be a sequence of folded phase compositions calculated from the first phase map and the second phase sequence may be a sequence of folded phase compositions calculated from the second phase map. The first sub-phase sequence may be a one-period phase sequence obtained by dividing the first phase sequence based on the periodicity of the folded phase, and may include a plurality of phases, or may be obtained by interpolating the one-period phase sequence obtained by dividing, for example, a plurality of phases at fixed phase intervals, and a sequence of these phases is used as the first sub-phase sequence. The second sub-phase sequence may be a one-period phase sequence obtained by dividing the second phase sequence based on the periodicity of the folded phase, and may include a plurality of phases, or may be obtained by interpolating the one-period phase sequence obtained by dividing, for example, a plurality of phases at fixed phase intervals, and a sequence of these phases is used as the first sub-phase sequence. Wherein the period of the folded phase may be 2 pi, and the range of the folded phase may be [ -pi, pi ].
In some embodiments, the first phase sequence and the second phase sequence are projection corrected from the folded phase map. For example, the terminal may obtain an N-step phase shift map acquired by the left camera, calculate a folded phase by an N-step phase shift method, further obtain the folded phase map, perform projection correction on the folded phase map, obtain a projection-corrected folded phase map, and obtain the first phase sequence according to the projection-corrected folded phase map. The terminal can obtain an N-step phase shift diagram collected by the right camera, a folding phase is calculated through an N-step phase shift method, a folding phase diagram is further obtained, projection correction is carried out on the folding phase diagram, a folding phase diagram after projection correction is obtained, and a second phase sequence is obtained according to the folding phase diagram after projection correction.
In some embodiments, when the first target gray scale map, the second target gray scale map, the first phase sequence, and the second phase sequence are obtained by projection correction, phase level matching may be performed along the same line of the first target gray scale map and the second target gray scale map.
S504, a first interpolation phase sequence corresponding to the first sub-phase sequence is obtained, and a second interpolation phase sequence corresponding to the second sub-phase sequence is obtained, where the first interpolation phase sequence and the first interpolation phase sequence are obtained by sampling a phase period.
Specifically, the first interpolation phase sequence and the first interpolation phase sequence may be obtained by sampling one folding phase period at fixed phase intervals.
In some embodiments, a preset phase interval may be obtained, sampling is performed in a folded phase period corresponding to the first sub-phase sequence according to the preset phase interval to obtain a first interpolated phase sequence corresponding to the first sub-phase sequence, and sampling is performed in a folded phase period corresponding to the second sub-phase sequence according to the preset phase interval to obtain a second interpolated phase sequence corresponding to the second sub-phase sequence. The preset phase interval may be a phase interval preset as needed. Since the folded phase period is fixed, the preset phase interval is also fixed, and thus each first interpolation phase sequence is the same, each second interpolation phase sequence is the same, and the first interpolation phase sequence and the second interpolation phase sequence are also the same.
S506, according to the pixel corresponding to each phase in the first sub-phase sequence, determining the pixel corresponding to each phase in the corresponding first interpolation phase sequence to form a first sampling point sequence corresponding to the first sub-phase sequence, and according to the pixel corresponding to each phase in the second sub-phase sequence, determining the pixel corresponding to each phase in the corresponding second interpolation phase sequence to form a second sampling point sequence corresponding to the second sub-phase sequence.
Specifically, the first sequence of sampling points refers to a sequence corresponding to the first interpolated phase sequence, and also to the first sub-phase sequence. The phases in the first sub-phase sequence have a one-to-one correspondence with the pixels, i.e. one phase in the first sub-phase sequence corresponds to one pixel. The relationship between the pixel corresponding to the phase in the first interpolated phase sequence and the pixel corresponding to the phase in the corresponding first sub-phase sequence may be obtained according to the relationship between the phase in the first interpolated phase sequence and the phase in the corresponding first sub-phase sequence, so as to obtain the pixel corresponding to the phase in the first interpolated phase sequence. The phase in the first interpolated phase sequence and the phase in the second interpolated phase sequence may correspond to a sub-pixel. For example, if the phase a in the first interpolation phase sequence corresponds to a sub-pixel, the pixel corresponding to the phase a may be calculated from the pixel corresponding to the phase B larger than the phase a and the pixel corresponding to the phase C smaller than the phase a in the first sub-phase sequence. The obtaining method of the pixel corresponding to each phase in the second interpolation phase sequence may refer to the similar method described above, and is not described herein again.
S508, according to a preset interpolation algorithm, determining first gray values corresponding to the first sampling points in the first sampling point sequence in the first target gray map respectively, forming first gray value sequences corresponding to the first sampling point sequence, combining the first gray value sequences to obtain a first gray value sequence set, according to the preset interpolation algorithm, determining second gray values corresponding to the second sampling points in the second sampling point sequence in the second target gray map respectively, forming second gray value sequences corresponding to the second sampling point sequences, and combining the second gray value sequences to obtain a second gray value sequence set.
Specifically, the preset interpolation algorithm may be an interpolation algorithm set according to specific situations, for example, cubic spline interpolation, and may also be a custom interpolation algorithm. The first sampling point sequence corresponds to the first gray value sequence one by one.
And S510, performing correlation calculation according to the first gray value sequence set and the second gray value sequence set, and determining second sub-phase sequences corresponding to the first sub-phase sequences respectively.
Specifically, the correlation between each first gray value sequence in the first gray value sequence set and each second gray value sequence in the second gray value sequence set may be calculated, and the obtained correlation may be analyzed to determine the second sub-phase sequence corresponding to the first sub-phase sequence.
In some embodiments, the first sub-phase sequence may or may not have a corresponding second sub-phase sequence.
S512, interpolating the corresponding second sub-phase sequence according to the first sub-phase sequences to obtain corresponding homonymy points of the phases in the first sub-phase sequences, and performing three-dimensional reconstruction on the target object according to the corresponding homonymy points.
In particular, three-dimensional reconstruction is used to build mathematical models for three-dimensional objects that are suitable for computer representation and processing. For example, mathematical models are built for shoes, stools, tables, or the like. A homonym point is to be understood as a pixel position in the first target gray scale image, an equivalent pixel position in the second target gray scale image. For example, pixel position a1 in the first target grayscale image and pixel position a2 in the second target grayscale image are equivalent positions, and pixel position a1 and pixel position a2 may be referred to as a pair of homologous points, or pixel position a2 may be referred to as a homologous point of pixel position a 1.
In some embodiments, the pixels corresponding to the respective phases in the target first sub-phase sequence may be obtained as the first target pixel. And interpolating to obtain pixels at the same phase position as the pixels in the first sub-phase sequence according to the pixels corresponding to each phase in the corresponding target second sub-phase sequence, thus obtaining second target pixels corresponding to each first target pixel respectively, and taking the second target pixels as the homonymous points of the first target pixels.
In the three-dimensional reconstruction method of the composite coding, a first sub-phase sequence corresponding to a first phase shift diagram and a second sub-phase sequence corresponding to a second phase shift diagram are obtained, wherein the first sub-phase sequence is obtained by dividing a first phase sequence corresponding to the first phase shift diagram according to a phase period, the second sub-phase sequence is obtained by dividing a second phase sequence corresponding to the second phase shift diagram according to the phase period, the first phase shift diagram corresponds to a first target gray scale diagram, the second phase shift diagram corresponds to a second target gray scale diagram, a first interpolated phase sequence corresponding to the first sub-phase sequence is obtained, a second interpolated phase sequence corresponding to the second sub-phase sequence is obtained, the first interpolated phase sequence and the first interpolated phase sequence are obtained by sampling the phase period, and pixels corresponding to each phase in the first sub-phase sequence are obtained respectively, determining pixels corresponding to each phase in the corresponding first interpolation phase sequence respectively, forming a first sampling point sequence corresponding to the first sub-phase sequence, determining pixels corresponding to each phase in the corresponding second interpolation phase sequence respectively according to the pixels corresponding to each phase in the second sub-phase sequence, forming a second sampling point sequence corresponding to the second sub-phase sequence, determining first gray values corresponding to each first sampling point in the first sampling point sequence respectively in the first target gray scale map according to a preset interpolation algorithm, forming a first gray value sequence corresponding to the first sampling point sequence, combining the first gray value sequences to obtain a first gray value sequence set, determining second gray values corresponding to each second sampling point in the second sampling point sequence respectively in the second target gray scale map according to the preset interpolation algorithm, forming a second gray value sequence corresponding to the second sampling point sequence, and combining the second gray value sequence to obtain a second gray value sequence set, performing correlation calculation according to the first gray value sequence set and the second gray value sequence set, determining second sub-phase sequences corresponding to the first sub-phase sequences respectively, interpolating the corresponding second sub-phase sequences according to the first sub-phase sequences to obtain corresponding homonyms corresponding to the phases in the first sub-phase sequences respectively, and performing three-dimensional reconstruction on the target object according to the corresponding homonyms. Therefore, the second sub-phase sequence corresponding to the first sub-phase sequence is determined through the second gray value sequence corresponding to the first gray value sequence, the level matching of folding phases assisted by a gray-related algorithm is realized, the same-name point positioning is carried out by utilizing a gray-map assisted phase shift map, and the phase unfolding is not required to be carried out by using a plurality of images, so that the three-dimensional reconstruction efficiency is improved. Moreover, the candidate gray-scale images are generated according to the target random signal sequence, and the correlation degree between the target random signal sequences is smaller than the first preset correlation degree threshold, so that the influence of the local correlation of the candidate gray-scale images on the gray-scale correlation search can be reduced, the reliability of the candidate gray-scale images is improved, and the accuracy of the gray-scale correlation search is improved.
In some embodiments, as shown in fig. 6, the step S502 of obtaining a first sub-phase sequence corresponding to the first phase shift diagram and a second sub-phase sequence corresponding to the second phase shift diagram includes:
s602, obtain a folded phase sequence corresponding to the first phase shift diagram as the first phase sequence, and obtain a folded phase sequence corresponding to the second phase shift diagram as the second phase sequence.
S604, the first phase sequence is divided according to the phase period of the folded phase to obtain a plurality of first sub-phase sequences corresponding to the first phase shift diagram.
S606, the second phase sequence is divided according to the phase cycle of the folded phase to obtain a plurality of second sub-phase sequences corresponding to the second phase shift diagram.
Specifically, the folded phase sequence is a sequence composed of folded phases. The folding phase corresponding to the first phase shift diagram and the folding phase corresponding to the second phase shift diagram can be calculated by using an N-step phase shift method. Due to the periodic characteristic of the folded phase, the first phase sequence may be divided into regions according to the phase jump in the first phase sequence (e.g., the phase jumps from pi to-pi), the position of the phase jump is used as a boundary, and the first phase sequence is divided into a plurality of sub-regions, where each sub-region corresponds to one first divided sub-phase sequence.
In some embodiments, the first divided sub-phase sequence may be used as the first sub-phase sequence, or may be calculated according to the first divided sub-phase sequence to obtain the first sub-phase sequence. For example, the first divided sub-phase sequence may be interpolated to obtain the first sub-phase sequence. The manner in which the second sub-phase sequence is derived may be referred to in relation to the description corresponding to the manner in which the first sub-phase sequence is derived.
In some embodiments, as shown in fig. 7, the step S510 of performing a correlation calculation according to the first gray scale value sequence set and the second gray scale value sequence set to determine a second sub-phase sequence corresponding to each of the first sub-phase sequences includes:
s702, selecting a target first gray value sequence from the first gray value sequence set.
Specifically, when the target first gray value sequence is selected for the first time, any one first gray value sequence may be selected from the first gray value sequence set as the target first gray value sequence. When the target first gray value sequence is selected for the second time, a first gray value sequence which is not selected as the target first gray value sequence may be selected from the first gray value sequence set as the target first gray value sequence.
S704, respectively calculating the correlation between the target first gray value sequence and each second gray value sequence in the second gray value sequence set to obtain a second correlation set corresponding to the target first gray value sequence.
Specifically, the correlation degree between the target first gray value sequence and the second gray value sequence represents the similarity between the target first gray value sequence and the second gray value sequence, and the greater the correlation degree is, the greater the similarity between the target first gray value sequence and the second gray value sequence is, and the smaller the correlation degree is, the less the similarity between the target first gray value sequence and the second gray value sequence is. The second correlation set is a set composed of correlations respectively obtained by the target first gray value sequence and each second gray value sequence.
In some embodiments, the correlation of the target first gray value sequence with a second gray value sequence of the second set of gray value sequences may be calculated by a correlation function. The Correlation function may be, for example, ZNCC (Zero mean normalized Cross Correlation).
S706, obtaining the maximum correlation degree in the second correlation degree set.
In particular, the maximum correlation refers to the maximum correlation in the second set of correlations.
And S708, when the maximum correlation is greater than a second preset correlation threshold, taking a second gray value sequence corresponding to the maximum correlation as a target second gray value sequence corresponding to the target first gray value sequence.
Specifically, the second preset correlation threshold is a preset correlation, and the second preset correlation threshold may be determined according to an empirical value, and may be 0.9, for example. The target second gray value sequence refers to a second gray value sequence corresponding to the target first gray value sequence. When the maximum correlation degree is greater than or equal to the second preset correlation degree threshold, it is indicated that the similarity between the second gray value sequence corresponding to the maximum correlation degree and the target first gray value sequence is very high, and therefore, the second gray value sequence corresponding to the maximum correlation degree can be used as the target second gray value sequence corresponding to the target first gray value sequence. When the maximum correlation degree is smaller than a second preset correlation degree threshold, it is indicated that the similarity between the second gray value sequence corresponding to the maximum correlation degree and the target first gray value sequence is not high, and it can be considered that the target first gray value sequence does not find the corresponding second gray value sequence.
In some embodiments, a second gray value sequence which may be a target second gray value sequence may be obtained by screening in the second gray value sequence set, and is used as a candidate target second gray value sequence, the correlation between the target first gray value sequence and each candidate target second gray value sequence is respectively calculated to obtain a maximum correlation, and whether the maximum correlation is greater than a second preset correlation threshold is determined, if so, the candidate target second gray value sequence with the maximum correlation is used as the target second gray value sequence corresponding to the target first gray value sequence.
S710, obtain a target first sub-phase sequence corresponding to the target first gray scale value sequence, obtain a target second sub-phase sequence corresponding to the target second gray scale value sequence, and use the target second sub-phase sequence as a second sub-phase sequence corresponding to the target first sub-phase sequence.
In particular, the target second sub-phase sequence corresponds to the target first sub-phase sequence, which may be referred to as a folded phase pair of the same order. For example, if the second gray scale value sequence corresponding to the first gray scale value sequence S1 is S2, the first sub-phase sequence corresponding to the first gray scale value sequence is W1, and the second sub-phase sequence corresponding to the second gray scale value sequence is W2, W1 and W2 are called folding phase pairs of the same order.
In the embodiment of the present application, by calculating the correlation between the first gray value sequence and the second gray value sequence, the second gray value sequence corresponding to the first gray value sequence can be quickly determined, so that the second sub-phase sequence corresponding to the first sub-phase sequence is determined, and thus, the phase sequence of the level matching is quickly obtained, and the efficiency of three-dimensional reconstruction is improved. And comparing the maximum correlation with a second preset correlation threshold, when the maximum correlation is greater than the second preset correlation threshold, taking the second gray value sequence corresponding to the maximum correlation as a target second gray value sequence corresponding to the target first gray value sequence instead of directly taking the second gray value sequence corresponding to the maximum correlation as the target second gray value sequence corresponding to the target first gray value sequence, so as to avoid finding an incorrect target second gray value sequence under the condition that the target second gray value sequence does not have a corresponding second gray value sequence.
In some embodiments, as shown in fig. 8, interpolating the corresponding second sub-phase sequence according to each first sub-phase sequence in step S512 to obtain corresponding homonymy points of each phase in each first sub-phase sequence includes:
s802, obtaining the pixel corresponding to each phase in the target first sub-phase sequence as a first target pixel.
Specifically, each phase in the target first sub-phase sequence has a correspondence relationship with a pixel, and one phase corresponds to one pixel.
S804, according to the corresponding pixel corresponding to each phase in the corresponding target second sub-phase sequence, a second target pixel corresponding to each first target pixel is obtained through interpolation, and the second target pixel is used as the homonymy point of the first target pixel.
In particular, the respective phases in the target first sub-phase sequence and the respective phases in the target second sub-phase sequence may not be identical, i.e. the phases present in the target first sub-phase sequence may not be present in the target second sub-phase sequence, whereas the phases present in the target second sub-phase sequence may not be present in the target first sub-phase sequence. Thus, the homonym point can be obtained by sub-pixel interpolation. For example, phase1 exists in the target first sub-phase-sequence but does not exist in the target second sub-phase-sequence, but has phase2 smaller than phase1 and phase3 larger than phase1 in the target second sub-phase-sequence, and a pixel corresponding to phase1 in the target second sub-phase-sequence can be interpolated from a corresponding pixel of phase2 and a corresponding pixel of phase3, as a second target pixel corresponding to a first target pixel of phase1 in the target first sub-phase-sequence, and the second target pixel is taken as a corresponding point of the first target pixel.
In the embodiment of the present application, since the folding phase in the period is monotonically increasing, that is, the phase in the sub-phase sequence is monotonically increasing, and there is no ambiguity, in the folding phase of the rank matching, that is, in the target second sub-phase sequence corresponding to the target first sub-phase sequence, sub-pixel interpolation is performed on the first target grayscale image and the second target grayscale image, so that high-precision location of the same-name point can be achieved.
It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts of the above embodiments may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or the stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least a part of the sub-steps or the stages of other steps.
In some embodiments, as shown in fig. 9, there is provided a random gray scale map generation apparatus based on digital projection, including: a candidate random signal sequence acquisition module 902, a target random signal sequence set acquisition module 904, a first correlation set acquisition module 906, a candidate random signal sequence adding module 908, a candidate gray-scale map generation module 910, a target gray-scale map acquisition module 912, and a homologous point positioning module 914, wherein:
a candidate random signal sequence obtaining module 902, configured to obtain a candidate random signal sequence.
A target random signal sequence set obtaining module 904, configured to obtain a target random signal sequence set, where in the target random signal sequence set, a correlation degree between target random signal sequences is smaller than a first preset correlation degree threshold.
A first correlation set obtaining module 906, configured to obtain target correlations between the candidate random signal sequences and each target random signal sequence, and obtain a second correlation set corresponding to the candidate random signal sequence.
A candidate random signal sequence adding module 908, configured to add the candidate random signal sequence to the target random signal sequence set when the correlation degree in the second correlation degree set is smaller than the first preset correlation degree threshold.
And a candidate gray-scale map generation module 910, configured to generate a candidate gray-scale map according to the target random signal sequence set.
A target grayscale map obtaining module 912, configured to obtain a first target grayscale map and a second target grayscale map corresponding to the target object according to the projection of the candidate grayscale map on the target object.
And the homonymy point positioning module 914 is configured to perform homonymy point positioning according to the first target grayscale map and the second target grayscale map, so as to perform three-dimensional reconstruction on the target object.
In some embodiments, the first set of correlations derivation module 906 includes:
and the filtered candidate random signal sequence obtaining unit is used for filtering the candidate random signal sequence to obtain a filtered candidate random signal sequence.
And the filtered target random signal sequence acquisition unit is used for acquiring a filtered target random signal sequence, and the filtered target random signal sequence is obtained by filtering the target random signal sequence.
And the first correlation set obtaining unit is used for respectively calculating the correlation between the filtered candidate random signal sequence and each filtered target random signal sequence, taking the correlation as the target correlation between the candidate random signal sequence and each target random signal sequence, and obtaining a first correlation set corresponding to the candidate random signal sequence according to each target correlation.
In some embodiments, the first correlation set obtaining unit is further configured to calculate a signal mean value corresponding to the filtered candidate random signal sequence, as the first signal mean value; calculating a signal mean value corresponding to each filtered target random signal sequence to serve as a second signal mean value; calculating the difference between each signal in the filtered candidate random signal sequence and the mean value of the first signal to obtain a first difference, and calculating the difference between each signal in the filtered target random signal sequence and the mean value of the corresponding second signal to obtain a second difference; and calculating the correlation according to the first difference and each second difference to obtain the correlation between the filtered candidate random signal sequence and the filtered target random signal sequence.
In some embodiments, the homologous point locating module 914 comprises:
the phase sequence acquisition unit is used for acquiring a first sub-phase sequence corresponding to the first phase shift diagram and a second sub-phase sequence corresponding to the second phase shift diagram, wherein the first sub-phase sequence is obtained by dividing the first phase sequence corresponding to the first phase shift diagram according to the phase period, the second sub-phase sequence is obtained by dividing the second phase sequence corresponding to the second phase shift diagram according to the phase period, the first phase shift diagram corresponds to the first target gray scale diagram, and the second phase shift diagram corresponds to the second target gray scale diagram.
And the interpolation phase sequence acquisition unit is used for acquiring a first interpolation phase sequence corresponding to the first sub-phase sequence and acquiring a second interpolation phase sequence corresponding to the second sub-phase sequence, wherein the first interpolation phase sequence and the first interpolation phase sequence are obtained by sampling the phase period.
And the sampling point sequence forming unit is used for determining the pixels corresponding to all the phases in the corresponding first interpolation phase sequence according to the pixels corresponding to all the phases in the first sub-phase sequence, forming a first sampling point sequence corresponding to the first sub-phase sequence, determining the pixels corresponding to all the phases in the corresponding second interpolation phase sequence according to the pixels corresponding to all the phases in the second sub-phase sequence, and forming a second sampling point sequence corresponding to the second sub-phase sequence.
The gray value sequence set obtaining unit is used for determining a first gray value corresponding to each first sampling point in the first sampling point sequence in the first target gray level image according to a preset interpolation algorithm, forming a first gray value sequence corresponding to the first sampling point sequence, combining the first gray value sequences to obtain a first gray value sequence set, determining a second gray value corresponding to each second sampling point in the second sampling point sequence in the second target gray level image according to the preset interpolation algorithm, forming a second gray value sequence corresponding to the second sampling point sequence, and combining the second gray value sequences to obtain a second gray value sequence set.
And the sub-phase sequence determining unit is used for performing correlation calculation according to the first gray value sequence set and the second gray value sequence set to determine second sub-phase sequences corresponding to the first sub-phase sequences respectively.
And the three-dimensional reconstruction unit is used for interpolating the corresponding second sub-phase sequence according to each first sub-phase sequence to obtain corresponding homonymy points of each phase in each first sub-phase sequence, and performing three-dimensional reconstruction on the target object according to each homonymy point.
In some embodiments, the sub-phase sequence obtaining unit is further configured to obtain a folded phase sequence corresponding to the first phase shift diagram as the first phase sequence, and obtain a folded phase sequence corresponding to the second phase shift diagram as the second phase sequence; dividing the first phase sequence according to the phase period of the folded phase to obtain a plurality of first sub-phase sequences corresponding to the first phase shift diagram; and dividing the second phase sequence according to the phase period of the folded phase to obtain a plurality of second sub-phase sequences corresponding to the second phase shift diagram.
In some embodiments, the sub-phase sequence determining unit is further configured to select a target first gray value sequence from the first gray value sequence set; respectively calculating the correlation between the target first gray value sequence and each second gray value sequence in the second gray value sequence set to obtain a second correlation set corresponding to the target first gray value sequence; acquiring the maximum correlation degree in the second correlation degree set; when the maximum correlation degree is larger than a second preset correlation degree threshold value, taking a second gray value sequence corresponding to the maximum correlation degree as a target second gray value sequence corresponding to the target first gray value sequence; and acquiring a target first sub phase sequence corresponding to the target first gray scale value sequence, acquiring a target second sub phase sequence corresponding to the target second gray scale value sequence, and taking the target second sub phase sequence as a second sub phase sequence corresponding to the target first sub phase sequence.
In some embodiments, the three-dimensional reconstruction unit is further configured to obtain, as the first target pixel, a pixel corresponding to each phase in the target first sub-phase sequence; and interpolating to obtain second target pixels corresponding to the first target pixels according to the pixels corresponding to the phases in the corresponding target second sub-phase sequence, and taking the second target pixels as the homonymous points of the first target pixels.
For specific definition of the random gray scale map generation device based on digital projection, reference may be made to the above definition of the random gray scale map generation method based on digital projection, and details are not repeated here. The modules in the digital projection-based random gray scale image generation device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method for random gray scale map generation based on digital projection. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In some embodiments, a computer device is provided, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above-described digital projection-based random gray scale map generation method when executing the computer program.
In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the above-mentioned digital projection-based random gray scale map generation method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for random grayscale map generation based on digital projection, the method comprising:
acquiring a candidate random signal sequence;
acquiring a target random signal sequence set, wherein the correlation degree between target random signal sequences in the target random signal sequence set is smaller than a first preset correlation degree threshold value;
obtaining target correlation degrees between the candidate random signal sequences and each target random signal sequence to obtain a first correlation degree set corresponding to the candidate random signal sequences;
when the correlation degree in the first correlation degree set is smaller than a first preset correlation degree threshold value, adding the candidate random signal sequence into the target random signal sequence set;
generating a candidate gray-scale map according to the target random signal sequence set;
obtaining a first target gray-scale image and a second target gray-scale image corresponding to the target object according to the projection of the candidate gray-scale image on the target object;
and performing corresponding point positioning according to the first target gray-scale image and the second target gray-scale image so as to perform three-dimensional reconstruction on the target object.
2. The method according to claim 1, wherein the obtaining a target correlation degree between the candidate random signal sequence and each of the target random signal sequences to obtain a first correlation degree set corresponding to the candidate random signal sequence comprises:
filtering the candidate random signal sequence to obtain a filtered candidate random signal sequence;
obtaining a filtered target random signal sequence, wherein the filtered target random signal sequence is obtained by filtering the target random signal sequence;
and respectively calculating the correlation between the candidate random signal sequence after being filtered and each target random signal sequence after being filtered, wherein the correlation is used as the target correlation between the candidate random signal sequence and each target random signal sequence, and a first correlation set corresponding to the candidate random signal sequence is obtained according to each target correlation.
3. The method of claim 2, wherein said separately calculating the correlation between the filtered candidate random signal sequences and each of the filtered target random signal sequences comprises:
calculating a signal mean value corresponding to the filtered candidate random signal sequence to serve as a first signal mean value;
calculating a signal mean value corresponding to each filtered target random signal sequence to serve as a second signal mean value;
calculating the difference between each signal in the filtered candidate random signal sequence and the mean value of the first signal to obtain a first difference, and calculating the difference between each signal in the filtered target random signal sequence and the mean value of the corresponding second signal to obtain a second difference;
and calculating the correlation according to the first difference and each second difference to obtain the correlation between the filtered candidate random signal sequence and the filtered target random signal sequence.
4. The method of claim 1, wherein the homonymous localization from the first target grayscale map and the second target grayscale map to reconstruct the target object in three dimensions comprises:
obtaining a first sub-phase sequence corresponding to a first phase shift diagram and a second sub-phase sequence corresponding to a second phase shift diagram, wherein the first sub-phase sequence is obtained by dividing the first phase sequence corresponding to the first phase shift diagram according to a phase period, the second sub-phase sequence is obtained by dividing the second phase sequence corresponding to the second phase shift diagram according to the phase period, the first phase shift diagram corresponds to the first target gray scale diagram, and the second phase shift diagram corresponds to the second target gray scale diagram;
acquiring a first interpolation phase sequence corresponding to the first sub-phase sequence, and acquiring a second interpolation phase sequence corresponding to the second sub-phase sequence, wherein the first interpolation phase sequence and the first interpolation phase sequence are obtained by sampling a phase cycle;
determining pixels corresponding to all phases in the corresponding first interpolation phase sequence according to pixels corresponding to all phases in the first sub-phase sequence, forming a first sampling point sequence corresponding to the first sub-phase sequence, determining pixels corresponding to all phases in the corresponding second interpolation phase sequence according to pixels corresponding to all phases in the second sub-phase sequence, and forming a second sampling point sequence corresponding to the second sub-phase sequence;
according to a preset interpolation algorithm, determining a first gray value corresponding to each first sampling point in the first sampling point sequence in the first target gray map respectively, forming a first gray value sequence corresponding to the first sampling point sequence, combining the first gray value sequences to obtain a first gray value sequence set, according to the preset interpolation algorithm, determining a second gray value corresponding to each second sampling point in the second sampling point sequence in the second target gray map respectively, forming a second gray value sequence corresponding to the second sampling point sequence, and combining the second gray value sequences to obtain a second gray value sequence set;
performing correlation calculation according to the first gray value sequence set and the second gray value sequence set, and determining the second sub-phase sequences corresponding to the first sub-phase sequences respectively;
and interpolating the corresponding second sub-phase sequence according to the first sub-phase sequences to obtain corresponding homonymy points of the phases in the first sub-phase sequences, and performing three-dimensional reconstruction on the target object according to the corresponding homonymy points.
5. The method of claim 4, wherein obtaining a first sub-phase sequence corresponding to the first phase shift map and a second sub-phase sequence corresponding to the second phase shift map comprises:
acquiring a folded phase sequence corresponding to the first phase shift diagram as the first phase sequence, and acquiring a folded phase sequence corresponding to the second phase shift diagram as the second phase sequence;
dividing the first phase sequence according to the phase period of the folded phase to obtain a plurality of first sub-phase sequences corresponding to the first phase shift diagram;
and dividing the second phase sequence according to the phase period of the folded phase to obtain a plurality of second sub-phase sequences corresponding to the second phase shift diagram.
6. The method according to claim 4, wherein the performing a correlation calculation according to the first gray scale value sequence set and the second gray scale value sequence set to determine the second sub-phase sequence corresponding to each of the first sub-phase sequences comprises:
selecting a target first gray value sequence from the first gray value sequence set;
respectively calculating the correlation between the target first gray value sequence and each second gray value sequence in the second gray value sequence set to obtain a second correlation set corresponding to the target first gray value sequence;
acquiring the maximum correlation degree in the second correlation degree set;
when the maximum correlation degree is larger than a second preset correlation degree threshold value, taking a second gray value sequence corresponding to the maximum correlation degree as a target second gray value sequence corresponding to the target first gray value sequence;
and acquiring a target first sub-phase sequence corresponding to the target first gray scale value sequence, acquiring a target second sub-phase sequence corresponding to the target second gray scale value sequence, and taking the target second sub-phase sequence as a second sub-phase sequence corresponding to the target first sub-phase sequence.
7. The method according to claim 6, wherein the interpolating the corresponding second sub-phase sequence according to each of the first sub-phase sequences to obtain corresponding homonyms for each phase in each of the first sub-phase sequences comprises:
acquiring pixels corresponding to all phases in the target first sub-phase sequence as first target pixels;
and interpolating to obtain second target pixels corresponding to the first target pixels according to the pixels corresponding to the phases in the corresponding target second sub-phase sequence, and taking the second target pixels as the homologous points of the first target pixels.
8. An apparatus for generating random gray scale map based on digital projection, the apparatus comprising:
a candidate random signal sequence obtaining module, configured to obtain a candidate random signal sequence;
the device comprises a target random signal sequence set acquisition module, a target random signal sequence set acquisition module and a target random signal sequence acquisition module, wherein the target random signal sequence set acquisition module is used for acquiring a target random signal sequence set, and the correlation degree between target random signal sequences in the target random signal sequence set is smaller than a first preset correlation degree threshold value;
a first correlation set obtaining module, configured to obtain a target correlation between the candidate random signal sequence and each target random signal sequence, and obtain a first correlation set corresponding to the candidate random signal sequence;
a candidate random signal sequence adding module, configured to add the candidate random signal sequence to the target random signal sequence set when a correlation degree in the first correlation degree set is smaller than a first preset correlation degree threshold;
the candidate gray-scale image generation module is used for generating a candidate gray-scale image according to the target random signal sequence set;
a target gray-scale image obtaining module, configured to obtain a first target gray-scale image and a second target gray-scale image corresponding to a target object according to projection of the candidate gray-scale image on the target object;
and the homonymous point positioning module is used for performing homonymous point positioning according to the first target gray-scale image and the second target gray-scale image so as to perform three-dimensional reconstruction on the target object.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the digital projection based random gray scale map generation method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for generating a random gray scale map based on digital projection according to one of claims 1 to 7.
CN202010076340.8A 2020-01-23 2020-01-23 Random gray level map generation method and device based on digital projection and computer equipment Active CN111311731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010076340.8A CN111311731B (en) 2020-01-23 2020-01-23 Random gray level map generation method and device based on digital projection and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010076340.8A CN111311731B (en) 2020-01-23 2020-01-23 Random gray level map generation method and device based on digital projection and computer equipment

Publications (2)

Publication Number Publication Date
CN111311731A true CN111311731A (en) 2020-06-19
CN111311731B CN111311731B (en) 2023-04-07

Family

ID=71159802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010076340.8A Active CN111311731B (en) 2020-01-23 2020-01-23 Random gray level map generation method and device based on digital projection and computer equipment

Country Status (1)

Country Link
CN (1) CN111311731B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116074577A (en) * 2022-12-23 2023-05-05 北京生数科技有限公司 Video processing method, related device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070122027A1 (en) * 2003-06-20 2007-05-31 Nippon Telegraph And Telephone Corp. Virtual visual point image generating method and 3-d image display method and device
US20120176380A1 (en) * 2011-01-11 2012-07-12 Sen Wang Forming 3d models using periodic illumination patterns
CN107767440A (en) * 2017-09-06 2018-03-06 北京建筑大学 Historical relic sequential images subtle three-dimensional method for reconstructing based on triangulation network interpolation and constraint
US20190325594A1 (en) * 2018-04-23 2019-10-24 Cognex Corporation Systems and methods for improved 3-d data reconstruction from stereo-temporal image sequences

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070122027A1 (en) * 2003-06-20 2007-05-31 Nippon Telegraph And Telephone Corp. Virtual visual point image generating method and 3-d image display method and device
US20120176380A1 (en) * 2011-01-11 2012-07-12 Sen Wang Forming 3d models using periodic illumination patterns
CN107767440A (en) * 2017-09-06 2018-03-06 北京建筑大学 Historical relic sequential images subtle three-dimensional method for reconstructing based on triangulation network interpolation and constraint
US20190325594A1 (en) * 2018-04-23 2019-10-24 Cognex Corporation Systems and methods for improved 3-d data reconstruction from stereo-temporal image sequences

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
彭翔 等: "基于相位辅助的三维数字成像与测量" *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116074577A (en) * 2022-12-23 2023-05-05 北京生数科技有限公司 Video processing method, related device and storage medium
CN116074577B (en) * 2022-12-23 2023-09-26 北京生数科技有限公司 Video processing method, related device and storage medium

Also Published As

Publication number Publication date
CN111311731B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN110517278B (en) Image segmentation and training method and device of image segmentation network and computer equipment
Jeon et al. Depth from a light field image with learning-based matching costs
CN109448090B (en) Image processing method, device, electronic equipment and storage medium
Yang et al. Bayesian denet: Monocular depth prediction and frame-wise fusion with synchronized uncertainty
US11847742B2 (en) Method in constructing a model of a scenery and device therefor
CN110675440B (en) Confidence evaluation method and device for three-dimensional depth data and computer equipment
Wang et al. Study of weighted fusion methods for the measurement of surface geometry
WO2005116936A1 (en) Method and system for detecting and evaluating 3d changes from images and a 3d reference model
CN110738730B (en) Point cloud matching method, device, computer equipment and storage medium
CN109102524B (en) Tracking method and tracking device for image feature points
Saini et al. NURBS-based geometric inverse reconstruction of free-form shapes
CN111491204B (en) Video repair method, video repair device, electronic equipment and computer-readable storage medium
Pistellato et al. Robust phase unwrapping by probabilistic consensus
CN111325683B (en) Speckle gray scale correction method and device based on composite coding three-dimensional reconstruction
CN111311731B (en) Random gray level map generation method and device based on digital projection and computer equipment
US9563937B2 (en) High-resolution image generation apparatus, high-resolution image generation method, and high-resolution image generation program
Wang et al. Occlusion-aware light field depth estimation with view attention
CN111292421B (en) Three-dimensional reconstruction method and device for composite coding, computer equipment and storage medium
CN110176035B (en) Method and device for positioning mark point, computer equipment and storage medium
CN116977671A (en) Target tracking method, device, equipment and storage medium based on image space positioning
CN108986031B (en) Image processing method, device, computer equipment and storage medium
JP7318698B2 (en) Three-dimensional model construction method, device, and computer-readable storage medium
Jiang et al. Probabilistic Triangulation for Uncalibrated Multi-View 3D Human Pose Estimation
CN115049744A (en) Robot hand-eye coordinate conversion method and device, computer equipment and storage medium
CN110910436B (en) Distance measuring method, device, equipment and medium based on image information enhancement technology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant