#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;
 
 
 
    
    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 {
        printf("** ArrayFire FAST Feature Detector Demo **\n\n");
        fast_demo(console);
 
        fprintf(stderr, 
"%s\n", ae.
what());
        throw;
    }
 
    return 0;
}
Window object to render af::arrays.
A multi dimensional data container.
T * host() const
Copy array data to host and return host pointer.
An ArrayFire exception class.
virtual const char * what() const
Returns an error message for the exception in a string format.
Represents a feature returned by a feature detector.
array getY() const
Returns an af::array which represents the y locations of a feature.
size_t getNumFeatures() const
Returns the number of features represented by this object.
array getX() const
Returns an af::array which represents the x locations of a feature.
seq is used to create sequences for indexing af::array
features fast(const array &in, const float thr=20.0f, const unsigned arc_length=9, const bool non_max=true, const float feature_ratio=0.05f, const unsigned edge=3)
C++ Interface for FAST feature detector.
void freeHost(const void *ptr)
Free memory allocated internally by ArrayFire.
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.
array colorSpace(const array &image, const CSpace to, const CSpace from)
C++ Interface wrapper for colorspace conversion.
array loadImage(const char *filename, const bool is_color=false)
C++ Interface for loading an image.