Create Makefile

This commit is contained in:
augustin64 2025-04-04 15:02:27 +02:00
parent 8fdcd1d966
commit 084bcdf161
3 changed files with 34 additions and 3 deletions

30
Makefile Normal file
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

View File

@ -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);