Image Scissors: A Computer Vision Lesson in Image Analysis
EE/CSE 576 Spr. 2003
Megan Hazen
Introduction:
The purpose of this assignment is three-fold: To familiarize the
student with filtering techniques, to examine a method of segmenting an
image, and to play with some image processing programs/techniques. The
algorithm is based on the 1995 SIGGRAPH paper by Mortensen and Barrett:
Intelligent Scissors for Image Composition. It also uses Dijkstra's
well known shortest path algorithm.
In this implementation of the algorithm, a cost to move from a pixel to
each of its neighbors is calculated. The cost is proportional to the
gradient of the image perpendicular to the edge between the two pixels. In
this code, the (un-normalized) gradient values were calculated by:
[0 -1 0; 0 0 1; 0 0 0] for the upper right diagonal, and [0 -1 -1; 0 0
0; 0 1 1] for the right hand side. These masks were rotated by 90
degrees to get the analogous maks for the remaining diagonal and perpendicular
edges.
To demonstrate this code, I have created the following picture:
To create the picture I used two images. The first was a picture
of my pet dinosaur, Rawr, sitting on our couch:
The second was of my husband showing off our new stove:
I guess the stove and all made the dinosaur hungry, because he decided
to eat Josh. In order to portray this, i used the image scissors program
to draw a boundary around Josh, and then create the following mask of his
image:
I created a new layer in the photo of Rawr, and then added the mask to
the layer. After I applied the mask, i was able to rotate and scale
the image so that Josh fit into Rawr's mouth. My guess is that Rawr
will sleep well tonight, which such a full stomach!
Just in case anyone is too concerned about Josh, here he is with Rawr, being
friendly this time: