- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

vision.h
Go to the documentation of this file.
1 /*******************************************************
2 * Copyright (c) 2014, ArrayFire
3 * All rights reserved.
4 *
5 * This file is distributed under 3-clause BSD license.
6 * The complete license agreement can be obtained at:
7 * http://arrayfire.com/licenses/BSD-3-Clause
8 ********************************************************/
9
10 #pragma once
11 #include <af/defines.h>
12 #include <af/features.h>
13
14 #ifdef __cplusplus
15 namespace af
16 {
17 class array;
18
42 AFAPI 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.05, const unsigned edge=3);
43
44 #if AF_API_VERSION >= 31
45
71 AFAPI features harris(const array& in, const unsigned max_corners=500, const float min_response=1e5f, const float sigma=1.f, const unsigned block_size=0, const float k_thr=0.04f);
72 #endif
73
96 AFAPI void orb(features& feat, array& desc, const array& image, const float fast_thr=20.f, const unsigned max_feat=400, const float scl_fctr=1.5f, const unsigned levels=4, const bool blur_img=false);
97
98 #if AF_API_VERSION >= 31
99
130 AFAPI void sift(features& feat, array& desc, const array& in, const unsigned n_layers=3, const float contrast_thr=0.04f, const float edge_thr=10.f, const float init_sigma=1.6f, const bool double_input=true, const float intensity_scale=0.00390625f, const float feature_ratio=0.05f);
131 #endif
132
157 AFAPI void hammingMatcher(array& idx, array& dist,
158 const array& query, const array& train,
159 const dim_t dist_dim=0, const unsigned n_dist=1);
160
161 #if AF_API_VERSION >= 31
162
186 AFAPI void nearestNeighbour(array& idx, array& dist,
187 const array& query, const array& train,
188 const dim_t dist_dim=0, const unsigned n_dist=1,
189 const af_match_type dist_type = AF_SSD);
190 #endif
191
207 AFAPI array matchTemplate(const array &searchImg, const array &templateImg, const matchType mType=AF_SAD);
208
209 #if AF_API_VERSION >= 31
210
226 AFAPI features susan(const array& in,
227 const unsigned radius=3,
228 const float diff_thr=32.0f,
229 const float geom_thr=10.0f,
230 const float feature_ratio=0.05f,
231 const unsigned edge=3);
232 #endif
233
234 #if AF_API_VERSION >= 31
235
245 AFAPI array dog(const array& in, const int radius1, const int radius2);
246 #endif
247
248 }
249 #endif
250
251 #ifdef __cplusplus
252 extern "C" {
253 #endif
254
280 AFAPI af_err af_fast(af_features *out, const af_array in, const float thr, const unsigned arc_length, const bool non_max, const float feature_ratio, const unsigned edge);
281
282 #if AF_API_VERSION >= 31
283
309 AFAPI af_err af_harris(af_features *out, const af_array in, const unsigned max_corners, const float min_response, const float sigma, const unsigned block_size, const float k_thr);
310 #endif
311
334 AFAPI af_err af_orb(af_features *feat, af_array *desc, const af_array in, const float fast_thr, const unsigned max_feat, const float scl_fctr, const unsigned levels, const bool blur_img);
335
336 #if AF_API_VERSION >= 31
337
368 AFAPI af_err af_sift(af_features *feat, af_array *desc, const af_array in, const unsigned n_layers, const float contrast_thr, const float edge_thr, const float init_sigma, const bool double_input, const float intensity_scale, const float feature_ratio);
369 #endif
370
392 AFAPI af_err af_hamming_matcher(af_array* idx, af_array* dist,
393 const af_array query, const af_array train,
394 const dim_t dist_dim, const unsigned n_dist);
395
396 #if AF_API_VERSION >= 31
397
421 AFAPI af_err af_nearest_neighbour(af_array* idx, af_array* dist,
422 const af_array query, const af_array train,
423 const dim_t dist_dim, const unsigned n_dist,
424 const af_match_type dist_type);
425 #endif
426
444 AFAPI af_err af_match_template(af_array *out, const af_array search_img, const af_array template_img, const af_match_type m_type);
445
446 #if AF_API_VERSION >= 31
447
465 AFAPI af_err af_susan(af_features* out, const af_array in, const unsigned radius, const float diff_thr, const float geom_thr,
466 const float feature_ratio, const unsigned edge);
467 #endif
468
469 #if AF_API_VERSION >= 31
470
482 AFAPI af_err af_dog(af_array *out, const af_array in, const int radius1, const int radius2);
483 #endif
484
485 #ifdef __cplusplus
486 }
487 #endif
af_harris
AFAPI af_err af_harris(af_features *out, const af_array in, const unsigned max_corners, const float min_response, const float sigma, const unsigned block_size, const float k_thr)
C Interface for Harris corner detector.
AF_SSD
Match based on Sum of Squared Differences (SSD)
Definition: defines.h:244
af
Definition: algorithm.h:14
af::dog
AFAPI array dog(const array &in, const int radius1, const int radius2)
C++ Interface wrapper for Difference of Gaussians.
af_orb
AFAPI af_err af_orb(af_features *feat, af_array *desc, const af_array in, const float fast_thr, const unsigned max_feat, const float scl_fctr, const unsigned levels, const bool blur_img)
C Interface for ORB feature descriptor.
af::orb
AFAPI void orb(features &feat, array &desc, const array &image, const float fast_thr=20.f, const unsigned max_feat=400, const float scl_fctr=1.5f, const unsigned levels=4, const bool blur_img=false)
C++ Interface for ORB feature descriptor.
af_features
void * af_features
Definition: features.h:13
af::harris
AFAPI features harris(const array &in, const unsigned max_corners=500, const float min_response=1e5f, const float sigma=1.f, const unsigned block_size=0, const float k_thr=0.04f)
C++ Interface for Harris corner detector.
features.h
af::nearestNeighbour
AFAPI void nearestNeighbour(array &idx, array &dist, const array &query, const array &train, const dim_t dist_dim=0, const unsigned n_dist=1, const af_match_type dist_type=AF_SSD)
C++ Interface wrapper for Nearest Neighbour.
af_dog
AFAPI af_err af_dog(af_array *out, const af_array in, const int radius1, const int radius2)
C Interface wrapper for Difference of Gaussians.
af_err
af_err
Definition: defines.h:67
af::susan
AFAPI features susan(const array &in, const unsigned radius=3, const float diff_thr=32.0f, const float geom_thr=10.0f, const float feature_ratio=0.05f, const unsigned edge=3)
C++ Interface for SUSAN corner detector.
defines.h
af_hamming_matcher
AFAPI af_err af_hamming_matcher(af_array *idx, af_array *dist, const af_array query, const af_array train, const dim_t dist_dim, const unsigned n_dist)
C Interface wrapper for Hamming matcher.
dim_t
long long dim_t
Definition: defines.h:50
af::fast
AFAPI 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.05, const unsigned edge=3)
C++ Interface for FAST feature detector.
af_fast
AFAPI af_err af_fast(af_features *out, const af_array in, const float thr, const unsigned arc_length, const bool non_max, const float feature_ratio, const unsigned edge)
C Interface for FAST feature detector.
AFAPI
#define AFAPI
Definition: defines.h:31
AF_SAD
Match based on Sum of Absolute Differences (SAD)
Definition: defines.h:241
af_match_template
AFAPI af_err af_match_template(af_array *out, const af_array search_img, const af_array template_img, const af_match_type m_type)
C Interface for image template matching.
afcl::array
static af::array array(af::dim4 idims, cl_mem buf, af::dtype type, bool retain=false)
Create an af::array object from an OpenCL cl_mem buffer.
Definition: opencl.h:136
af_nearest_neighbour
AFAPI af_err af_nearest_neighbour(af_array *idx, af_array *dist, const af_array query, const af_array train, const dim_t dist_dim, const unsigned n_dist, const af_match_type dist_type)
C Interface wrapper for Nearest Neighbour.
af::hammingMatcher
AFAPI void hammingMatcher(array &idx, array &dist, const array &query, const array &train, const dim_t dist_dim=0, const unsigned n_dist=1)
C++ Interface wrapper for Hamming matcher.
af::sift
AFAPI void sift(features &feat, array &desc, const array &in, const unsigned n_layers=3, const float contrast_thr=0.04f, const float edge_thr=10.f, const float init_sigma=1.6f, const bool double_input=true, const float intensity_scale=0.00390625f, const float feature_ratio=0.05f)
C++ Interface for SIFT feature detector and descriptor.
af_array
void * af_array
Definition: defines.h:187
af::matchType
af_match_type matchType
Definition: defines.h:334
af_susan
AFAPI af_err af_susan(af_features *out, const af_array in, const unsigned radius, const float diff_thr, const float geom_thr, const float feature_ratio, const unsigned edge)
C Interface for SUSAN corner detector.
af_sift
AFAPI af_err af_sift(af_features *feat, af_array *desc, const af_array in, const unsigned n_layers, const float contrast_thr, const float edge_thr, const float init_sigma, const bool double_input, const float intensity_scale, const float feature_ratio)
C++ Interface for SIFT feature detector and descriptor.
af::matchTemplate
AFAPI array matchTemplate(const array &searchImg, const array &templateImg, const matchType mType=AF_SAD)
C++ Interface for image template matching.
af_match_type
af_match_type
Definition: defines.h:240