Compare commits
2 Commits
8fdcd1d966
...
aa4fc91958
Author | SHA1 | Date | |
---|---|---|---|
aa4fc91958 | |||
084bcdf161 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,6 @@
|
||||
build/
|
||||
out-imgs
|
||||
*.jp*g
|
||||
*.JP*G
|
||||
*.png
|
||||
*.kra
|
30
Makefile
Normal file
30
Makefile
Normal file
@ -0,0 +1,30 @@
|
||||
IN_IMGS := imgs
|
||||
OUT_IMGS := out-imgs
|
||||
BIN := build/seam-carving --silent
|
||||
|
||||
images: images-ign images-birds
|
||||
|
||||
|
||||
images-dir:
|
||||
mkdir -p $(OUT_IMGS)
|
||||
|
||||
images-birds: build/seam-carving
|
||||
$(BIN) -s $(IN_IMGS)/birds.jpg -m $(IN_IMGS)/birds-mask.jpg -o $(OUT_IMGS)/vertical-birds.jpg -u --vertical
|
||||
$(BIN) -s $(IN_IMGS)/birds.jpg -m $(IN_IMGS)/birds-mask.jpg -o $(OUT_IMGS)/horizontal-birds.jpg -u
|
||||
|
||||
images-ign: build/seam-carving
|
||||
$(BIN) -s $(IN_IMGS)/ign-circled.png -m $(IN_IMGS)/ign-mask.jpg -o $(OUT_IMGS)/ign-maxstep3-seams.jpg -u --max-step 3 --show-seams
|
||||
$(BIN) -s $(IN_IMGS)/ign-circled.png -m $(IN_IMGS)/ign-mask.jpg -o $(OUT_IMGS)/ign-maxstep3.jpg -u --max-step 3
|
||||
$(BIN) -s $(IN_IMGS)/ign-circled.png -m $(IN_IMGS)/ign-mask.jpg -o $(OUT_IMGS)/ign-maxstep15.jpg -u --max-step 15
|
||||
|
||||
images-boat: build/seam-carving
|
||||
$(BIN) -s $(IN_IMGS)/boat.jpg -o $(OUT_IMGS)/boat-seams.jpg -n 350 --show-seams
|
||||
$(BIN) -s $(IN_IMGS)/boat.jpg -o $(OUT_IMGS)/boat.jpg -n 350
|
||||
|
||||
build/seam-carving: src/seam-carving.cpp src/utils.cpp src/utils.hpp
|
||||
mkdir -p build
|
||||
cd build && cmake .. -DCMAKE_BUILD_TYPE=Release; make -j7
|
||||
|
||||
clean:
|
||||
rm $(OUT_IMGS) -rf
|
||||
rm build -rf
|
BIN
imgs/boat.jpg
Normal file
BIN
imgs/boat.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 288 KiB |
@ -436,7 +436,7 @@ auto seam_carving(unsigned char *source, int width, int height, int nbChannels,
|
||||
}
|
||||
|
||||
SimpleProgressBar::ProgressBar bar(until_mask_removal ? dim_large : nbSeams);
|
||||
bar.print();
|
||||
if (!silent) bar.print();
|
||||
|
||||
auto seam_index = 0;
|
||||
while (seam_index++ < nbSeams || until_mask_removal) {
|
||||
@ -485,9 +485,10 @@ auto seam_carving(unsigned char *source, int width, int height, int nbChannels,
|
||||
}
|
||||
}
|
||||
bar.increment();
|
||||
bar.print();
|
||||
if (!silent) bar.print();
|
||||
}
|
||||
std::cout << std::endl; // Add newline after ProgressBar
|
||||
// Add newline after ProgressBar
|
||||
if (!silent) std::cout << std::endl;
|
||||
|
||||
if (show_seams) {
|
||||
return std::make_tuple(test_energy_output, width, height, nbChannels);
|
||||
|
Loading…
x
Reference in New Issue
Block a user