Summary of the invention
The invention provides a kind of picture depth computing method, avoid complicated depth calculation formula, the hardware configuration of needs is simple, can realize the acquisition 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: provide a kind of picture depth computing method, it is characterized in that, comprise the following steps:
1) the standard speckle pattern with known depth information is gathered, as benchmark;
2) the input speckle pattern sequence of target object is gathered by imageing sensor;
3) each input speckle pattern in described input speckle pattern sequence is mated with standard speckle pattern, generate the motion vector of each image block in input speckle pattern;
4) depth information corresponding to motion vector of each image block in input speckle pattern is obtained;
5) depth information of all image blocks in described input speckle pattern is combined, obtain the depth map of described target object.
Picture depth computing method provided by the invention, the active vision pattern of structure based light, block matching motion estimation method is adopted to improve matching precision, the high-resolution depth information of target object is obtained by the mode of laser triangulation method or look-up table, avoid complicated depth calculation formula, achieve the quick and precisely acquisition of depth information, simplify hardware configuration, be easy to realize, be conducive to large-scale promotion.
Embodiment
Below in conjunction with specific embodiment, the present invention is described in further detail.
In one embodiment, a kind of picture depth computing method are provided, comprise the following steps:
1) the standard speckle pattern with known depth information is gathered, as benchmark;
2) the input speckle pattern sequence of target object is gathered by imageing sensor;
3) each input speckle pattern in described input speckle pattern sequence and standard speckle pattern are carried out block-based motion estimation, generate the motion vector of image block in input speckle pattern;
4) depth information corresponding to motion vector of each image block in input speckle pattern is obtained;
5) depth information of all image blocks in described input speckle pattern is combined, obtain the depth map of described target object.
The acquisition of its Plays speckle pattern can realize in the following way: the laser beam (infrared, visible ray, ultraviolet, invisible light) of fixed pattern being projected and known depth information perpendicular with the central shaft of the speckle projector (Z axis) is
standard flat, be standard speckle pattern by the speckle pattern that imageing sensor acquisition plane is formed.Input speckle pattern also can adopt said method to obtain, and the target object containing the information that will fathom in input speckle pattern, its depth information is unknown.
Within the scope of the coverage that above-mentioned standard flat and target object need irradiate at speckle, and contain the view picture speckle image of fixed pattern formation as far as possible.
In the present invention, if not otherwise specified, the degree of depth of image block
dthat all refer to this image block place, vertical with speckle projector central shaft (Z axis) plane is to the vertical range of speckle projector front end.
Preferably, in another embodiment, described input speckle pattern and described standard speckle pattern are by the laser beam of fixed pattern being projected to respectively target object and the known body surface of depth information and obtaining.With regard to this embodiment, it is only 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, when known image sensor focal distance and sensor pixel point point distance parameter, utilize this motion vector to ask for the relative changing value of the degree of depth in conjunction with 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 known image sensor focal distance
when with sensor pixel point point apart from parameter, this displacement is utilized to ask for the relative changing value of the degree of depth in conjunction with laser triangulation method
, this changing value
can just can bear,
add the known depth information of standard speckle pattern
the depth information that this image block is corresponding can be obtained
, wherein: when this relative changing value be on the occasion of time, the depth information that this image block is corresponding is greater than the known depth information of standard speckle pattern; When this relative changing value is negative value, the depth information that this image block is corresponding is less than the known depth information of standard speckle pattern; When this relative changing value is zero, the depth information that this image block is corresponding equals the known depth information of standard speckle pattern.
For simplifying the obtain manner of depth information further, in another embodiment, in above-mentioned steps 3) and step 4) between increase a step setting up the look-up table of the corresponding relation of motion vector and depth information, utilize loop up table to ask for the degree of depth of image block in input speckle pattern, this look-up table is set up according to the depth value of the different displacement of standard speckle pattern and correspondence thereof.
Particularly, horizontal displacement in look-up table
or perpendicular displacement amount and the degree of depth
corresponding relation can be obtained by following methods: by multiple different depth distance
(as
) standard speckle pattern carry out block-based motion estimation between two, obtain the displacement between various criterion speckle pattern, as horizontal displacement
or perpendicular displacement amount
; Horizontal displacement can be obtained through curve-fitting method
or perpendicular displacement amount
with Object Depth distance
relation; Any level displacement can be generated according to this curvilinear equation
or any perpendicular displacement amount
with depth distance
corresponding look-up table.Any level displacement can be obtained according to this look-up table
or perpendicular displacement amount
the depth information of this corresponding image block
.Fig. 2 is the schematic diagram of the present embodiment depth calculation look-up table mode.
Through searching the degree of depth of input speckle pattern all image blocks and combine, this depth map corresponding to input speckle pattern can be obtained.
Preferably, depth map gray-scale map represents, the larger expression of such as gray-scale value is nearer, namely
be worth about little; The less expression of gray-scale value far, namely
be worth larger.Also opposite way gray-scale map can be adopted to represent depth map.
That is, present invention achieves look-up table mode and ask for the degree of depth
, such as: in concrete enforcement, by horizontal displacement
or perpendicular displacement amount
as the input value of look-up table, obtain the output valve degree of depth
, thus avoid complicated depth calculation formula, achieve the simplification of hardware configuration and the saving of hardware resource.
Further, in another embodiment, the curve-fitting method (see Fig. 3) of relation between a kind of displacement and depth information is provided, with horizontal displacement
for example, in the effective range of the speckle projector, will through speckle projector projection speckle pattern to the depth distance perpendicular and certain with speckle projector central shaft (Z axis)
plane on, be parallel to each other and the equal plane of spacing by choosing one group, obtain the standard speckle pattern of one group of corresponding different depth distance through imageing sensor collection, then between any two block-based motion estimation is carried out to adjacent standard speckle pattern, obtain one group of horizontal displacement
, by formula
conversion, thus obtain the data pair of one group of depth distance with horizontal displacement
...
, by a class and data to the analytical expression adapted
reflect horizontal displacement
with depth distance
dependence.In this example
with
nonlinear relationship, undetermined parameter in formula
calculate by the standard (as least square method) of certain measurement goodness of fit.Expression formula
after determining, just can obtain any level displacement
the depth distance of lower correspondence
, can look-up table be generated thus.
In computing method proposed by the invention, the motion vector of input speckle pattern (uses horizontal displacement
with perpendicular displacement amount
represent) precision be directly connected to depth distance
precision.
Best, in the following example, provide one can obtain high-resolution and obtain the block matching motion estimation method inputting speckle pattern motion vector.
Specifically comprise the following steps: input speckle pattern in extract size for (
) image block
; In standard speckle pattern, with image block
centered by corresponding position, size be (
) search window
in, the match block of the optimum of this image block is found by search strategy and similarity measurement index, wherein,
m, N, n, mall integer, and
m>m, N>n, thus obtain this image block displacement (
,
), i.e. motion vector.
Preferably, in search window, the search strategy of match block is that match block is searched for one by one, and its matching interpolation precision can reach sub-pixel-level first by horizontal direction movable block, increase line number in the vertical direction again.
In the present embodiment, speckle pattern in input speckle pattern sequence can be thought to be obtained through the operation such as convergent-divergent, translation by the speckle pattern of standard speckle pattern, ask for the motion vector (i.e. displacement) of corresponding speckle image block, the depth information of this speckle image block can be obtained in conjunction with look-up table.
This block matching motion estimation method is different from traditional block matching algorithm.In the matching process, the step-length of traditional its match block of estimation matching algorithm
equal the size of match block, the step-length of the image block extracted from input speckle pattern
also can be less than the size of match block, the motion vector asked for through Block-matching represent just moving mass central area, step-length
the motion vector of pixel (shadow region in Fig. 2) in scope, can obtain the accuracy rate of motion vector and the compromise of small objects motion vector error hiding phenomenon in this approach.
Although the above embodiments complete in specific apparatus system, so itself and non-limiting the present invention, those skilled in the art are easy to expect, above-mentioned similar method are applied in similar pattern projection or other picture depth computing systems.Thus amendment without departing from the spirit and scope of the present invention and perfect, all should be included in above-mentioned right.