From 46f1ad4dadd2e60f192f34670d4cf16e951a5154 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Fri, 4 Apr 2025 08:36:11 +0200 Subject: [PATCH] Oops, recompute energy in the good element --- src/seam-carving.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/seam-carving.cpp b/src/seam-carving.cpp index 3f40ba0..53f75cf 100644 --- a/src/seam-carving.cpp +++ b/src/seam-carving.cpp @@ -277,7 +277,7 @@ void recompute_energy_along_seam( if ((0 < (opt_seam[j] + i)) && ((opt_seam[j] + i) < dim_large - 1)) { compute_energy_for_pixel(carved_img, newWidth, newHeight, x, y, nbChannels, nbColorChannels, - output_energy[width * y + x].first); + output_energy[width * y + x].second); } } } @@ -438,9 +438,7 @@ auto seam_carving(unsigned char *source, int width, int height, int nbChannels, std::cout << std::endl; // Add newline after ProgressBar if (test_energy) { - return std::make_tuple(test_energy_output, width, height, nbChannels); - } else { return std::make_tuple(source_img, curWidth, curHeight, nbChannels); }