The present invention relates generally to computer vision, and specifically to three-dimensional (3D) mapping and imaging.
Various methods are known in the art for optical 3D mapping, i.e., generating a 3D profile of the surface of an object by processing an optical image of the object. This sort of 3D profile is also referred to as a depth map or depth image, and 3D mapping is also referred to as depth mapping.
Some methods of 3D mapping are based on projecting a laser speckle pattern onto the object, and then analyzing an image of the pattern on the object. For example, PCT International Publication WO 2007/043036, whose disclosure is incorporated herein by reference, describes a system and method for object reconstruction in which a coherent light source and a generator of a random speckle pattern project onto the object a coherent random speckle pattern. An imaging unit detects the light response of the illuminated region and generates image data. Shifts of the pattern in the image of the object relative to a reference image of the pattern are used in real-time reconstruction of a 3D map of the object. Further methods for 3D mapping using speckle patterns are described, for example, in PCT International Publication WO 2007/105205, whose disclosure is also incorporated herein by reference.
Other methods of optical 3D mapping project different sorts of patterns onto the object to be mapped. For example, PCT International Publication WO 2008/120217, whose disclosure is incorporated herein by reference, describes an illumination assembly for 3D mapping that includes a single transparency containing a fixed pattern of spots. A light source transilluminates the transparency with optical radiation so as to project the pattern onto an object. An image capture assembly captures an image of the pattern on the object, and the image is processed so as to reconstruct a 3D map of the object.
Still other methods of 3D mapping use a stereoscopic approach: Typically, two or more cameras at different positions capture respective images of the object. A computer analyzes the images to find the relative pixel offset of features of the object between the two images. The depths of the features are proportional to the respective offsets.
Embodiments of the present invention that are described hereinbelow provide devices and methods for generation of 3D maps based on image data. In some embodiments, a 3D map of an object is created by processing an image of a pattern that is projected onto the object in combination with stereoscopic image analysis.
There is therefore provided, in accordance with an embodiment of the invention, a method for depth mapping, including projecting a pattern of optical radiation onto an object. A first image of the pattern on the object is captured using a first image sensor, and the first image is processed to generate pattern-based depth data with respect to the object. A second image of the object is captured using a second image sensor, and the second image is processed together with another image to generate stereoscopic depth data with respect to the object. The pattern-based depth data is combined with the stereoscopic depth data to create a depth map of the object.
In some embodiments, processing the second image together with the other image includes processing the second image together with the first image. In a disclosed embodiment, projecting the pattern includes projecting infrared (IR) radiation onto the object, and capturing the first image includes capturing the IR radiation that is reflected from the object, while capturing the second image includes capturing a color image of the object. Typically, the color image includes pixels, and the depth map includes depth values, and the method includes outputting the color image to a display together with the depth coordinates that are associated with the pixels.
Additionally or alternatively, projecting the pattern includes projecting multiple spots onto the object, and processing the first image includes finding respective transverse shifts between the spots on the object and the spots in a reference image of the pattern, and computing the depth data based on the transverse shifts.
Combining the pattern-based depth data with the stereoscopic depth data may include computing respective measures of confidence associated with the pattern-based depth data and stereoscopic depth data, and selecting depth coordinates from among the pattern-based and stereoscopic depth data responsively to the respective measures of confidence.
In some embodiments, combining the pattern-based depth data with the stereoscopic depth data includes defining multiple candidate depth coordinates for each of a plurality of pixels in the depth map, and selecting one of the candidate depth coordinates at each pixel for inclusion in the depth map. The multiple candidate depth coordinates may include, for at least some of the pixels, a null coordinate indicating that no valid depth coordinate was found. In a disclosed embodiment, selecting the one of the candidate depth coordinates includes applying weighted tensor voting among the pixels in order to select the one of the candidate depth coordinates based on the candidate depth coordinates at neighboring pixels.
In a disclosed embodiment, combining the pattern-based depth data with the stereoscopic depth data includes applying a calibration procedure to the first and second images so as to correct for a misalignment between the first and second images. Typically, applying the calibration procedure includes correcting for a change in alignment between the pattern of optical radiation and the first image sensor.
There is also provided, in accordance with an embodiment of the invention, a method for depth mapping, including receiving at least one image of an object, captured by an image sensor, the image including multiple pixels. The at least one image is processed to generate depth data including multiple candidate depth coordinates for each of a plurality of the pixels. A weighted voting process is applied to the depth data in order to select one of the candidate depth coordinates at each pixel. A depth map of the object is outputted, including the selected one of the candidate depth coordinates at each pixel.
In a disclosed embodiment, processing the at least one image includes computing respective measures of confidence associated with the candidate depth coordinates, and applying the weighted voting process includes weighting votes for the candidate depth coordinates responsively to the respective measures of confidence.
In some embodiments, applying the weighted voting process includes applying weighted tensor voting among the pixels in order to select the one of the candidate depth coordinates based on the candidate depth coordinates at neighboring pixels. Typically, applying the weighted tensor voting includes computing a weighted sum of covariance matrices over the neighboring pixels, and selecting the one of the candidate depth coordinates based on a difference between eigenvalues of the summed covariance matrices.
There is additionally provided, in accordance with an embodiment of the invention, apparatus for depth mapping, including an illumination subassembly, which is configured to project a pattern of optical radiation onto an object. A first image sensor is configured to capture a first image of the pattern on the object. At least a second image sensor is configured to capture at least a second image of the object. A processor is configured to process the first image to generate pattern-based depth data with respect to the object, to process a pair of images including at least the second image to generate stereoscopic depth data with respect to the object, and to combine the pattern-based depth data with the stereoscopic depth data to create a depth map of the object.
There is further provided, in accordance with an embodiment of the invention, apparatus for depth mapping, including at least one image sensor, which is configured to capture at least one image of an object, the image including multiple pixels. A processor is configured to process the at least one image to generate depth data including multiple candidate depth coordinates for each of a plurality of the pixels, to apply a weighted voting process to the depth data in order to select one of the candidate depth coordinates at each pixel, and to output a depth map of the object including the selected one of the candidate depth coordinates at each pixel.
There is moreover provided, in accordance with an embodiment of the invention, a computer software product, including a computer-readable medium in which program instructions are stored, which instructions, when read by a processor, cause the processor to receive a first image of a pattern that has been projected onto an object and to receive at least a second image of the object, and to process the first image to generate pattern-based depth data with respect to the object, to process a pair of images including at least the second image to generate stereoscopic depth data with respect to the object, and to combine the pattern-based depth data with the stereoscopic depth data to create a depth map of the object.
There is furthermore provided, in accordance with an embodiment of the invention, a computer software product, including a computer-readable medium in which program instructions are stored, which instructions, when read by a processor, cause the processor to receive at least one image of an object, the image including multiple pixels, to process the at least one image to generate depth data including multiple candidate depth coordinates for each of a plurality of the pixels, to apply a weighted voting process to the depth data in order to select one of the candidate depth coordinates at each pixel, and to output a depth map of the object including the selected one of the candidate depth coordinates at each pixel.
There is also provided, in accordance with an embodiment of the invention, a method for depth mapping, including capturing first and second images of an object using first and second image capture subassemblies, respectively. The first and second images are compared in order to estimate a misalignment between the first and second image capture subassemblies. The first and second images are processed together while correcting for the misalignment so as to generate stereoscopic depth data with respect to the object. A depth map is outputted including the stereoscopic depth data.
In a disclosed embodiment, comparing the first and second images includes selecting pixels in a first depth map responsively to the depth data, collecting statistics with respect to the selected pixels in subsequent images captured by the first and second image capture subassemblies, and applying the statistics in updating the estimate of the misalignment for use creating a second, subsequent depth map.
Comparing the first and second images may include estimating a difference in relative magnification between the first and second images and/or a shift between the first and second images. In a disclosed embodiment, correcting the misalignment includes applying corrected shift values xnom in generating the depth data, incorporating a correction dxnom given by a formula:
wherein dxmeas is a measured X-direction shift value at a pixel with a measured coordinate xrealimage taken relative to center coordinates x0 and x1, α and β are expansion and shrinking factors, and Berror is baseline error in comparison to a baseline value Bnom.
There is additionally provided, in accordance with an embodiment of the invention, apparatus for depth mapping, including first and second image capture subassemblies, which are configured to capture respective first and second images of an object. A processor is configured to compare the first and second images in order to estimate a misalignment between the first and second image capture subassemblies, to process the first and second images together while correcting for the misalignment so as to generate stereoscopic depth data with respect to the object, and to output a depth map including the stereoscopic depth data.
The present invention will be more fully understood from the following detailed description of the embodiments thereof, taken together with the drawings in which:
In the example shown in
In addition, imaging assembly 24 captures color (2D) images of the user. The imaging assembly registers and synchronizes the depth maps with the color images, thus providing the basis to reconstruct a 3D color image of the user. Assembly 24 generates a data stream that includes the depth maps and image data for output to computer 26. These functions of assembly 24 are described further in U.S. patent application Ser. No. 12/397,362, filed Mar. 4, 2009, which is assigned to the assignee of the present patent application and whose disclosure is incorporated herein by reference.
Furthermore, features of the color images and IR images that are captured by assembly 24 may be compared in order to generate additional depth information, using techniques of stereoscopic image analysis. This stereoscopic depth information may be used to supplement the pattern-based depth map, particularly in areas in which the image of the pattern is unclear (such as in areas that are very brightly lit or on areas of the object having low reflectivity). Details of this sort of stereoscopic supplementation of the pattern-based depth map are described further hereinbelow.
Computer 26 processes the data generated by assembly in order to extract 3D image information. For example, the computer may segment the depth map in order to identify the parts of the body of user 22 and find their 3D locations. Computer 26 may use this information in driving an output device, such as a display 28, typically to present 3D image information and/or user interface elements that may be controlled by movements of parts of the user's body. Generally, computer 26 comprises a general-purpose computer processor, which is programmed in software to carry out these functions. The software may be downloaded to the processor in electronic form, over a network, for example, or it may alternatively be provided on tangible media, such as optical, magnetic, or electronic memory media.
As another alternative, the processing functions that are associated here with computer 26 may be carried out by a suitable processor in assembly 24 or a processor that is integrated with display 28 (in a television set, for example) or with any other suitable sort of computerized device, such as a game console or media player.
For 3D mapping, an illumination subassembly 30 illuminates the object with an appropriate pattern, such as a speckle pattern. For this purpose, subassembly 30 typically comprises a suitable radiation source 32, such as a diode laser, LED or other light source, along with optics, such as a diffuser 34 or a diffractive optical element, for creating the pattern, as described in the above-mentioned PCT publications. A depth image capture subassembly 36 captures an image of the pattern on the object surface. Subassembly 36 typically comprises objective optics 38, which image the object surface onto a detector 40, such as a CMOS image sensor.
As noted above, radiation source 32 typically emits IR radiation, although other radiation bands, in the visible or ultraviolet range, for example, may also be used. Detector 40 may comprise a monochrome image sensor, without an IR-cutoff filter, in order to detect the image of the projected pattern with high sensitivity. To enhance the contrast of the image captured by detector 40, optics 38 or the detector itself may comprise a bandpass filter, which passes the wavelength of radiation source 32 while blocking ambient radiation in other bands.
A color image capture subassembly 42 captures color images of the object. Subassembly 42 typically comprises objective optics 44, which image the object surface onto a detector 46, such as a CMOS color mosaic image sensor. Such a sensor is typically overlaid by a Bayer red-green-blue (RGB) mosaic filter, as is known in the art. Optics 44 or detector 46 may comprise a filter, such as an IR-cutoff filter, so that the pattern projected by illumination subassembly 30 does not appear in the color images captured by detector 46. Typically, subassembly 42 comprises one or more mechanisms for adapting to the intensity of the light reflected from the object including, for example, an electronic shutter, automatic gain control (AGC), and/or a variable iris. Subassembly 36 may be similarly configured.
A processor 50 receives and processes image inputs from subassemblies 36 and 42. Device 50 typically comprises an embedded microprocessor, which is programmed in software (or firmware) to carry out the processing functions that are described hereinbelow. The software may be provided to the processor in electronic form, over a network, for example; alternatively or additionally, the software may be stored on tangible computer-readable media, such as optical, magnetic, or electronic memory media. Device 50 also comprises suitable input and output interfaces and may comprise dedicated and/or programmable hardware logic circuits for carrying out some or all of its functions. Details of some of these processing functions and circuits that may be used to carry them out are presented in the above mentioned U.S. patent application Ser. No. 12/397,362.
Briefly put, processor 50 compares the image provided by subassembly 36 to a reference image of the pattern projected by subassembly 30 onto a reference plane at a known distance from assembly 24. (The reference image may be captured as part of a calibration procedure and stored in a memory, for example.) The processor matches the local patterns in the captured image to those in the reference image and thus finds the transverse shift for each pixel, or group of pixels, within the plane. Based on these transverse shifts and on the known distance DcL between the optical axes of subassemblies 30 and 36, the processor computes a depth (Z) coordinate for each pixel. In addition, as noted above, the processor may supplement these pattern-based depth coordinates with stereoscopic depth information, which is derived from the images provided by both of subassemblies 36 and 42, on the basis of the known distance Dcc between the respective optical axes.
Although
Alternatively, other system configurations may be used for the purposes described herein and are considered to be within the scope of the present invention.
Processor 50 synchronizes and registers the depth coordinates in each 3D map with appropriate pixels in the color images captured by subassembly 42. The registration typically involves a shift of the coordinates associated with each depth value in the 3D map. The shift includes a static component, based on the distance Dcc between the optical axes of subassemblies 36 and 42 and any misalignment between the detectors, as well as a dynamic component that is dependent on the depth coordinates themselves. The registration process is described in the above-mentioned U.S. patent application Ser. No. 12/397,362.
Misalignment among the components of assembly 24 and distortion due to non-ideal behavior of these components may be calibrated, and appropriate correction factors may be computed to correct for this misalignment and distortion. These correction factors are applied by processor 50 in computing the depth coordinates. A procedure for performing such calibration is described hereinbelow with reference to
After registering the depth maps and color images, processor 50 outputs the depth and color data via a port, such as a USB port, to host computer 26.
The inventors have found that by itself, pattern-based depth mapping, as described above, generally gives more accurate and robust results than do stereoscopic techniques. Under some circumstances, however, pattern-based methods do not work well, for example:
Under such conditions, the depth map that is generated on the basis of the pattern alone may contain “holes”-areas of the object for which no reliable depth coordinates are available.
In some embodiments of the present invention, these holes are filled in by means of stereoscopic depth mapping. In stereoscopic techniques that are known in the art, two or more cameras, spaced apart by a known distance, capture images of the same scene. The same image features appear in both images, but at locations in the respective images that are relatively offset by parallax due to the spacing of the cameras and the distance of the features from the camera plane. The measured offset of a given feature, together with the known spacing between the cameras, is thus used to compute the depth coordinate of the feature.
Usually, the multiple cameras that are used in a stereoscopic system are of the same type and characteristics. In the embodiment shown in
In bright areas of the object (case 1 above) in which the IR camera is unable to capture an image of the projected pattern, both the IR and RGB cameras are still generally able to form an image of the object itself without undue difficulty, since there is plenty of available light. (The electronic shutter, AGC, and/or iris adjustment may be used to reduce sensor saturation if the image is too bright.) Even in dark areas of the object (case 2 above), there may be sufficient bright highlights or other low-amplitude image information, such as edges, in the IR and RGB images to enable the processor to make a meaningful comparison.
Processor 50 stereoscopically measures the local offset between the IR and RGB images and thus obtains depth coordinates of these features based on the distance Dcc between the optical axes of the cameras. These depth coordinates are inherently registered with the RGB image. The processor may apply any method of stereoscopic processing that is known in the art. For example, the processor may identify specific image features in the IR and RGB images and compute the offset between the features. Additionally or alternatively, after an appropriate image rescaling and alignment, the processor may calculate a normalized cross-correlation over areas or features in the IR and RGB images for different values of offset between the images. The offset that maximizes the cross-correlation is chosen and thus gives the depth coordinate of the pixel. Alternatively, a mutual information calculation, as is known in the art, may be used to find the offset between the locations of a given feature or area in the two images. Thus, both bright and dark holes in the pattern-based depth map may be filled in with stereoscopic depth information, giving a more complete, accurate and robust 3D picture of the object.
Processor 50 combines the stereoscopic coordinates with the pattern-based coordinates to form a unified depth map. For this purpose, the processor may choose, for each pixel or group of pixels, between the stereoscopic and the pattern-based depth coordinates in order to build the optimal depth map. In one embodiment, which is described in greater detail hereinbelow, the processor computes pattern-based and stereoscopic depth data over the entire field of view of imaging assembly 24. It thus may find multiple candidate depth coordinates for each pixel, and may assign respective confidence values to the different candidate coordinates. The processor then performs a process of weighted voting in order to choose the best candidate depth at each pixel. Alternatively, the processor may apply other methods to blend the stereoscopic and pattern-based depth coordinates.
Although the “object” in the example shown in
To begin the process in system 20, illumination subassembly 30 projects a pattern onto the object. Image capture subassembly 36 captures an image of the pattern appearing on the object, at a pattern capture step 52, while image capture subassembly 42 captures a color image of the object, at a color image capture step 54. Processor 50 pre-processes each of the captured images, at pre-processing steps 56 and 58. For purposes of comparison with the IR image, the processor typically converts the color (RGB) image to monochrome form. For example, the processor may compute the luminance value of each pixel (or group of R, G and B pixels), or it may take the maximum or the sum of the R, G and B values. Processor 50 may also enhance the image contents in steps 56 and 58, by performing pre-processing operations, such as sharpening, on the raw input data.
Based on the IR image (possibly following the pre-processing step), processor 50 computes pattern-based depth coordinates for all pixels in the image, at a pattern-based depth computation step 60. An implementation of this step is described in detail, for example, in the above-mentioned U.S. patent application Ser. No. 12/397,362. At this step, as noted above, processor 50 matches the local patterns in the captured IR image to those in a stored reference image and thus finds the transverse shift for each pixel. This shift is indicative of the depth coordinate of the pixel relative to the reference plane.
To match the local patterns in the captured image with local patterns in the reference image at step 60, the processor may perform a local matching operation, such as a cross-correlation, sum of absolute differences, minimum square error or other techniques of local matching that are known in the art. Alternatively or additionally, processor 50 may use other techniques in matching local patterns in the IR and color images. Such techniques include, for example, computing a sum of square differences (SSD) between the local patterns, as well as ordinal measures (as described, for example, by Bhat and Nayar, in “Ordinal Measures for Image Correspondence,” IEEE Transactions on Pattern Analysis and Machine Intelligence 20:4 (1998), pages 415-423, which is incorporated herein by reference). The processor computes a local match score for each candidate shift value at each pixel or group of pixels, indicating the quality of the match. Typically, when image conditions are good, the depth coordinate at each pixel corresponds to the shift that gives the highest local match score according to one of the above metrics.
In practice, however, the local match results may not be unequivocal due to non-ideal image quality. For example, there may be two or more different shifts that give local maxima in the local match score, or the local match scores may be low for all shifts due to poor lighting conditions or shadows. Therefore, rather than simply choosing a single depth value at step 60, processor 50 may take two (or more) depth coordinates corresponding to the shifts that gave the best local match scores. These depth coordinates are treated at this stage as candidate depth values. The processor saves the respective local match score together with each candidate depth coordinate as a measure of confidence that the coordinate is correct.
Processor 50 computes stereo-based depth coordinates for all pixels, at a stereo depth computation step 62. In this step, the processor compares each vicinity in the IR image to a set of shifted vicinities in the color image (following pre-processing of both images, as explained above), or vice versa. As in step 60, the processor typically computes a local match score for each possible shift and chooses the shift that gives the best local match score as indicating the candidate depth coordinate. As in step 60, multiple candidates may be chosen, and the local match scores themselves may be used as confidence measures.
In some cases, imaging assembly 24 may be unable to find any legitimate depth candidate for a given pixel or region in the image. For example, processor 50 may be unable to compute any candidate depth with reasonable confidence for pixels that are in areas of shadow or in highly-reflective areas or that represent objects that are too far or too close for their depth to be sensed by assembly 24. In such cases, it is generally preferable that processor 50 output a null depth value at the pixels in question, indicating that no valid depth coordinate was found, rather than an incorrect value. Therefore, when there is no shift between the IR and color images at a given pixel that gives a confidence measure that is above a certain predetermined threshold in step 62, processor 50 may choose a null, “no-depth” coordinate as one of the depth candidates for that pixel. The confidence measure associated with this null candidate may be taken to be a reciprocal of the highest cross-correlation value (such as one minus the cross-correlation) that was computed for any shift at the given pixel.
Following steps 60 and 62, each pixel in the field of view of imaging assembly 24 has multiple candidate depth coordinates, each with an associated confidence measure (also referred to as a confidence score). Ideally, the candidate depths at any given pixel may be identical, or nearly so, but frequently they are not, and the correct depth choice is not necessarily the one with the highest score. On the other hand, the correct 3D coordinates are usually those that make up, together with their near and more distant neighbors, smooth surfaces in 3D space.
Therefore, in order to choose among the candidate depth coordinates at each pixel, processor 50 compares each candidate to the candidate depth coordinates of other pixels within a certain neighborhood. Various methods may be used for this purpose. In one embodiment, which is described in greater detail hereinbelow, processor 50 uses a method of tensor voting, in which each pixel casts “votes” for the candidate depth coordinates at neighboring pixels, in a voting step 64. The principles of this sort of tensor voting are described in detail by Mordohai and Medioni, in Tensor Voting: A Perceptual Organization Approach to Computer Vision and Machine Learning (Morgan and Claypool, 2006), which is incorporated herein by reference. The votes are directed (in tensor space) and weighted according to the candidate depth coordinates and corresponding confidence values at the neighboring pixels.
Processor 50 accumulates the weighted votes for each candidate depth coordinate at each pixel, and sums these votes in order to compute a saliency value for each candidate, at a saliency computation step 66. The saliency computation (as explained by Mordohai and Medioni) gives an indication of the orientation of a surface that is inferred to pass through the candidate coordinate, as well as a level of confidence that the surface actually exists in 3D space. Processor 50 chooses the depth candidate at each pixel that has the highest saliency, and incorporates the chosen coordinates in a depth map, at a map output step 68. The inventors have found this voting method to give accurate, smooth integration between pattern-based and stereo-based 3D coordinates. System 20 is thus able to generate smooth, accurate depth maps over most or all of the field of view of assembly 24 notwithstanding variations in lighting, depth and reflectivity of the object.
Reference is now made to
At step 64 (
Vote=(confidence score)·saliency·cov(n) (1)
Here the confidence score is the value computed at step 60 or 62, as described above, and the saliency and covariance of the vector n (which is a voting tensor, describing a surface with n as its surface normal) are defined below.
The weight given to the tensor created by vector 69 is adjusted according to the saliency S, which is a function of the tensor geometry shown in
wherein
l is the length of the ray between O and P, and θ is the angle between this ray and the X-Y plane. The values of c and σ define the scale of voting. For the 11-pixel radius mentioned above, σ=8, and
It can be seen that the saliency decays with distance from the origin and with angle out of the plane. Thus, nearby pixels with similar candidate depth coordinates will have high saliency in voting for a given candidate, while farther pixels and highly different candidate depth coordinates will have little or no saliency.
Voting field 70 in
The covariance term (voting tensor) in equation (1) is then given by:
The voting formula of equation (1) may be modified to give greater weight to “anchors,” meaning candidate depth values that are closely tied to the candidate that is collecting the votes. Such anchors are typically characterized by high confidence scores (above a selected threshold) and coordinates near the origin (for example, with X, Y and Z coordinates between +2 and −2). In collecting and summing the votes from these anchor candidates, processor 50 may multiply the values given by equation (1) by an enhancement factor, which is typically a number in the range between 2 and 6. Processor 50 will then favor these anchors when choosing candidates to include in the output depth map.
Null, “no-depth” candidates have an artificial Z coordinate, which is chosen to be out of the range of voting field 70 for actual, non-null depth coordinates. Thus, no-depth candidates will vote only for one another (with saliency values computed with θ=0). Typically, neighboring no-depth candidates do not receive the type of “anchor” enhancement that is described above.
Summing the votes given by equation (1) for all neighbors of a given candidate, at step 66 (
In the method of
Although the embodiment of
Other methods that may be used in this context are based on Markov random field (MRF) models. Although the MRF framework yields an optimization problem that is NP hard, good approximation techniques based on graph cuts and on belief propagation have been developed and demonstrated for stereo and image restoration. The use of graph cuts is described, for example, by Boykov et al., in “Fast Approximate Energy Minimization Via Graph Cuts,” IEEE Transactions on Pattern Analysis and Machine Intelligence 23(11), pages 1222-1239(2001). Belief propagation methods are described by Weiss et al., in “On the Optimality of Solutions of Themax-Product Belief Propagation Algorithm in Arbitrary Graphs,” IEEE Transactions on Information Theory 47(2), pages 723-735 (2001); and by Sun et al., in “Stereo Matching Using Belief Propagation,” IEEE Transactions on Pattern Analysis and Machine Intelligence 25(7), pages 787-800 (2003). Felzenszwalb et al., in “Efficient Belief Propagation for Early Vision,” International Journal of Computer Vision 70:1, pages 41-54 (2006), describe in detail belief propagation algorithm for stereo matching and show good experimental results on standard images used for the evaluation of stereo matching algorithms. The above-mentioned publications are incorporated herein by reference. The methods they describe are useful both in the sense that the local minima they find are minima over “large neighborhoods,” and in the sense that they produce highly accurate results in practice.
Furthermore, the methods of weighted voting that are described above may similarly be used in choosing among multiple depth values generated by other techniques, including multiple candidate depth values that may be generated using a single mapping technique (such as pattern-based mapping alone).
For example, during operation of system 20, optical components may expand or contract, relative locations of the subassemblies may shift, and the angular magnification of the projected pattern may change. These changes can distort the depth measurements and can alter the relative positions of the IR and RGB images, which may cause the tensor voting process to fail. The calibration process of
For each cycle of calibration, processor 50 acquires image statistics over a sequence of C frames captured by imaging assembly 24, at a statistics acquisition step 80. C is a configurable parameter, which can be set depending on the relative stability or instability of the operating conditions of system 20. The statistics collected typically include, at each selected pixel (X,Y), the following shift values in the X and Y coordinates:
Processor 50 typically collects the statistics at pixels where both the IR and the RGB image capture subassemblies gave valid results. For example, the processor may select pixels at which the confidence values computed at steps 60 and 62 (
Processor 50 analyzes the statistics in order to estimate distortion and shift, as a function of pixel coordinates (X,Y), for the IR image relative to the reference and the RGB image relative to the IR image, at a statistical analysis step 82. The analysis takes the results of the previous iteration through the calibration procedure as its point of departure, and computes changes in the calibration parameters relative to the previous values.
At this step, processor 50 may make use particularly of the Y-direction distortion and shift values, since they are (ideally) independent of the depth. Thus, Y-direction deviation between the IR image and the reference image may be attributed to magnification of the projected pattern due to wavelength changes or movement of the projection lens, or due to relative movement of the IR image capture subassembly or its components. Y-direction deviation between the RGB image and the IR image may be attributed to relative movement between the RGB and IR image capture subassemblies or their components.
Thus, for each pair of subassemblies (projection/IR image capture and RGB/IR image capture), the processor maps the Y-direction distortion and shift, DY, as a function of X and Y. The shift and distortion may be modeled as a linear function of the coordinates: DY(X,Y)=A(X−Xc)+BY+C. (Xc represents the center of the image.) The parameters A, B and C may be computed by a least-squares fit over the pixel statistics that were collected at step 80.
Processor 50 uses the results of this analysis in computing a number of correction factors, in correction computation steps 84, 86, 88, 90 and 92. These factors include expansion and shrinking factors α and β, which are computed at steps 84 and 86 based on the DY values derived at step 82. These factors take into account movement of objective optics 38 and 44 relative to the respective image sensors for the IR-RGB stereo image comparison, as well as changes in the wavelength of radiation source 32 for the IR-reference depth image comparison. In addition, the processor uses the DY model described above to estimate relative changes in the displacements of the subassemblies in assembly 24, giving an error value Berror (which may depend on local image coordinates), relative to the baseline value Bnom.
Processor 50 applies these factors in steps 88 and in computing DX corrections, i.e., X-direction relative shifts that are to be applied to the pixels in the IR-reference and IR-RGB stereoscopic depth computations. The corrected shift values xnom are given by:
Here dxmeas represents the measured X-direction disparity (shift) value at the pixel in question, measured at the coordinate xrealimage, taken relative to the image center x0 (for the IR camera) or the image or pattern center x1 (for the illumination subassembly or the RGB camera). The factor α represents the expansion or shrinking of the illumination subassembly or the RBG camera, while β represents the expansion or shrinking of the IR camera (due to focal length changes).
The processor updates the DY correction at step 92, as explained above.
Processor 50 uses the latest corrections generated by the process of
It will thus be appreciated that the embodiments described above are cited by way of example, and that the present invention is not limited to what has been particularly shown and described hereinabove. Rather, the scope of the present invention includes both combinations and subcombinations of the various features described hereinabove, as well as variations and modifications thereof which would occur to persons skilled in the art upon reading the foregoing description and which are not disclosed in the prior art.
This application claims the benefit of U.S. Provisional Patent Application 61/229,754, filed Jul. 30, 2009, which is incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61229754 | Jul 2009 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 12844864 | Jul 2010 | US |
Child | 15271398 | US |