Summary of the invention
The invention provides a kind of picture depth computing method, avoided complicated depth calculation formula, the hardware configuration that needs is simple, can realize obtaining real-time of high-resolution depth information.
For solving the problems of the technologies described above, the technical solution used in the present invention is: a kind of picture depth computing method are provided, it is characterized in that, may further comprise the steps:
1) gathers the standard speckle pattern with known depth information, as benchmark;
2) gathered the input speckle pattern sequence of target object by imageing sensor;
3) with in the described input speckle pattern sequence respectively input speckle pattern and the standard speckle pattern mates, generate the motion vector of each image block in the input speckle pattern;
4) the corresponding depth information of motion vector of each image block in the acquisition input speckle pattern;
5) depth information of all image blocks in the described input speckle pattern made up, obtain the depth map of described target object.
Picture depth computing method provided by the invention, active vision pattern based on structured light, adopt block matching motion estimation method to improve matching precision, obtain the high-resolution depth information of target object by the mode of laser triangulation method or look-up table, avoid complicated depth calculation formula, realized quick and precisely obtaining of depth information, simplified hardware configuration, be easy to realize, be conducive to large-scale promotion.
Embodiment
Below in conjunction with specific embodiment the present invention is further described in detail.
In one embodiment, provide a kind of picture depth computing method, may further comprise the steps:
1) gathers the standard speckle pattern with known depth information, as benchmark;
2) gathered the input speckle pattern sequence of target object by imageing sensor;
3) respectively input speckle pattern and standard speckle pattern in the described input speckle pattern sequence are carried out block matching motion and estimate, generate the motion vector of image block in the input speckle pattern;
4) the corresponding depth information of motion vector of each image block in the acquisition input speckle pattern;
5) depth information of all image blocks in the described input speckle pattern made up, obtain the depth map of described target object.
Obtaining of its Plays speckle pattern can realize in the following way: with the laser beam of fixed pattern (infrared, visible light, ultraviolet ray, invisible light) project with the central shaft (Z axis) of the speckle projector perpendicular and known depth information be
Standard flat, be the standard speckle pattern by formed speckle pattern on the imageing sensor acquisition plane.The input speckle pattern also can adopt said method to obtain, and contains the target object of the information that will fathom in the input speckle pattern, and its depth information is unknown.
Above-mentioned standard flat and target object need in the coverage scope of speckle irradiation, and contain as far as possible the view picture speckle image that fixed pattern forms.
Among the present invention, as not specifying the degree of depth of image block
dRefer to that all plane this image block place, vertical with speckle projector central shaft (Z axis) is to the vertical range of speckle projector front end.
Preferably, in another embodiment, described input speckle pattern and described standard speckle pattern are to be projected to respectively target object and the known body surface of depth information obtains by the laser beam with fixed pattern.With regard to this embodiment, it only is used for limiting a kind of acquisition pattern of speckle pattern.
Preferably, in another embodiment, for described step 4), it is characterized in that: according to the motion vector of each image block, at known image sensor focal distance and sensor pixel point point in the situation of parameter, the relative changing value who utilizes this motion vector to ask for the degree of depth in conjunction with the laser triangulation method, this relative changing value can just can bear, and this relative changing value adds that the known depth information of standard speckle pattern can obtain depth information corresponding to this image block.
Fig. 1 is the laser triangulation principle schematic of this embodiment.According to the displacement of each image block (
,
), in the known image sensor focal distance
With sensor pixel point point in the situation of parameter, utilize this displacement to ask for the relative changing value of the degree of depth in conjunction with the laser triangulation method
, this changing value
Can just can bear,
Add the known depth information of standard speckle pattern
Can obtain depth information corresponding to this image block
, wherein: when this relative changing value be on the occasion of the time, depth information corresponding to this image block is greater than the known depth information of standard speckle pattern; When this relative changing value was negative value, depth information corresponding to this image block was less than the known depth information of standard speckle pattern; When this relative changing value was zero, the depth information that this image block is corresponding equaled the known depth information of standard speckle pattern.
For further simplifying the obtain manner of depth information, in another embodiment, in above-mentioned steps 3) and step 4) between increase the step of the look-up table of a corresponding relation of setting up motion vector and depth information, utilize loop up table to ask for the degree of depth of image block in the input speckle pattern, this look-up table is set up according to the different displacements of standard speckle pattern and corresponding depth value thereof.
Particularly, horizontal displacement in the look-up table
Or perpendicular displacement amount and the degree of depth
Corresponding relation can be obtained by following methods: by a plurality of different depth distances
(as
) the standard speckle pattern carry out in twos block matching motion and estimate, obtain the displacement between the various criterion speckle pattern, such as horizontal displacement
Or perpendicular displacement amount
Can obtain horizontal displacement through curve-fitting method
Or perpendicular displacement amount
With the Object Depth distance
Relation; Can generate any level displacement according to this curvilinear equation
Or any perpendicular displacement amount
With depth distance
Corresponding look-up table.Can obtain any level displacement according to this look-up table
Or perpendicular displacement amount
The depth information of corresponding this image block
Fig. 2 is the synoptic diagram of present embodiment depth calculation look-up table mode.
Through the degree of depth of all image blocks of input speckle pattern is searched and made up, can obtain the corresponding depth map of this input speckle pattern.
Preferably, depth map represents with gray-scale map, and is nearer such as the larger expression of gray-scale value, namely
Be worth approximately little; The less expression of gray-scale value is far away, namely
Be worth larger.Also can adopt opposite way to represent depth map with gray-scale map.
That is to say that the present invention has realized that the look-up table mode asks for the degree of depth
, for example: in implementation, with horizontal displacement
Or perpendicular displacement amount
As the input value of look-up table, obtain the output valve degree of depth
Thereby, avoided complicated depth calculation formula, realized the simplification of hardware configuration and the saving of hardware resource.
Further, in another embodiment, provide the curve-fitting method (referring to Fig. 3) of a kind of displacement and depth information Relations Among, with horizontal displacement
Be example, in the effective range of the speckle projector, will be through speckle projector projection speckle pattern to the depth distance perpendicular and certain with speckle projector central shaft (Z axis)
The plane on, be parallel to each other and plane that spacing equates by choosing one group, through the standard speckle pattern of one group of different depth distance corresponding to imageing sensor collection acquisition, then adjacent standard speckle pattern is carried out block matching motion between any two and estimate, obtain one group of horizontal displacement
, by formula
Conversion, thus one group of depth distance obtained with the data of horizontal displacement pair
, the analytical expression to adapting with a class and data
Reflect horizontal displacement
With depth distance
Dependence.In this example
With
Nonlinear relationship, undetermined parameter in the formula
Standard (such as least square method) with certain measurement goodness of fit calculates.Expression formula
After determining, just can obtain any level displacement
The depth distance of lower correspondence
, can generate look-up table thus.
In computing method proposed by the invention, the motion vector of input speckle pattern (is used horizontal displacement
With the perpendicular displacement amount
Expression) precision is directly connected to depth distance
Precision.
Best, in following embodiment, provide one can obtain the block matching motion estimation method that high-resolution obtains input speckle pattern motion vector.
Specifically may further comprise the steps: extraction is big or small in the input speckle pattern is (
) image block
In the standard speckle pattern, with image block
Centered by institute's correspondence position, size be (
) the search window
In, seek the match block of the optimum of this image block by search strategy and similarity measurement index, wherein,
M, N, n, mAll be integer, and
M〉m, N〉nThereby, obtain this image block displacement (
,
), i.e. motion vector.
Preferably, the search strategy of match block is first by the horizontal direction movable block, increase in the vertical direction line number again in the search window, and match block is searched for one by one, and its matching interpolation precision can reach sub-pixel-level.
In the present embodiment, speckle pattern in the input speckle pattern sequence can be thought to be obtained through operations such as convergent-divergent, translations by the speckle pattern of standard speckle pattern, ask for the motion vector (being displacement) of corresponding speckle image piece, can obtain the depth information of this speckle image piece in conjunction with look-up table.
This block matching motion estimation method is different from traditional block matching algorithm.In matching process, the step-length of traditional its match block of estimation matching algorithm
Equal to mate block size, the step-length of the image block that from the input speckle pattern, extracts
Also can be less than the coupling block size, the motion vector of asking for through the piece coupling has only represented moving mass central area, step-length
The motion vector of pixel (shadow region among Fig. 2) in the scope, accuracy rate and the small objects motion vector mistake that can obtain motion vector with the method are mated the compromise of phenomenon.
Although the above embodiments are finished in specific apparatus system, so its also non-limiting the present invention, those skilled in the art are easy to expect, above-mentioned similar method is applied in similar the pattern projection or other picture depth computing systems.Thereby modification without departing from the spirit and scope of the present invention and perfect, all should be included in the above-mentioned claim scope.