#include <cstdio>
#include <cstdlib>
static void fast_demo(bool console)
{
if (console)
img_color = loadImage(ASSETS_DIR "/examples/images/square.png", true);
else
img_color = loadImage(ASSETS_DIR "/examples/images/man.jpg", true);
img_color /= 255.f;
features feat = fast(img, 20.0f, 9,
true, 0.05);
const int draw_len = 3;
int x = h_x[f];
int y = h_y[f];
img_color(y,
seq(x-draw_len, x+draw_len), 0) = 0.f;
img_color(y,
seq(x-draw_len, x+draw_len), 1) = 1.f;
img_color(y,
seq(x-draw_len, x+draw_len), 2) = 0.f;
img_color(
seq(y-draw_len, y+draw_len), x, 0) = 0.f;
img_color(
seq(y-draw_len, y+draw_len), x, 1) = 1.f;
img_color(
seq(y-draw_len, y+draw_len), x, 2) = 0.f;
}
if (!console) {
} else {
}
}
int main(int argc, char** argv)
{
int device = argc > 1 ? atoi(argv[1]) : 0;
bool console = argc > 2 ? argv[2][0] == '-' : false;
try {
std::cout << "** ArrayFire FAST Feature Detector Demo **" << std::endl << std::endl;
fast_demo(console);
std::cerr << ae.
what() << std::endl;
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
size_t getNumFeatures() const
seq is used to create seq for indexing af::array
Definition seq.h:46
@ AF_GRAY
Grayscale.
Definition defines.h:296
@ AF_RGB
3-channel RGB
Definition defines.h:297
AFAPI void setDevice(const int device)
Sets the current device.
void image(const array &in, const char *title=NULL)
Renders the input array as an image to the window.
bool close()
Check if window is marked for close.
T * host() const
Copy array data to host and return host pointer.
Definition algorithm.h:15
#define af_print(...)
Definition util.h:141