-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dxghost
committed
Jan 31, 2021
1 parent
e19d602
commit 50ee94f
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,36 @@ | ||
# squeeze | ||
content-aware image resizing using seam carving algorithm written in python | ||
|
||
## Getting Started | ||
program guide: | ||
``` | ||
usage: Remove specified columns and rows from input image. [-h] -i i [-c i] [-r i] [-v] | ||
optional arguments: | ||
-h, --help show this help message and exit | ||
-i i image path | ||
-c i -c <int> columns to remove, default: 0 | ||
-r i -r <int> rows to remove, default: 0 | ||
-v -v store each step seam into output directory, default: False (default: False) | ||
``` | ||
example: | ||
```bash | ||
cd squeeze | ||
sudo apt install virtualenv | ||
virtualenv -p python3.9 venv #Install it in case it's not already installed | ||
source venv/bin/activate | ||
pip3 install -r requirements.txt | ||
|
||
python3 main.py -i test/test_data/input.jpg -c 2 -r 3 -v | ||
``` | ||
|
||
## Demos | ||
|
||
#### dual-gradient energy calculation | ||
![energy](test/test_data/input-dual-gradient.png) | ||
|
||
#### horizontal seam | ||
![horizontal](output/rows_1.png) | ||
|
||
#### vertical seam | ||
![vertical](output/columns_4.png) |