The same way the previous tutorials load images.
Add this include:
#include "halide_image_io.h" // for load_image and save_image
Then replace
Halide::Runtime::Buffer<uint8_t> input(640, 480), output(640, 480);
with
Halide::Runtime::Buffer<uint8_t> input = Halide::Tools::load_image("path/to/input.png");
Halide::Runtime::Buffer<uint8_t> output(input.width(), input.height());
If you're interested in saving the output, after the error check, add the line:
Halide::Tools::save_image(output, "path/to/output.png");
Note that the paths, if not absolute paths, will be in the following directories: the Halide/tutorial/ directory for input, and the Halide/bin/build/tmp/ directory for the output, after running:
make tutorial_lesson_10_aot_compilation_run
from the root directory of Halide.