project image morphing presented by sharmila gupta

52
Project Image Morphing Presented By Sharmila Gupta

Upload: regina-wilson

Post on 21-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Project Image Morphing Presented By Sharmila Gupta

Project Image Morphing

Presented By

Sharmila Gupta

Page 2: Project Image Morphing Presented By Sharmila Gupta

Digital Image Manipulation

Compositing

Convolution

Dithering

Warping

Interpolation/ Extrapolation

Morphing

Simple pixel Modification

Page 3: Project Image Morphing Presented By Sharmila Gupta

Simple Pixel Modification

Convert to Gray f(r,g,b) = .3r + .52g + 10b

Invert f(v) = 1-v

Brighten/darken f(v) = ßv for ß >= 0

Threshold if v > threshold then f(v) = 1 else f(v) = 0

Applying same degree of change in every pixel

Page 4: Project Image Morphing Presented By Sharmila Gupta

Image Interpolation/Extrapolation

Change Contrast

Change Saturation

Original More Contrast Less Contrast

Offers a general, unifying approach to many common point and area image processing operations.

Brightness, contrast, saturation, tint, and sharpness can all be controlled with one formula, separately or simultaneously.

Original More Saturated Less Saturated

Page 5: Project Image Morphing Presented By Sharmila Gupta

Image Interpolation/Extrapolation

Brighten/darken

Noise removal

Original More Bright Less Bright

median filtered imageImage with “impulse” noise

Page 6: Project Image Morphing Presented By Sharmila Gupta

Compositing

Compisiting images involves combining separate image layers into one

Layers may be moved and arranged.

CompositeOriginal

Page 7: Project Image Morphing Presented By Sharmila Gupta

Convolution

Edge Enhancement

Blur-ness

Original Edge Defined

De-blurredBlurred

Used for different image processing, removing blur-ness, defining edge, restore special effect by filtering, masking or other technique.

Page 8: Project Image Morphing Presented By Sharmila Gupta

DitheringMonitors and image files limited to 256 colors can create the illusion of more colors by Dithering the available colors in a scattered pattern, approximating the desired color. Image editors often use dithering to convert true color images to indexed color images.

True-color Image Dithered Image

Page 9: Project Image Morphing Presented By Sharmila Gupta

What is Image Morphing?

Page 10: Project Image Morphing Presented By Sharmila Gupta

It comes from the word Metamorphosis

Metamorphosis: Change shape, size, form or appearance

Image Morphing

Page 11: Project Image Morphing Presented By Sharmila Gupta

Transition from one object to another

What is Image Morphing ?

Morphing can be defined as:

Process of transforming one image into another.

An animation technique that allows you to blend two still images, creating a sequence of in – between pictures that when played in Quick Time, metamorphoses the first image into the second.

Page 12: Project Image Morphing Presented By Sharmila Gupta

A process of transforming two images where it seems like the first melts, dissolves and re-arranges itself to become the second one

What is Image Morphing ?contd..

Page 13: Project Image Morphing Presented By Sharmila Gupta

How is Morphing done?

Page 14: Project Image Morphing Presented By Sharmila Gupta

First image is gradually distorted and is faded out

General View

The second image starts out totally distorted toward the first and is faded in.

It is broadly two-step process:

Page 15: Project Image Morphing Presented By Sharmila Gupta

Classification of MorphingMorphing classified into three types

Image-based Method

Volume-based approaches

Boundary representations (B-rep) -based approaches

Page 16: Project Image Morphing Presented By Sharmila Gupta

WarpingWarping two images to make them having the same shape

Image-based Morphing

Cross dissolvingCross dissolving the resulting images

Two steps are:

Page 17: Project Image Morphing Presented By Sharmila Gupta

Image-based Morphing

WARPING ?

Page 18: Project Image Morphing Presented By Sharmila Gupta

Image-Based Morphing - Warping

Warping an image means apply a given deformation to it

Two ways to warp an image:

A warp is a 2-D geometric transformation and generates a distorted image when it is applied to an image

Forward Mapping

Reverse Mapping

Page 19: Project Image Morphing Presented By Sharmila Gupta

Forward Mapping

Each pixel in the source image is mapped to an appropriate pixel in the destination image.

Some pixels in the destination image may not be mapped

Source Image

Source Image

Destination Image

Destination Image

Page 20: Project Image Morphing Presented By Sharmila Gupta

Reverse Mapping

This method goes through each pixel in the destination image and samples an appropriate source image pixel

All destination image pixels are mapped to some source image pixel.

This mapping used in the Beier/Neely line morphing method.

Page 21: Project Image Morphing Presented By Sharmila Gupta

Cross Dissolving A cross-dissolve is a sequence of images which

implements a gradual fade from one to the other.

Very primitive

No smooth transition

Page 22: Project Image Morphing Presented By Sharmila Gupta

Image-based Morphing - Example

Page 23: Project Image Morphing Presented By Sharmila Gupta

Image-based Morphing - Example

Do Morphing

Source Image Destination Image

Page 24: Project Image Morphing Presented By Sharmila Gupta

Image-based Morphing - Example

Baby to Grandpa Morphing

Groom to Bride Compositing

Warping

Page 25: Project Image Morphing Presented By Sharmila Gupta

Image-Based Morphing - Other option ! Better option than Cross - Dissolving:

Field/Line Morphing

Mesh Mapping

Multilevel Free-form Deformation (MFFD)

Page 26: Project Image Morphing Presented By Sharmila Gupta

Field/Line Morphing

What pixel coordinate in the source image do we sample for each pixel in destination image ?

Correspondence achieved using feature line(s) in source and destination images

Source Image Destination Image

Page 27: Project Image Morphing Presented By Sharmila Gupta

Field/Line Morphing

Two step process

Step I : Interpolating the lines: Interpolate the coordinates of the end points of every

pair of lines.

Step II : Warping the Images: Each of the source images has to be deformed towards the needed frame. The deformation works pixel by pixel is based on the reverse mapping. This algorithm is called Beier-Neely Algorithm.

Page 28: Project Image Morphing Presented By Sharmila Gupta

BEIER-NEELY ALGORITHM

Divide the two image to be morphed into lines

Page 29: Project Image Morphing Presented By Sharmila Gupta

Create Intermediate Morph for both images

BEIER-NEELY ALGORITHM (contd.)

Intermediate Morph ? Use corresponding lines in both the images to redefine a new

position for each pixel according to a parameter t If t = 0 for First image and t = 1 for Second Image then

Intermediate Morph: 0<t<1

Page 30: Project Image Morphing Presented By Sharmila Gupta

BEIER-NEELY ALGORITHM (contd.) Compute line endpoints in the intermediate morph

A = endpoint of a line in First image

B = endpoint of a line in Second image

AB = endpoint of the line in Intermediate image = (1-t)*A+t*B

Use Field Morphing to warp First Image according to intermediate line endpoints

Use Field Morphing to warp Second Image according to intermediate line endpoints

Cross-Dissolve the warped images using t to define weighted pixel average

Page 31: Project Image Morphing Presented By Sharmila Gupta

BEIER-NEELY ALGORITHM (contd.)

Cross Dissolve the intermediate warped images

Warped First Image Warped Second Image

Page 32: Project Image Morphing Presented By Sharmila Gupta

BEIER-NEELY ALGORITHM - PIXEL POSITION1) Compute position of pixel X in destination image

relative to the line drawn in destination image.(x,y) (u,v)

X

P

Q

P’

Q’

u

v

Destination Image Source Image

Page 33: Project Image Morphing Presented By Sharmila Gupta

Compute coordinates of pixel in source image whose position relative to the line drawn in source image is (u,v). (u,v) (x’,y’)

X

P

Q

P’

Q’

u

v

u

v

Destination Image Source Image

BEIER-NEELY ALGORITHM - PIXEL POSITION

Page 34: Project Image Morphing Presented By Sharmila Gupta

Computation of pixel X with respect to Line

X (x,y)

P (px,py)

Q (qx,qy)

u

v

Destination Image

(x,y) (u,v)(x-px)(qx-px)+(y-py)(qy-

py)

(X-P).(Q-P)

||(Q-P)||2

(X-P).Perpendicular(Q-P)

||(Q-P)||

(qx-px)+(qy-py)

(qy-py, -qx+px)

BEIER-NEELY ALGORITHM - PIXEL POSITION

Page 35: Project Image Morphing Presented By Sharmila Gupta

BEIER-NEELY ALGORITHM-WEIGHTED AVG. Computation of weighted pixel average

X (x,y)

P (px,py)

Q (qx,qy)

u

v

Weight =lengthp

a + dist

b

length = (qx-px)2 + (qy-py)2length = (qx-px)2 + (qy-py)2

dist = abs(v) if o<u<1or

dist = distance of (x,y) from P if u < 0or

dist = distance of (x,y) from Q if u > 1

dist = abs(v) if o<u<1or

dist = distance of (x,y) from P if u < 0or

dist = distance of (x,y) from Q if u > 1(a,b) controls influence of line for points near it

(a,b) controls influence of line for points near it

Page 36: Project Image Morphing Presented By Sharmila Gupta

BEIER-NEELY ALGORITHM

For each pixel X=(x,y) in the destination image DSUM=(0,0) , weightsum=0 for each line(Pi, Qi) calculate(ui,vi) based on Pi, Qi calculate (xi’, yi’) based on u,v and Pi, Qi calculate displacement Di = Xi’ – X for this line compute weight for line(Pi,Qi)

DSUM+=Di*weight

weightsum+=weight

(x’y’) = (x,y)+DSUM/weightsum color at destination pixel(x,y) = color at source pixel(x’y’)

Page 37: Project Image Morphing Presented By Sharmila Gupta

Mesh Morphing

Mesh is a rough presentation of an object

Meshed Image

Source and Destination images are meshed

Meshes for both images are interpolated

How it is done ?

Intermediate images are cross-dissolved

Page 38: Project Image Morphing Presented By Sharmila Gupta

Mesh Morphing-Algorithm

• for each frame f do

– Linearly interpolate mesh M, between Ms and Mt

– warp Images to I1, using meshes Ms and M

– warp Imaget to I2, using meshes Mt and M

– Linearly interpolate image I1 and I2

• end

Page 39: Project Image Morphing Presented By Sharmila Gupta

Mesh Morphing

Page 40: Project Image Morphing Presented By Sharmila Gupta

Mesh Morphing - Pros and Cons

Hard to fit the mesh in the image

All control points affects the warping equally.

Not enough control on certain points when needed.

Pros

Cons

A Mesh A Rendered Image

Page 41: Project Image Morphing Presented By Sharmila Gupta

Multilevel Free Form Deformation (MFFD) Morphing two sequences of live action, rather than

just two still images

Mark all features in key frames

Interpolate the features between key frames

Do image metamorphosis on set of image pairs

Page 42: Project Image Morphing Presented By Sharmila Gupta

Multilevel Free Form Deformation (MFFD)

Page 43: Project Image Morphing Presented By Sharmila Gupta

Volume Based Approaches Technique:

The objects are expressed as level sets of distance functions

Two steps:

Warp: deform the 3D space in order to make the two objects to be morphed coincide as much as possible

Interpolation: linear interpolate distance fields deformed by the warp

Interaction: The user interface allows to select feature (or anchor)

points in each voxelized object space and map the anchor points of the source object to the anchor points of the target object

Page 44: Project Image Morphing Presented By Sharmila Gupta

Volume Based Approaches - Example

Page 45: Project Image Morphing Presented By Sharmila Gupta

Volume Based Approaches - Example

Page 46: Project Image Morphing Presented By Sharmila Gupta

Volume Based Approaches

D. Cohen-Or, D. Levin, A. Solomovoci. Three-dimensional distance field metamorphosis. ACM Trans. Graphics 17:116-141, 1998

http://www.math.tau.ac.il/~levin/

Page 47: Project Image Morphing Presented By Sharmila Gupta

B-Rep Based Approaches

Polyhedral Morphing using Feature based surface decomposition

The users only need to specify a few corresponding pairs of features on the two polyhedra. They can then specify the trajectories along which these features travel during the morph using Bezier curves, as shown in the next page.

The algorithm not only provides the user with high-level control in terms of specifying the features and trajectories, it also allows for local refinement

Page 48: Project Image Morphing Presented By Sharmila Gupta

B-Rep Based Approaches

Destination Image Source Image

Page 49: Project Image Morphing Presented By Sharmila Gupta

B-Rep Based Approaches

Page 50: Project Image Morphing Presented By Sharmila Gupta

B-Rep Based Approaches

A. Gregory, A. State, M. C. Lin, D. Manocha, and M. A. Livingston. Interactive surface decomposition for polyhedral morphing. The Visual Computer (1999) 15:453-470

http://www.cs.unc.edu/~geom/3Dmorphing/

Page 51: Project Image Morphing Presented By Sharmila Gupta

B-Rep Based Approaches - Examples

http://www.cs.unc.edu/~gregory/morphs/jj.mpg

Jack and Jill

Coffecup to Donut

http://www.cs.unc.edu/~gregory/morphs/donut2cup.mpg

Page 52: Project Image Morphing Presented By Sharmila Gupta

Project Image Morphing