Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SOUMEE2000 authored Jan 29, 2023
1 parent ce6eeec commit 3882059
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
# To change the body type of one person to body type of another person given two images

# Input images
< img src = "https://github.com/SOUMEE2000/seam-carving/blob/master/Demos/Input/female1.png">
< img src = "https://github.com/SOUMEE2000/seam-carving/blob/master/Demos/Input/female2.png">

A fast Python implementation of [Seam Carving for Content-Aware Image Resizing ](https://inst.eecs.berkeley.edu/~cs194-26/fa18/hw/proj4-seamcarving/imret.pdf) (2007), including the improved energy algorithm described in [Improved Seam Carving for Video Retargeting](http://www.eng.tau.ac.il/~avidan/papers/vidret.pdf) (2008).
# Output image
<img src= "https://github.com/SOUMEE2000/seam-carving/blob/master/Demos/Output/img1_2.png">
This is the image of the first person made to like the second person

## Requirements
* OpenCV
* scipy
* numba
* numpy
* mediapie

## Usage
```
python seam_carving.py (-resize | -remove) -im <IM_PATH> -out <OUTPUT_IM_NAME> [-dx <DX>]
```


For both modes:
Description of parameters:
* `-im`: The path to the image to be processed.
* `-out`: The name for the output image.
* `-mask`: (Optional) The path to the protective mask. The mask should be binary and have the same size as the input image. White areas represent regions where no seams should be carved (e.g. faces).
* `-vis`: If present, display a window while the algorithm runs showing the seams as they are removed.
* `-backward_energy`: If present, use the backward energy function (i.e. gradient magnitude) instead of the forward energy function (default).
* '-dx- : Number of pixels to remove. Positive for adding pixels, negative for subtracting pixels


# Algorithm used:
Expand All @@ -30,16 +34,18 @@ For both modes:

# Key-point Detection
To detect essential features of the images to determine by what amount to reduce or increase the width of the given image

<img src = "https://github.com/SOUMEE2000/seam-carving/blob/master/Demos/Media_pie_landmarks.png">

#Seam-carving Algorithm
An effective method to resize images by removing pixels without cropping images or resulting in loss of information


## Acknowledgements
Many parts of the code are adapted/optimized versions of functionality from other implementations:
* https://github.com/axu2/improved-seam-carving
* https://github.com/vivianhylee/seam-carving
* https://karthikkaranth.me/blog/implementing-seam-carving-with-python/
* Seam carving for content-aware image resizing(2007) [link](https://dl.acm.org/doi/10.1145/1275808.1276390#:~:text=By%20repeatedly%20carving%20out%20or,defined%20by%20the%20energy%20function)
* [Mediapie for key point detection](https://www.analyticsvidhya.com/blog/2022/03/pose-detection-in-image-using-mediapipe-library/)
* A fast Python implementation of [Seam Carving for Content-Aware Image Resizing ](https://inst.eecs.berkeley.edu/~cs194-26/fa18/hw/proj4-seamcarving/imret.pdf) (2007), including the improved energy algorithm described in [Improved Seam Carving for Video Retargeting](http://www.eng.tau.ac.il/~avidan/papers/vidret.pdf) (2008).

0 comments on commit 3882059

Please sign in to comment.