An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face...

10
An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella 1,2 , Olac Fuentes 2 1 Universidad Popular Autónoma del Estado de Puebla 21 sur #1103 Col. Santiago Puebla 72160, México [email protected] 2 Instituto Nacional de Astrofísica Optica y Electrónica Luis Enrique Erro #1 Sta. María Tonantzintla Puebla 72840, México [email protected] Abstract. Image metamorphosis, commonly known as morphing, is a powerful tool for visual effects that consists of the fluid transformation of one digital image into another. There are many techniques for image metamorphosis, but in all of them there is a need for a person to supply the correspondence between the features in the source image and target image. In this paper we describe a method to perform the metamorphosis of face images in frontal view with uniform illumination automatically, using a generic model of a face and evolution strategies to find the features in both face images. 1 Introduction Image metamorphosis is a powerful tool for visual effects that consists of the fluid transformation of one digital image into another. This process, commonly known as morphing [1], has received much attention in recent years. This technique is used for visual effects in films and television [2, 3], and it is also used for recognition of faces and objects [4]. Image metamorphosis is performed by coupling image warping with color interpolation. Image warping applies 2D geometric transformations to images to retain geometric alignment between their features, while color interpolation blends their colors. The quality of a morphing sequence depends on the solution of three problems: feature specification, warp generation and transition control. Feature specification is performed by a person who chooses the correspondence between pairs of feature primitives. In actual morphing algorithms, meshes [3, 5, 6], line segments [7, 8, 9], or points [10, 11, 12] are used to determine feature positions in the images. Each primitive specifies an image feature, or landmark. Feature correspondence is then used to compute mapping functions that define the spatial relationship between all points in both images. These mapping functions are known as warp functions and are used to interpolate the positions of the features across the morph sequence. Once both images have been warped into alignment for intermediate feature positions, ordinary color interpolation (cross-dissolve) is performed to generate image morphing.

Transcript of An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face...

Page 1: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

An Approach to Automatic Morphing of Face Images in Frontal View

Vittorio Zanella1,2, Olac Fuentes2

1Universidad Popular Autónoma del Estado de Puebla 21 sur #1103 Col. Santiago Puebla 72160, México

[email protected] 2Instituto Nacional de Astrofísica Optica y Electrónica

Luis Enrique Erro #1 Sta. María Tonantzintla Puebla 72840, México [email protected]

Abstract. Image metamorphosis, commonly known as morphing, is a powerful tool for visual effects that consists of the fluid transformation of one digital image into another. There are many techniques for image metamorphosis, but in all of them there is a need for a person to supply the correspondence between the features in the source image and target image. In this paper we describe a method to perform the metamorphosis of face images in frontal view with uniform illumination automatically, using a generic model of a face and evolution strategies to find the features in both face images.

1 Introduction

Image metamorphosis is a powerful tool for visual effects that consists of the fluid transformation of one digital image into another. This process, commonly known as morphing [1], has received much attention in recent years. This technique is used for visual effects in films and television [2, 3], and it is also used for recognition of faces and objects [4]. Image metamorphosis is performed by coupling image warping with color interpolation. Image warping applies 2D geometric transformations to images to retain geometric alignment between their features, while color interpolation blends their colors. The quality of a morphing sequence depends on the solution of three problems: feature specification, warp generation and transition control. Feature specification is performed by a person who chooses the correspondence between pairs of feature primitives. In actual morphing algorithms, meshes [3, 5, 6], line segments [7, 8, 9], or points [10, 11, 12] are used to determine feature positions in the images. Each primitive specifies an image feature, or landmark. Feature correspondence is then used to compute mapping functions that define the spatial relationship between all points in both images. These mapping functions are known as warp functions and are used to interpolate the positions of the features across the morph sequence. Once both images have been warped into alignment for intermediate feature positions, ordinary color interpolation (cross-dissolve) is performed to generate image morphing.

Page 2: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

Transition control determines the rate of warping and color blending across the morph sequence. Feature specification is the most tedious aspect of morphing, since it requires a person to determine the landmarks in the images. A way to determine the landmarks automatically, without the participation of a human, would be desirable. In this sense, evolution strategies could be an efficient tool to solve this problem. In this work, we use evolutionary strategies and a generic model of the face to find the facial features and the spatial relationship between all points in both images, without the intervention of a human expert. We initially chose work with images of faces in frontal view with uniform illumination and without glasses and facial hair to simplify the problem.

2 Feature Specification

Many methods have been developed to extract facial features. Most of them are based on neural nets [13], geometrical features of images [14], and template matching methods [15, 16]. Unfortunately, most methods require significant human participation; for example in [14] a total of 1000 faces were measured, and the locations of 40 points on each face were recorded, to build the training set of faces. In this work we do not need a training set of faces to find the model, instead, we use a model of 73 points based on a simple parameterized face model [17], (Figure 1). The model does not rely on color or texture, it only uses information about the geometrical relationship among the elements of the face. For example, we use the fact that the eyes are always at the same level and above the mouth in a face in frontal view.

Fig. 1. The Face Model

The components of the face model that we used are the eyes, eyebrow, nose, mouth, forehead and chin.

Parameterized face model Our model

Page 3: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

2.1 Evolution Strategies

Evolutionary strategies are algorithms based on Darwin’s theory of natural evolution, which states that only the best individuals survive and reproduce. The procedure starts by choosing randomly a number of possible solutions within the search space in order to generate an initial population. Based on a fitness function calculated for each solution, the best members of the population are allowed to take part in reproduction, this procedure is called selection. Genetic operations are performed on individuals with the idea that evolved solutions should combine promising structures from their ancestors to produce an improved population. Usually two types of genetic operations are utilized: crossover and mutation. Crossover is the combination of information of two or more individuals and mutation is the modification of information from an individual. Our algorithm is a (1+1)-ES algorithm [18], i.e. the initial population is formed only by one individual (a face model) then mutation is the only operation utilized. The form of the individual is )),(,),,(),,(( 73732211 yxyxyxi K= , that corresponds the 73 points in the model. The mutation operation corresponds a one affine transformation with parameters sx, sy, tx, ty, where sx and sy are the scale parameters in x and y respectively, and to tx and ty are the translation parameters in x and y. Rotation in this case is not used because we assume that the images are in frontal view and not rotated. The mutation operation consists of modifying the translation and scale parameters. It adds normal random numbers with mean µ and standard deviation σ, N(µ,σ), in the following way:

)1,0(' Ntt xx += (1)

)1,0(' Ntt yy += (2)

)5.0,1(' Nss xx += (3)

)5.0,1(' Nss yy += (4)

Scale and translation are performed using the following matrix:

=1000000

'

'

y

x

ss

S (5)

and

=

1010001

''yx tt

T (6)

Page 4: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

In this way, we perform the following operations for each point in the model

( ) ( ) Syxyx ⋅=′′ 1,,1,, by the scale and ( ) ( ) Tyxyx ⋅=′′ 1,,1,, by the translation.

For the fitness function we need to find the binary image, and the contour image, corresponding to the source and target images. We use the fact that the images have uniform illumination; in this case most of the points in the image depict skin and then we can find the regions in the face that are darker than skin, for example the eyes or mouth. We segment the image using a threshold near the mean intensity of the pixels representing skin, for this, first we convert the original image into a gray scale image I, after that the threshold Th is calculated from the image histogram as follows:

=

=

⋅= 255

1

255

1

)(

)(

i

i

ih

iihTh (7)

where h(i) corresponds to the number of points with gray intensity i in the histogram of the image. The value of Th corresponds to the average value of the gray intensity of the image. With Th we find the eyes and mouth regions in the points with values least than Th, to find a binary image φ(I).

(a) (b)

Fig. 2. (a) Contours image (b) Binary image

Once we have the binary image and the contour image ϕ(I), obtained with the Canny operator, (Figure 2), we compute the following function:

)max( moutheyes AAFitness += . (8)

Where

Page 5: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

∫∫ ∫∫+=El ErR R

eyes dIIdIIA ))(())(( φφ . (9)

and

∫∫=MR

mouth dIIA ))((φ . (10)

The symbols REl , REr and RM, correspond to the left eye, right eye and mouth regions respectively, (see Figure 3).

After that the Fitness is found, we adjust the chin, forehead and the eyebrows, so that:

)max( foreheadchineyebrowns NPNPS ++= (11)

here

∫ ∫+=lEB EBrB B

eyebrowns dsIdsINP )()( ϕϕ (12)

∫ ∫+=+

FH CB B

foreheadchin dsIdsINP )()( ϕϕ (13)

Here BEBl, BEBr BFH and BC are the left eyebrow, right eyebrow, forehead and chin edges, ds, respectively and ϕ(I) is the contour image of image I , Figure 3.

Fig. 3. Regions and edges of the face model

This process is performed with the source image and the target image. The results are shown in Figures 4 and 5.

REl REr

BEBl BEBr

BC RM

BFH

Page 6: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

Fig. 4. The best individual adjusted to the segmented image

(a) (b) (c)

Fig. 5. (a) Fist individual, (b) Intermediate individual and (c) The best individual

3 Warp Generation

Once the model has been adjusted to the images, the next step is to perform image deformation, or warping, by mapping each feature in the source image to its correspondent feature in the target image. When we use point-based feature specification, we must deal with the problem of scattered data interpolation. The problem of scattered data interpolation is to find a real valued multivariate function interpolating a finite set of irregularly located data points [19]. For bivariate functions, this can be formulated as: Input: n data points (xi, yi), xi ∈ ℜ2, yi ∈ℜ , i=1, ..., n. Output: A continuous function f:ℜ2→ℜ interpolating the given data points, i.e. f(xi) = yi,, i =1, ..., n. In this work we use the inverse distance weighted interpolation method

Page 7: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

3.1 Inverse Distance Weighted Interpolation Method

In the inverse distance weighted interpolation method [19], for each data point pi, a local approximation fi(p):ℜ2→ℜ with fi(pi) = yi, i=1,..,n is determined. The interpolation function is a weighted average of these local approximations, with weights dependent on the distance from the observed point to the given points,

∑=

=n

i

ii fwf1

)()()( ppp (14)

Where fi(pi) = yi, i=1,..,n. wi:ℜ

2→ℜ is the weight function:

∑=

= n

j

j

iiw

1

)(

)()(

p

pp

σ

σ (15)

with

µσi

ipp

p−

=1

)( (16)

The exponent µ controls the smoothness of the interpolation.

4 Transition Control

For obtain the transition between the source image and the target image we use linear interpolation of their attributes. If IS and IT are the source and target images we generate the sequence of images Iλ , λ∈[0,1], such that

TS III ⋅+⋅−= λλλ )1( (17)

This method is called cross-dissolve.

5 Results

We tested the method with images of faces in frontal view with uniform illumination without glasses and facial hair. The run time on average is 30 seconds to perform the metamorphosis on a 2.0 Ghz Pentium IV machine with 128 Mb of RAM.

Page 8: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

The method finds a satisfactory individual in around 500 iterations. The results models are shown in Figures 6, 8 and 10 while Figure 7, 9 and 11 shows the morphing process between these images

6 Conclusions

We developed a method to perform the automatic morphing of face images using evolutionary strategies and a generic face model. We do not need a training set of faces for to obtain the model because we use a model based on a simple parameterized face model. The results are good although we worked with a simplified problem using only images of faces in frontal view and with uniform illumination. As to future work we plan to generalize the method work with images with non-uniform illumination or with rotated face images using, for example, symmetry-based algorithms [20, 21] to supply more information about the position of the face.

Fig. 6. Final individuals over the source and target images

Fig. 7. Resulting Face Image Morphing for images in Figure 6

Page 9: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

Fig. 8. Example 2

Fig. 9. Resulting Face Image Morphing for images in Figure 8

Fig. 10. Example 3

Fig. 11. Resulting Face Image Morphing for images in Figure 10

Page 10: An Approach to Automatic Morphing of Face Images in ...An Approach to Automatic Morphing of Face Images in Frontal View Vittorio Zanella1,2, Olac Fuentes2 1Universidad Popular Autónoma

References

1. G. Wolberg, Image Morphing: a Survey, The Visual Computer Vol. 14, 360-372,1998 2. P. Litwinowicz, & L.Williams, Animating Images with Drawings, Proceedings of the

SIGGRAPH Annual Conference on Computer Graphics, 409-412, 1994 3. G. Wolberg, Digital Image Warping, IEEE Computer Society Press, Los Alamitos CA.,

1990 4. Bichsel, Automatic Interpolation and Recognition of Face Images by Morphing, The 2nd

International Conference on Automatic Face and Gesture Recognition. IEEE Computer Society Press, Los Alamitos, CA, 128-135, October 1996

5. W. Aaron, et al., Multiresolution Mesh Morphing, Proceedings of the SIGGRAPH Annual Conference on Computer Graphics, 343-350, August 1999.

6. G. Wolberg, Recent Avances in Image Morphing, Computer Graphics International, Pohang Korea, June 1996

7. T. Beier, & N. Shawn, Feature-Based Image Metamorphosis, Proceedings of the SIGGRAPH Annual Conference on Computer Graphics,Vol. 26, No. 2, 35-42, July 1992.

8. S. Lee, K. Chwa, & S. Shin, Image Metamorphosis Using Snakes and Free-Form Deformations, In Robert Cook, editor, SIGGRAPH 95 Conference Proceedings, Annual Conference Series, pages 439--448. ACM SIGGRAPH, Addison Wesley, August 1995.

9. S. Lee et al., Image Metamorphosis with Scattered Feature Constraints, IEEE Transactions on Visualization and Computer Graphics, 2:337--354, 1996.

10. Nur, et al., Image Warping by Radial Basis Functions: Aplications to Facial Expressions, CVGIP: Graph Models Image Processing, Vol.56, No. 2, 161-172, 1994

11. S. Lee, et al., Image Morphing Using Deformable Surfaces, Proceedings of the Computer Animation Conference, IEEE Computer Society, 31-39, May 1994

12. S. Lee, et al., Image Morphing Using Deformation Techniques, J. Visualization Comp. Anim. No.7, 3-231, 1996

13. N. Intrator, D. Reisfeld, & Y. Yeshurun, Extraction of Facial Features for Recognition using Neural Networks, Proceedings of the International Workshop on Automatic Face and Gesture Recognition, Zurich, 260-265, 1995.

14. Craw, D. Tock and A. Bennett, Finding Face Features, Proceedings of the European Conference on Computer Vision, ECCV-92, Ed. G. Sandini, 92-96, Springer-Verlag 1992

15. M. J. T. Reinders. Model Adaptation for Image Coding. PhD thesis, Delft University of Technology, Delft, The Netherlands, Dec. 1995.

16. T.Cootes, A.Hill, C.Taylor and J.Haslam, Use of Active Shape Models for Locating Structures in Medical Images. Image and Vision Computing, 12(6):1994, 355-366.

17. Parke Federic I. and Waters Keith, Computer Facial Animation, AK Peters Wellesley, Massachusetts, 1996.

18. Back T., Rudolph Gunter, Schwefel Hans-Paul, Evolutionary Programming and Evolution Strategies: Similarities and Differences, Proccedings of the second Annual Conference on Evolutionary Programming, pp 11-22, Evolutionary Programming Society, San Diego CA. 1993

19. D. Ruprecht and H. Muller, Image warping with scattered data interpolation. IEEE Computer Graphics and Applications, 15(2), 37-43. 1995.

20. D. O’Mara, & R. Owens, Measuring Bilateral Symmetry in Digital Images, TENCON Digital Signal Processing Applications, Piscataway, U.S.A., IEEE 1996.

21. D. Reinsfeld, H. Wolfson, & Y. Yeshrum, Context Free Attentional Operators: The Generalized Symmetry Transform, International Journal of Computer Vision, Vol 14, 119-130,1995.