I get an error when I tried to load an grayscale image png format for executing this code. My program is a part from Halide Tutorial lesson 2. This is my code:
#include <stdio.h>
#include "Halide.h"
#include "halide_image_io.h"
using namespace Halide;
using namespace Halide::Tools;
int main(int argc, char **argv) {
Halide::Image<uint8_t> input = load_image(argv[1]);
Halide::Func brighter;
Halide::Var x, y, c;
Halide::Expr value = input(x, y, c);
value = Halide::cast<float>(value);
value = value * 1.5f;
value = Halide::min(value, 255.0f);
value = Halide::cast<uint8_t>(value);
brighter(x, y, c) = value;
Halide::Image<uint8_t> output = brighter.realize(input.width(), input.height(), input.channels());
save_image(output, "brighter.png");
printf("Success!\n");
return 0;
}
And this is the error message:
Error:
3-argument call to "i0", which has 2 dimensions.
Aborted (core dumped)