Occlusion handling is one of the major challenges in stereo imaging. For a two-frame stereo system, a point in an image is occluded if its corresponding point is invisible in the other image. Occlusions must be computed to allow combination of left and right images. However, computation of occlusions in stereo images is ambiguous and can produce defective images.
The handling of occlusions in stereo imaging is described. In one implementation, an initial estimate of a disparity and occlusions between first and second stereo images is made. Patches are formed in the stereo images, wherein the patches are formed using a relationship between an occlusion in the first stereo image and a discontinuity in the second stereo image. An energy value is computed in an iterative manner, wherein the energy computation is based on a current solution indicated by disparities and occlusions of the patches formed. Where the energy value has decreased from a previous iteration, a change is made to the current solution. In to the current solution. In one example implementation, the change includes an alpha-move, wherein disparities and occlusions in some patches are set to the alpha value, which is changed with each iteration. When the energy value fails to decrease, the disparities and occlusions of patches within the stereo image pair have been determined, and can be easily obtained at the pixel level.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended for use as an aid in determining the scope of the claimed subject matter.
The detailed description is described with reference to the accompanying figures. In the figures, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. The use of the same reference numbers in different figures indicates similar or identical items.
Overview
Occlusion handling is one of the major challenges in stereo imaging. For a two-frame stereo system, a point in a first image is occluded if its corresponding point is invisible in a corresponding second image. Aspects of the disclosed system and method of handling occlusion are consistent with the observation that an occlusion border in one image corresponds to a discontinuity in the corresponding image, and that the discontinuity often results in strong texture on the other image that can be achieved by color segmentation. Therefore, the disclosed system and method introduces a framework that can use the segmentation of one image to help compute the occlusion in the other.
Some embodiments described herein use segmentation of both the left and right images, and they use a patch-based framework to handle occlusions explicitly. Accordingly, the concept of patch is introduced, which is based in part on the observation that the shared edge of a visible area and an occluded area corresponds to a discontinuity in the other image. Thus, both images may be segmented, and the segment of one image may be warped to the other image according to a disparity. The warped segment may then be divided into patches using the segment boundaries in the other image. In one implementation, the boundary of an occlusion is constrained to be the boundary of one or more patches, and a symmetric global framework utilizing graph cuts is constructed to find the disparity and occlusions simultaneously embodied by the patch.
To summarize certain aspects of
Labeling System
In one implementation, an aspect of occlusion handling involves a formal formulation of a labeling system sufficient to address the stereo problem. In one example of this formulation, let L and R be the set of pixels in the left and right images respectively, and let P=L∪R. A pixel in the left image will have coordinate (px,py), and a corresponding pixel in the right image will have coordinate (px′,py′). In this example, the stereo problem is formulated as a labeling problem, in which each pixel p∈P must be assigned a label fp within some label set L. That is, in one implementation a goal is to find a labeling configuration f that assigns each pixel p∈P a label fp∈L. Accordingly, the labeling configuration f defines the disparity between the two stereo images.
To describe the generally slanted plane, a 3-parameter linear transform can be used, wherein parameters of the linear transform are used as the definition of labels, i.e.
where
means that p and p′ are corresponding points if a label <c1,c2,c3> is assigned to both of them. Alternatively, if a point from a first image is occluded in the second image, the point's label is φ.
A second aspect of occlusion handling involves the patch and visibility consistency. In order to find the labels for all the points that are mostly accordant to the input stereo image pair, prior assumptions may be employed, e.g. a smoothness assumption and uniqueness constraints. In implementations involving segment-based algorithms, a discontinuity assumption may be used. However, the border of segments in one image is not always the border of occlusion in the other image, and the shared edge of a visible area and an occluded area may not always correspond to a discontinuity of the other image. Therefore, in one implementation, the segments of one image may be separated into patches by mapping the discontinuity from the other image. Such an implementation may impose a new constraint to enforce the same visibility for all the pixels within each patch.
More particularly, suppose that a segment r is a region in the left image, image, and its label is denoted as fr. If fr=φ, which means that r is fully occluded, the region may be considered in its entirety. If the region r is not fully occluded, all the points in r are warped into a second image (see to the right in
The definition of patch is symmetric, i.e. the patches in the right image can be similarly defined. For example in
Using the patch-consistency constraint, the label configuration can be reformulated in a segment-patch level. That is, for each segment r in either image, the segment may be assigned a label fr∈L, and if fr≠φ, an equal number of visibilities vr(i) may also be assigned, denoted for example as vr(qr(i)) for each patch of r. The i-th patch of r is visible if vr(i)=1 and is otherwise occluded. Additionally, the configuration is constrained to be regular, i.e., the visible patches in the configuration are paired. For example in
Accordingly, the following notation allows the label of each point to be computed as:
For convenience, the informal notation f will be used to denote the configuration in a segment-patch level in the rest of the disclosure.
A third aspect of occlusion handling involves an energy function. In one implementation, the optimal configuration under an energy minimization framework may be computed as follows:
The term Edata(f) is the energy of matching errors for each visible patch, and is defined as:
where T(•) equals 1 if the argument holds and otherwise 0, and εpoint(p,p′) is the intensity difference between point p in the one image and point p′ in the other image.
The term Esmooth(f) exploits smoothness assumptions. If two connected patches with the same label contain different visibility, a penalty may be imposed. The selection of this smoothness term affects whether the energy can be minimized efficiently by graph-cuts.
The term Eoccl(f) provides penalties to occluded pixels. This prevents a trivial configuration wherein all pixels are occluded from taking the least energy. The term is defined as:
where Co is an occlusion constant controlling the weight of occlusion energy in the summation and Sa(r) is the area (the number of points) in r.
Energy Minimization
Patches are generated by warping the segment according to its label, but the label of a segment is unknown before matching. Accordingly, a global framework is disclosed, which allows computation of labels of segments and the visibility of each patch simultaneously.
An aspect of energy minimization involves an α-expansion framework. A segment can have |L| possible labels, and the separation of the segment into patches is generally different under each label. Accordingly, the searching space is huge; therefore, it is impractical to search the optimal result directly. In one implementation, it is convenient to use the α-expansion framework proposed by Boykov et al to solve the problem. In such an implementation, the problem is solved in an iterative style, and a strong local minimum is obtained in each iteration. Upon convergence, the global minimum is obtained.
In such an implementation, a configuration with all segments occluded is the starting point. Within each iteration, a label α is chosen, and a local minimum within one α-expansion is computed using graph-cuts. If no label can further decrease the energy, the final minimized configuration has been obtained. If a configuration is within an α-expansion of f, a segment can only have one of the following three choices: the first is that the segment maintains its current label in f; the second is that the segment may become occluded; the third is that the segment may change its label to α, and the configuration should keep to be regular.
In a further example, the energy minimization may be performed using a binary-variable energy term. In particular, a calculation converts the minimization of E(f) in each iteration (α-expansion calculation) into a minimization of a binary-variable energy, so that the latter minimization can be performed by graph-cuts.
In some implementations, the segments are classified into two classes according to their labels before expansion. In a first classification, for each segment r in either image, fr∉{φ,α}, a labeling variable lr is allocated to decide the label of r after expansion, which may be denoted as {tilde over (f)}r. The relation between lr and {tilde over (f)}r may be defined as:
Whether fr equals φ is determined by the visibility of the patches. Suppose that the number of segments r within patches labeled fr and α are Nr0 and Nrα respectively. The visibility of the patches may be determined according to the following two cases. In a first case, if r is in the left image, the term Nr0 may be used to allocate visibility variables, br0(i), indicating visibilities of patches under the label fr when lr=0, and {tilde over (v)}r(i)=1−br0(i). An allocation can be made according to: Nrα visibility variables, brα(i), indicating visibilities of patches under the label α when lr=1, and define {tilde over (v)}r(i)=brα(i). In a second case, if r is in the right image, new binary variables do not have to be allocated, and the correct binary variables do not have to be allocated for segments in the left image to indicate the visibility of the patches. The same notation may be used for those chosen visibility variables.
In a second classification, for each segment r⊂P, fr∈{φ,α}, labeling variable is not necessary, only visibility variables brα(i) are allocated. The set of all binary variables is denoted as V={lr,br0(i),brα(i)}.
Some implementations apply other constraints for values of V. If lr≠0, it may be required that ∀br0(i)≠0, and if lr≠1, ∀brα(i)≠1. If this requirement is satisfied, then V is regular; otherwise, V is irregular. When V is regular, the corresponding configuration may be denoted as f(V).
The α-expansion calculation can be performed by minimizing the following energy function of binary variables:
The term Eb(V) can be rewritten as the sum of the following terms:
Eb(V)=Eregb(V)+Edatab(V)+Esmoothb(V)+Eocclb(V)
The term Ereg(V) takes an infinite value if V is not regular, and 0 otherwise. The term Ereg(V) can be written from the definition of regular V:
The terms Edatab and Eocclb can be trivially derived from the definition of Edata and Eoccl. The visibility variables are assignment-like variables. The similar smoothness energy function is:
where Nq is the set of neighboring patches of q with the same label as q, Sc(q,qn) is the length of shared border of q and qn, bq is the visibility variable corresponding to patch q, and Cs is a smoothness constant controlling the balance of smoothness with other energy. The equivalent Esmooth is
where Nq0 is the set of neighboring patches of q.
A still further aspect of energy minimization involves the regularity of the energy function. The term Eb(V) can be trivially rewritten as the sum of energy items up to 2 variables at a time, i.e:
Accordingly, the term obeys the regularity inequality introduced by Kolmogorov and Zabih. Moreover, the results of Kolmogorov and Zabih can be used to compute the minimization of Eb(V).
Left image segmentors 402, 404 can be configured as a computer subroutines or procedures, and are configured to segment the left image 110. In particular, two levels of segmentation are produced—e.g. a coarse segmentation 406 and a fine segmentation 408 are produced. The coarse segmentation 406 of the left image 110 includes relatively large segments, and is sent to the label selector 414. The coarse segmentation 406 can be made in a number of different ways, such as by using a mean-shift segmentation algorithm. An example of the relatively large segments resulting from the coarse segmentation is seen in
The label selector 414 is configured to receive the coarse (large) segmentation 406 of the left image 110, and to employ a labeling algorithm to get a coarse estimation of the solution space. The course estimation will reduce the search range subsequently encountered by the energy minimization framework. The labeling problem can be formulated as a discrete optimization problem, which finds the optimal solution in a discrete space. Accordingly, the disparity selection routine of the label selector 414 increases efficiency by confining the solution to a smaller space.
The correspondence problem in stereo imaging can be formulated as a discrete optimization problem, which finds the optimal solution in a discrete space using the energy minimization routine 416. The label selector 414 is implemented to implemented to help this optimization or energy minimization routine 416 to search within a smaller solution space at greater speed. In one example of the label selector 414, a Sum-of-Absolute-Difference (SAD) algorithm, such as Birthfield and Tomas's dissimilarity algorithm, together with a cross-checking algorithm, may be used to find disparities of reliable points. A plane fitting is configured to select the label set L. Thus, the label selector reduces the search range addressed by the α-expansion framework in the subsequent energy minimization routine 416.
A fine image segmentor 404 is configured to create a finer (i.e. more detailed) segmentation 408 of the left image 110, such as that seen in
The energy minimization routine 416 may be configured to use an iterative process to compute the optimal solution for computing disparity and occlusion for patches. In one implementation, the energy minimization routine 416 is configured according to the description in the section “Energy Minimization,” above. For example, the energy minimization calculations may be performed by an α-expansion framework described above. Each iteration of the framework can be considered an alpha-move of the configuration, wherein the configuration is the labeling result or the solution of the optimization problem. Each iteration additionally computes the minimal energy value of the current iteration. At block 418 it is determined whether this minimum is smaller than that of the current solution, the iteration continues; otherwise, iteration is stopped. Within each alpha-move the Within each alpha-move the problem is reformulated into a binary-variable energy minimization framework, which can be optimized by graph cuts under the condition of regularity, which is a classical optimization algorithm. Accordingly, the energy minimization routine 416 calculates the disparity and occlusion of each patch.
At block 420, the disparity and occlusion of each pixel are computed simultaneously according to the labeling result from the energy minimization routine 416. The result of the block 416 is a value for the disparity of each patch. Accordingly, at block 420 the disparity for each pixel is computed.
An aspect of the implementation of the algorithm involves parameter selection. In particular, selection of two parameters may be considered, including the smoothness constant Cs and occlusion constant Co. In some applications, Cs is sensitive to input images. Accordingly, a modification to the method may be used to select the value automatically, thereby making the algorithm more adaptive.
One example strategy for making the selection is implemented according to the following analysis. The data error energy is used to select the correctly matched patch pair, which contains the least SAD error in noise free situation. Noise may cause an incorrect patch to have smaller errors than the correct patch. However, the incorrect patch is often inconsistent with the neighbors. Smoothness energy is used to punish the inconsistency and reject the wrong match. Therefore, in some implementations, a larger constant is selected for a greater noise level.
The noise level is estimated using the disparity map of reliable points in the label selection step. For each reliable point, a matching error ε may be computed, and the average of all matching errors
At block 602, first and second stereo images are segmented. In one example implementation, a coarse segmentation is applied to one stereo image, e.g. the left image. An example of this result is seen in
At block 608, an initial estimate of the disparity and/or occlusion between first and second stereo images is made. In the example of
At block 610, patches are formed in the stereo images, wherein patches are formed using a relationship between an occlusion in the first stereo image and a discontinuity in the second stereo image. The formation of patches can be performed symmetrically, i.e. patches may be formed in a second stereo image in the same manner that patches are formed in the first stereo image. Several example Several example implementations of the formation of patches are disclosed at blocks 612-620. These examples are considered representative of the concepts involved. Accordingly, other implementations consistent with the teachings herein are possible.
The example of forming patches seen at blocks 612-616 can be understood with reference to
A further example wherein patches are formed is seen at block 618. In this example, a discontinuity within a second stereo image is mapped into a first stereo image. The mapping forms a portion of a boundary of an occlusion in the first stereo image. Accordingly, the example illustrates a relationship between a discontinuity in the second stereo image and the border of an occlusion in a first stereo image.
A still further example wherein patches are formed is seen at block 620. In this example, a segment in a first stereo image is divided into patches separated by a portion of a boundary between two segments mapped from a second stereo image. Referring to the example of
At block 622 an energy value is optimized within one alpha-expansion move, such as by using graph cuts. The optimization is performed based on a current solution, wherein the current solution is indicated by disparities and occlusions of the patches formed. Thus, the optimal configuration within one alpha-expansion move is obtained. Blocks 624-628 show example implementations wherein the energy value is optimized within one alpha-expansion move. In the example of block 624, energy is computed according to the description in the section “Energy Minimization,” above. In the example of block 626, the calculation is made in a manner that constrains the patches to be fully occluded or fully visible. In the example of block 628, energy is minimized by graph-cuts within one alpha-expansion move at the current setting of alpha-value. The optimal solution from calculations based on graph cuts may include disparities and occlusions defined at a patch level.
At block 630, a determination is made if the minimum energy of the alpha expansion move is smaller than the energy of the current solution. That is, a determination is made to see if any alpha value from a discrete set of values has smaller energy than the current solution. If the minimum energy is smaller than the energy of the current solution, then at block 632 the current solution (i.e. the configuration or labeling result or the solution to the optimizing problem) is replaced with the optimal results from the alpha-expansion move.
Alternatively, at block 634, a determination is made if all of the possible values for alpha have been tried. Recall that a discrete number of values of alpha may be used. If another value for alpha is available, the algorithm loops back to block 622. If not, the algorithm proceeds to block 636.
At block 636, the disparities and occlusions of the pixels are output. In one implementation, the disparities and the occlusions at the patch level are used to obtain disparities and occlusions of individual pixels. Knowing the disparities and occlusions of individual pixels allows the stereo images to be better utilized. For example, this information allows the images to be combined more effectively.
At block 704, energy is optimized in one alpha-expansion move. In the example of
At block 706, a comparison between the minimum energy of the alpha-expansion move and the energy of the current solution. If the energy of the alpha-expansion move is smaller than the energy of the current solution, then at block 708 the current solution (i.e. configuration) is replaced with the optimal results from one alpha-expansion move. Accordingly, it can be seen that the formation of patches and the energy minimization are not divided into clearly separate stages. In the energy minimization, one labeling result is selected initially. Given this labeling result, the segment can be warped from one image to the other image, facilitating formation of patches. A computation may then be made of the energy. Results of the energy computation can be used to validate a patch. That is, an energy term having a lower value will result if the constraints indicate a valid patch. If the energy is large, the current solution may be updated, thereby becoming a new solution. Energy calculations based on successive new solutions will executed until the energy achieves the global minimum. In the process of making energy calculations, the occlusion result is also derived, since the energy term is defined based on a visibility variable. Accordingly, the occlusion and disparity can be considered to have been derived simultaneously. In fact, obtaining the optimal solution results in the occlusion result, the disparity and a valid construction of the patches.
At block 710, a check is made to determine if all of the values for alpha have been tried. Recall that within the solution set or solution space alpha may comprise a set of discrete values. For example, a set containing possible labeling values may be {0, 1, 2, 3, 4}. Accordingly, the check at block 710 determines if all values within the discrete set have been tried. If not, at block 712 alpha is set to another value and energy calculations are again made at block 704. If so, the If so, the disparities and occlusions are output at the patch level at block 714.
Computing Environment
Computer 802 typically includes a variety of computer readable media. Such media can be any available media that is accessible by computer 802 and includes both volatile and non-volatile media, removable and non-removable media. The system memory 806 includes computer readable media in the form of volatile memory, such as random access memory (RAM) 810, and/or non-volatile memory, such as read only memory (ROM) 812. A basic input/output system (BIOS) 814, containing the basic routines that help to transfer information between elements within computer 802, such as during start-up, is stored in ROM 812. RAM 810 typically contains data and/or program modules that are immediately accessible to and/or presently operated on by the processing unit 804.
Computer 802 can also include other removable/non-removable, volatile/non-volatile computer storage media. By way of example,
The disk drives and their associated computer-readable media provide non-volatile storage of computer readable instructions, data structures, program modules, and other data for computer 802. Although the example illustrates a hard disk 816, a removable magnetic disk 820, and a removable optical disk 824, it is to be appreciated that other types of computer readable media that can store data that is accessible by a computer, such as magnetic cassettes or other magnetic storage devices, flash memory cards, CD-ROM, digital versatile disks (DVD) or other optical storage, random access memories (RAM), read only memories (ROM), electrically erasable programmable read-only memory (EEPROM), and the like, can also be utilized to implement the exemplary computing system and environment.
Any number of program modules can be stored on the hard disk 816, magnetic disk 820, optical disk 824, ROM 812, and/or RAM 810, including by way of example, an operating system 826, one or more application programs 828, other other program modules 830, and program data 832. Each of such operating system 826, one or more application programs 828, other program modules 830, and program data 832 (or some combination thereof) may include an embodiment of a caching scheme for user network access information. In one implementation, instructions for use in handling occlusions in stereo imaging could be stored as an application program in disk area 828.
Computer 802 can include a variety of computer/processor readable media identified as communication media. Communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared, and other wireless media. Combinations of any of the above are also included within the scope of computer readable media.
A user can enter commands and information into computer system 802 via input devices such as a keyboard 834 and a pointing device 836 (e.g., a “mouse”). These and other input devices are connected to the processing unit 804 via input/output interfaces 840 that are coupled to the system bus 808, but may be connected by other interface and bus structures, such as a parallel port, game port, or a universal serial bus (USB).
A monitor 842 or other type of display device can also be connected to the system bus 808 via an interface, such as a video adapter 844. In addition to the monitor 844, other output peripheral devices can include components such as speakers (not shown) and a printer 846 that can be connected to computer 802 via the input/output interfaces 840.
Although aspects of this disclosure include language specifically describing structural and/or methodological features of preferred embodiments, it is to be understood that the appended claims are not limited to the specific features or acts described. Rather, the specific features and acts are disclosed only as exemplary implementations, and are representative of more general concepts. For example, while reference has been made to “left” or “right” images, it is clear that reversing the images used in different steps and/or situations is clearly anticipated.
This patent application claims priority to related U.S. patent application Ser. No. 60/726,710, titled “A Symmetric Patch-Based Correspondence Model for Occlusion Handling”, filed on Oct. 14, 2005, commonly assigned herewith, and hereby incorporated by reference.
Number | Date | Country | |
---|---|---|---|
60726710 | Oct 2005 | US |