diff --git a/README.md b/README.md index f23a354..c8be2f8 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ This project explores the image morphing technique, particularly face image morp We perform image morphing in the frequency. Specifically, we transform the source and target images to frequency domain using DFT and interpolate them to generate the intermediate images. +
+ +
+ This project consists of two major steps: Image Alignment and Transition Control. @@ -15,6 +19,11 @@ The baseline paper on which this work is built: [image morphing in frequency dom The project introduces an automated approach to align images, significantly enhancing morphing quality. It uses the OpenCV Python module for optimized image processing and facial landmark recognition for feature extraction. Techniques such as rotation to align eyes parallel to the ground and affine transformations to align eyes of source and target images are employed for precise alignment. ++ +
+ ## Transition Control Transition control is achieved by using the Discrete Fourier Transform (DFT) for transforming images. The project innovates on transitioning images by interpolating their frequency domain representations. It details the approach of using polar interpolation of magnitude and phase of images, a method superior to linear interpolation in spatial domain. @@ -81,7 +90,10 @@ show_images_slider(*morphs, path1=paths[0], path2=paths[1]) python3 src/main.py ``` -![](assets/README/morph.gif) ++ +
### Producing metrics To produce the metrics for both DFT and DCT based morphing. diff --git a/assets/README/landmarks.png b/assets/README/landmarks.png new file mode 100644 index 0000000..1ec3412 Binary files /dev/null and b/assets/README/landmarks.png differ diff --git a/assets/README/morph_seperate.png b/assets/README/morph_seperate.png new file mode 100644 index 0000000..7f47e2a Binary files /dev/null and b/assets/README/morph_seperate.png differ diff --git a/assets/README/morph.gif b/assets/README/morph_slider.gif similarity index 100% rename from assets/README/morph.gif rename to assets/README/morph_slider.gif diff --git a/src/main.py b/src/main.py index 2bb26d5..100b97c 100644 --- a/src/main.py +++ b/src/main.py @@ -10,6 +10,10 @@ # Set paths paths = random_files(emotion1, emotion2) + paths = [ + "/home/subroot/Personal/university/dip/image-morphing/data/front/neutral_front/107_03.jpg", + "/home/subroot/Personal/university/dip/image-morphing/data/front/neutral_front/100_03.jpg", + ] # Load images img1, img2 = load_image(paths[0]), load_image(paths[1]) @@ -44,13 +48,14 @@ face1 = resize_image(face1) face2 = resize_image(face2) + # landmarks1 = detect_landmarks_points(face1) + # landmarks2 = detect_landmarks_points(face2) # face1 = draw_landmarks(face1, landmarks1) # face2 = draw_landmarks(face2, landmarks2) # show_images(face1, face2, path1=paths[0], path2=paths[1]) # Perform morph - morph_type = "dft" - morphs = morph(face1, face2, morph_type=morph_type) + morphs = morph(face1, face2, morph_type=configs.morph_type) # Combine the faces if both are detected # show_images(*morphs, path1=paths[0], path2=paths[1])