Shape recovery of a single two-dimensional (2D) image is designed to derive a three-dimensional (3D) description of the image, wherein the recovered shape may be expressed in one of several ways, such as depth, surface normal, surface gradient, or surface slant and tilt. Shape recovery by surface normal reconstruction allows the normals of a 2D image to be constructed, for use in graphics applications such as re-lighting, texture-mapping, material editing and surface decoration. Here, each normal may be defined as a vector perpendicular to the tangent plane on the object surface, wherein the object surface is represented by the 2D image.
One approach to surface normal reconstruction is known as Shape-from-Shading (SfS), and involves computing surface normals from shading information in a single image. In one approach, SfS may be carried out by an automatic SfS algorithm applied to a single image. However, a disadvantage of Sfs is that SfS calculations may be error-prone due to the ill-posedness of the Sfs problem, in that restrictions and assumptions used in SfS algorithms may make them insufficient in producing high-quality surface normals.
Another approach to surface normal reconstruction is an interactive approach, in which a user specifies surface positions or absolute surface normals as constraints. However, a disadvantage of such interactive methods is that for an image with complex geometry and/or much high frequency data, a large number of constraints may need to be specified by the user, thereby making the method difficult and cumbersome.
Various embodiments related to the construction of a surface normal map are disclosed herein. For example, one disclosed embodiment comprises a method of constructing a surface normal map from a single image in which an initial surface map comprising initial surface normals is first determined, and then an input requesting manual modification of a set of normals in the initial surface map is received. Lastly, the set of surface normals is modified as requested by the input, to form the surface normal map.
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 to be used to limit the scope of the claimed subject matter. Furthermore, the claimed subject matter is not limited to implementations that solve any or all disadvantages noted in any part of this disclosure.
Next, at 104, method 100 comprises receiving an input requesting a manual modification of a set of normals in the initial surface normal map. Such a manual modification may be used to adjust or correct apparent errors present in the initial surface normal map resulting from the automatic computation. Method 100 then comprises, at 106, modifying the set of surface normals as requested by the input to form the surface normal map. In some embodiments, processes 104 and 106 may be accomplished via a user input received from a graphic user interface.
Method 100 provides for the convenience and automation of computational surface normal constructions, such as SfS processes, while allowing user control to adjust apparent errors in the normals, as allowed by user-defined surface normal reconstructions. As described below, errors from the SfS process may be more apparent in low frequency regions of the image than in high frequency regions. As such, the calculation of the initial surface normal map may provide satisfactory results in high frequency regions of an image. Therefore, the manual adjustment of the initial surface normal map to form the surface normal map may be limited to lower frequency regions of the image, which may allow the adjustments to be made in a relatively simple manner compared to methods in which all normals are manually defined.
Method 100 may be implemented in any suitable manner. One example of a suitable implementation of method 100 is shown in
In one embodiment of a SfS algorithm, the initial normal estimation follows the Lambertian assumption. In such an approach, the input image I may be defined by the following imaging model,
I=ρN
T
L,
where ρ is the surface albedo, N=(nx, ny, nz)T is a unit vector representing the surface normal, and L=(lx, ly, lz)T is a unit vector representing the direction of a distant light source. All the quantities on the right hand side of the above equation may be unknown. To obtain the lighting direction L, the approach involves a user assigning normals to a few pixels and minimizing the following energy:
where L is a set of user selected pixels and L′=ρL. In some embodiments, the user assigning normals to a few pixels comprises assigning normals to three or more pixels.
Continuing with the above imaging model, the unit lighting direction may be obtained by
Such an estimation may be performed a single iteration in some embodiments. Using the estimated L, the normals N and albedo ρ may be computed by minimizing the following energy:
where P is the user selected region to be processed, {i, j} is a first-order neighbor pair, λ is a regularization factor, and ρ′=ρ−1. The first term in the above energy function measures the fitness of the imaging model, and the second term enforces a smoothness constraint on the normals.
Since the above energy function may be a quadratic function, a Gauss-Seidel method may be used to minimize the energy with successive over-relaxation. In each iteration, the unit-length constraint of Ni may be enforced by re-projecting the updated Ni onto a unit sphere and ρ′ may be restricted in the range ρ′≧1 since 0≦ρ≦1.
The normal map generated by the minimization of energy E2 may have a bias toward the input lighting direction. The bias may be eased by evenly distributing the error. Method 200, at 204, therefore comprises reducing a bias of the initial surface normals toward a lighting direction by globally distributing the bias. Any suitable method may be used to reduce the bias. One such approach is a surface reconstruction method comprising applying an osculating arc constraint using a calculated height field, as shown in method 200 at 206.
To evenly distribute the error, such a height field may be constructed by minimizing the following energy, in which the lighting direction may be absent:
where hi and hj are the heights at i and j, and qij is the relative height between i and j on the surface. The height field, H is then a set of heights such that H={hi}. In other methods, qij may be calculated from the surface gradient
However, the gradient may be infinite when the normal is perpendicular to the viewing detection, such as when an occlusion boundary is manifested as the object's silhouette in 2D images. To avoid such gradients from approaching infinity, the relative height qij may be calculated directly from normals by using a smooth connection which is shown in
which may be typical of a complex surface containing orientation discontinuities. After surface reconstruction, the normal is recomputed directly from the height field.
Returning to
Method 200 next comprises, at 210, presenting the initial surface normal map on a graphical user interface configured to allow a user to modify the initial normal surface map. Such a manual editing process may allow the user to correct errors in the lower frequency regions, and additionally to further enhance higher frequency surface details if desired. Accordingly, method 200, at 212, comprises receiving input from the graphical user interface requesting manual modification of a set of normals in the initial surface map.
Lastly, method 200 at 214 comprises modifying the set of normals by propagating to the set of normals a rotation effect performed on the user interface. Since most noticeable errors in the initial normal map may lie in the lower frequency regions, normals may be manipulated by specifying a relative normal ΔN, ideally equal to N′-N, rather than working with absolute normals. Working with absolute normals may require the user to specify many constraints; therefore it may be easier for a user to specify constraints in a smooth, lower frequency, relative normal map. Such a specification may be performed by propagating a small number of user manipulations to the normal map.
Any suitable method may be used to construct the relative normals. In one such method, the user manipulates the normal N by a rotational transformation to produce the rotated normal N′=R(N; s, t), where s and t are the slant and tilt for the rotation. Such an approach may allow for easy user interaction on a 2D graphical user interface, as the user may simply draw points or strokes on a circle to provide a sample (s, t).
Formally, N is rotated by a rotation matrix R={r1, r2, v} where
a=(0, 0, 1) and v=(cos t sin s, sin t sin s, cos s)T, where (s, t) are specified by the user via a graphical user interface, as described at 212 in method 200. Furthermore, the user may only need to specify a sparse set of rotational transformations in terms of (s, t).
Such a rotation approach comprises an optimization method to propagate the user inputs. Any suitable optimization method may be used. One such approach comprises an optimization method to propagate the user inputs by minimizing the following energy function with respect to vi:
where v′i is the user selected rotation vector on a graphical user interface comprising a sphere image, μ is the set of user-specified pixels and β is a regularization factor which may be set to a fixed value of 0.005 in one embodiment. In other embodiments, the regularization factor may have a value in a range of 0.001 to 0.01.
Such a rotation approach may provide two types of user interaction for editing the initial normal map from a sphere palette interface, namely surface control and user embedding. Surface control comprises a user picking a point or drawing a stroke to specify the desired rotations from a sphere. The rotation effect may then be propagated by the above equation for E4. Detail embedding comprises the user enhancing surface details by selecting a region of interest from the input image. Image gradients inside this region may then be converted into a set of vectors,
where the corresponding normals are rotated by this set of vectors v. The normals may be updated by Ñ=(1−α)N+αN′ where N′ is the rotated N and α controls the contribution of the new normal. In some embodiments, α may be set to a fixed value of 0.2, while in other embodiments this term my have a value in a range of 0.1 to 0.5. Detail embedding may also be used to synthesize surface details when unwanted structures are removed.
Methods 100 and 200 may be implemented in any suitable use environment.
Image capture and processing system 400 further comprises computing device 410, which comprises memory 406 and logic subsystem 408. In some embodiments, computing device 410 may be a computer, such as a desktop computer, laptop computer, notebook computer, etc. In other embodiments, computing device 410 may be an on-board microprocessor on a digital camera, video camera, or other portable image capture device. Memory 406 may comprise instructions stored thereon that are executable to perform one or more of the methods disclosed herein.
Image capture and processing system 400 further comprises a display screen 404 for viewing images and for displaying a graphical user interface for manipulating an initial surface normal map. In some embodiments, display screen 404 may be a computer monitor or a projection screen. In other embodiments, display screen may be a monitor or viewing screen integrated with a camera, video camera or other portable image capture device.
Image capture and processing system 400 further comprises input device 412 for receiving input from the user. In some embodiments, input device 412 may be a mouse or touch-pad configured to allow a user to interact with a graphical user interface for modifying an initial surface normal map. In other embodiments, input device may be any other suitable input device, such as a touch screen input, etc.
Any suitable user interface may be used to allow a user to manipulate the initial surface normal map.
A user may manipulate initial surface normals on a surface normal map 506 by picking a point or drawing a stroke on the 2D view of a sphere 502. The initial surface normals are manipulated via a rotation specified by a rotational transformation calculated from the user input (s, t) on the 2D view of a sphere 502, as described above in method 200 at 214.
An example of how manipulations specified by the user on the 2D view of a sphere 502 are applied to the surface normal map 506 is as follows. From the definition of R as described above in method 200 at 214, the user selecting a vector at o on the 2D view of a sphere 502 produces zero rotation and likewise no manipulation of the initial surface normals in the surface normal map 506. However, the user moving along the line from o to e on the 2D view of a sphere 502, corresponds to moving along the pertinent arc of the sphere. Thus, as the length |oe| increases, the angle of rotation also increases while the axis of the rotation remains unchanged. Thus, the 2D view of a sphere 502 may provide a convenient means for the user to control the strength of the transformation, measured by |oe|, applied to the initial surface normals in the existing surface normal map 506.
After the user selects a set of inputs (s, t), each input resulting in a vector vi, a rotation effect may then be obtained as described in method 200 and 214 by minimizing an energy function E4 respect to vi. The rotation effect may then be propagated to the image. In one embodiment, the rotation effect may be propagated to whole image, such that the set of initial surface normals that are modified comprises all initial surface normals. In another embodiment, the rotation effect may be propagated to a user specified region of the image, such that the set of initial surface normals that are modified comprises a subset of the entire set of initial surface normals.
It will be appreciated that the computing device described herein may be any suitable computing device configured to execute the programs described herein. For example, the computing device may be a mainframe computer, personal computer, laptop computer, portable data assistant (PDA), computer-enabled wireless telephone, other suitable computing device, and/or combinations thereof. Such are configured to execute programs stored in non-volatile memory using portions of volatile memory and the processor. As used herein, the term “program” refers to software or firmware components that may be executed by, or utilized by, one or more computing devices described herein, and is meant to encompass individual or groups of executable files, data files, libraries, drivers, scripts, database records, etc. It will be appreciated that computer-readable media may be provided having program instructions stored thereon, which upon execution by a computing device, cause the computing device to execute the methods described above and cause operation of the systems described above.
It will be understood that the embodiments described herein are exemplary in nature, and that these specific embodiments or examples are not to be considered in a limiting sense, because numerous variations are contemplated. Accordingly, the present disclosure includes all novel and non-obvious combinations and sub-combinations of the various systems and methods disclosed herein, as well as any and all equivalents thereof.