Release Time: September 29, 11:59 PM
Submission Deadline: October 13, 11:59 PM
You can download the complete code and test images as a zip file from the following link:
This zip file contains all the source code required to implement the image morfing algorithm, along with example images for testing.
Follow these steps to compile the code:
cd /path_to/Assignment1
mkdir build
cd build
cmake ..
make
Once the code is compiled, you will have an executable named ImageMorfingMethod
in the build directory.
To run the image morfing program, use the following command:
./ImageMorfingMethod --in ../example_data/F.bmp --dest ../example_data/F_rotated.bmp --out ../result
Here’s what each argument means:
--in
: Specifies the source image that will be morphed.--dest
: Specifies the destination image that the source will morph into.--out
: Specifies the output folder where the morphed images will be saved (30 images in total).The program will save the morphed images as output_00.jpg
, output_01.jpg
, ..., up to output_30.jpg
in the specified output folder.
Below is a brief description of what each source file in the project does.
image.h
: Defines the ImageProcessor
class, which is responsible for handling the Beier-Neely image morfing process. This includes methods for computing the weighted transformations of image points.line_segments.h
: Defines the OrientedLineSegment
and OrientedLineSegmentPairs
classes, which represent the control line segments used in the morfing process. These line segments define how the source image morphs into the destination image.main.cpp
: This is the entry point for the program. It handles command-line argument parsing, reading the input and destination images, performing the image morfing for each frame, and saving the results to the output folder.image_todo.cpp
: Implements the methods defined in image.h
, including the main morfing function. It computes how each pixel in the source image should be transformed and interpolated based on the control line segments.line_segments.cpp
: Implements the classes from line_segments.h
. This file handles the logic for how the control line segments are applied to the morfing process, including calculating the weight and transformation for each pixel. These are some helper functions to make your life easier. You may use or not use them as needed.The main files you need to work with for the assignment are:
main.cpp
: In this file, you will define the line segments for the morfing process. There are placeholder lines like:
You should replace these with actual control points that define how your source image should morph into your destination image.
image_todo.cpp
: This file contains the logic for applying the Beier-Neely morfing algorithm. You need to complete the function BeierNeelyMorph
by implementing the transformations based on the control line segments you define.
When you complete the assignment, your submission should be a zip file containing the following:
If you need more information about the image morfing algorithm, please refer to the lecture slides and the paper Feature-Based Image Metamorphosis by Beier and Neely, which describes the core principles of the technique.
*You are not allowed to distribute your solution to this homework either online or to other students without permission.