Image Synthesis: CMPT 761 (Fall 2009)
Instructor: Dr. Torsten Möller
Final Project: An Ocularist's Approach to Human Iris Synthesis
Output of the project: different types of iris renderings |
Introduction
In this project I have investigated how PBRT could be used to render human iris using approaches similar to ocularists. An ocularist typically composites many semi-transparent painted layers to create a prosthetic iris. The painted layers look unrealistic by themselves but when they are composited with many other it provides a sense of depth and gives a convincingly realistic look. Lefohn et al. [1] have shown how computer graphics frameworks can be used to synthesize an iris similarly to ocularists. For this project, I have implemented the algorithm proposed by Lefohn et al. [1] with some deviations to allow PBRT to render an iris in reasonable time.
The Rendering Model
Lefohn et al. [1] proposed a simple geometric model of an eye
as depicted in Figure 1. Both sclera and the cornea are modeled using simple
spheres whose centers are placed approximately 4.7mm apart. As shown in Figure
1, the part of spheres C2 that sticks out of C1 serves as the cornea. The iris,
which is not shown in Figure 1, basically takes the shape of a flat cone
frustum, ie. a cone whose apex has been cut off, and sits below the cornea to
fill in the circle that is described by the intersection of C1 and C2. In the
paper, Lefohn et al. [1], proposed to model the iris by stacking several layers
of such cone frustums. Each layer of the cone frustum is texture mapped with an
opacity map chosen from Figure 2. As suggested by Lefohn et al. [1] , only the
tiles that are underlined by a bold white line were actually used. They also did
pointed out that the order in which the tiles can be chosen is free. However, in
my implementation I have used a probability model to select specific types of
tiles more often for a given type of iris (e.g. brown iris compared to blue
iris).
Implementation
In the first phase of the implementation I added a shape in PBRT
called "conefrustum," which is made by modifying the existing cone shape with
its apex chopped off. Extra care had to be taken so that rays which passes
through the top hole (where the apex resided in the original cone) can intersect
the inner wall. Next I transformed each tile of the pattern texture (see Figure
2) to the u and v parameter space of the cone. The following Figure shows one
example of such transformation:
Texture in canonical space
The same texture in the u,v space of a cone
Texture transformation into u,v space
IrisMaterial
One major assumption is made while implementing IrisMaterial:
the thickness of the overall iris is infinitesimally small. With this
assumption, volume rendering can be performed perpendicular to the surface of
the iris regardless of the incoming ray direction. However, taking the ray
direction into account is an easy extension, which will require changes in the
DifferentialGeometry class of PBRT to include a ray direction too. But, on the
other hand, infinitesimal thickness of the iris is not a very unfair assumption
and this makes implementation rather straightforward. IrisMaterial takes n
number of color and opacity textures as parameters and performs volume rendering
as illustrated in Figure 3.
Implementation Subtleties
Unfortunately, the opacity maps that I used from the paper are
of very low resolution and produce a blurry end image. To circumvent that, I
modified the transmittance equation as the following
Randomly Drawing Layer Patterns and Color
In their paper, Lefohn et al. [1] suggested that layers can be chosen in any order almost randomly. However, they did mention rather casually that for light colored iris, for example blue iris, sharper patterns (with high frequency) are chosen more often by the occularists. On the other hand, for darker iris, for example brown iris, smeared patters are chosen more often. To take these facts into account I designed a probability distribution function for the iris patterns ( see Figure 2 ). For light colored eye, the function is modeled such that high frequency patterns have higher probabilities compared to the smeared one and for darker eye its the opposite. A separate C/C++ program was made that generates a PBRT script for a particular type of iris by taking these probability distribution functions.
Unexpected Difficulties Faced
The main difficulty I faced was to collect the pattern texture. First of all, these pattern textures were taken directly from the paper of Lefohn et al. [1], as they were not available anywhere else, and therefore are in very low resolution. The second problem was; the pattern textures came on a big collage image (see Figure 2) and there would not be any fixed regular tile size that could be used to crop this image to extract the patterns. Each pattern had to be manually fixed so that the "apparent" center of all the patterns match up properly. This took unexpectedly longer time and was a bit frustrating as well. Since the textures were in low resolutions, extra efforts were made to sharpen them from within PBRT (as described above). The other difficulty I faced was to come up with a good probability function for the patterns to generate each type of iris.
Results
Following are the renditions of different types of iris.Conclusion
Although my original proposal was about rendering human skin and eye but unfortunately I didn't have the time to do both as I had a very strict TVCG paper deadline. Even more so, a proper skin rendering would also require me to model human face and I have no experience of working with any geometry modeling software. Since I had no group partner and considering the very limited time I had to work on this project I finally decided to do iris rendering only. As far as iris rendering is concerned I believe I have achieved some reasonable quality images. Previously, two more teams have worked on the same problem; one from Stanford and the other one from CMU. In both works, the authors have hand drawn the pattern textures which gave the final image a very synthetic look. Compared to their works, I believe my images look more convincing. The blurriness in my renditions is mainly due to the low resolution pattern textures. With higher resolution images, I believe I could have achieved the same realism as the Lefohn et al. [1].