diff --git a/lab4/src/sharpener/image_sharpener.cpp b/lab4/src/sharpener/image_sharpener.cpp index 7309b88..fee640a 100644 --- a/lab4/src/sharpener/image_sharpener.cpp +++ b/lab4/src/sharpener/image_sharpener.cpp @@ -171,15 +171,20 @@ int main(int argc, char **argv) struct image_t *details_image; struct image_t *sharpened_image; - for (int i = 0; i < 500; i++) { + int reps = 1000; + + for (int i = 0; i < reps; i++) { smoothened_image = S1_smoothen(input_image); details_image = S2_find_details(input_image, smoothened_image); sharpened_image = S3_sharpen(input_image, details_image); // Free memory to avoid memory leaks - // free_image(smoothened_image); - // free_image(details_image); - // free_image(sharpened_image); + if(i == reps-1) { + continue; + } + free_image(smoothened_image); + free_image(details_image); + free_image(sharpened_image); } write_ppm_file(argv[2], sharpened_image);