#include <cstdio>
#include <math.h>
int main(int argc, char *argv[])
{
try {
af::Window myWindow(512, 512,
"Histogram example using ArrayFire");
array img = loadImage(ASSETS_DIR
"/examples/images/arrow.jpg",
false);
array hist_out = histogram(img, 256, 0, 255);
myWindow.
hist(hist_out, 0, 255);
}
}
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}
Window object to render af::arrays.
Definition graphics.h:37
A multi dimensional data container.
Definition array.h:27
Definition exception.h:20
virtual const char * what() const
Definition exception.h:34
@ u8
8-bit unsigned integral values
Definition defines.h:203
void image(const array &in, const char *title=NULL)
Renders the input array as an image to the window.
void hist(const array &X, const double minval, const double maxval, const char *const title=NULL)
Renders the input array as a histogram to the window.
bool close()
Check if window is marked for close.
const array as(dtype type) const
Converts the array into another type.
Definition algorithm.h:15