#include <stdio.h>
#include <cstdlib>
const unsigned ITERATIONS = 96;
const float RELAXATION_FACTOR = 0.05f;
float mx = max<float>(in.
as(
f32));
float mn = min<float>(in.
as(
f32));
return (in - mn) / (mx - mn);
}
int main(int argc, char *argv[]) {
int device = argc > 1 ? atoi(argv[1]) : 0;
try {
printf("** ArrayFire Image Deconvolution Demo **\n");
while (!myWindow.close()) {
myWindow.grid(2, 3);
myWindow(0, 0).image(normalize(in), "Input Image");
myWindow(1, 0).image(normalize(blurred), "Blurred Image");
myWindow(0, 1).image(normalize(tikhonov), "Tikhonov");
myWindow(1, 1).image(normalize(landweber), "Landweber");
myWindow(0, 2).image(normalize(richlucy), "Richardson-Lucy");
myWindow.show();
}
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}