MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / af_orb

Function af_orb

src/api/c/orb.cpp:53–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53af_err af_orb(af_features* feat, af_array* desc, const af_array in,
54 const float fast_thr, const unsigned max_feat,
55 const float scl_fctr, const unsigned levels,
56 const bool blur_img) {
57 try {
58 const ArrayInfo& info = getInfo(in);
59 af::dim4 dims = info.dims();
60
61 ARG_ASSERT(
62 2, (dims[0] >= 7 && dims[1] >= 7 && dims[2] == 1 && dims[3] == 1));
63 ARG_ASSERT(3, fast_thr > 0.0f);
64 ARG_ASSERT(4, max_feat > 0);
65 ARG_ASSERT(5, scl_fctr > 1.0f);
66 ARG_ASSERT(6, levels > 0);
67
68 dim_t in_ndims = dims.ndims();
69 DIM_ASSERT(1, (in_ndims == 2));
70
71 af_array tmp_desc;
72 af_dtype type = info.getType();
73 switch (type) {
74 case f32:
75 orb<float, float>(*feat, tmp_desc, in, fast_thr, max_feat,
76 scl_fctr, levels, blur_img);
77 break;
78 case f64:
79 orb<double, double>(*feat, tmp_desc, in, fast_thr, max_feat,
80 scl_fctr, levels, blur_img);
81 break;
82 default: TYPE_ERROR(1, type);
83 }
84 std::swap(*desc, tmp_desc);
85 }
86 CATCHALL;
87
88 return AF_SUCCESS;
89}

Callers 3

homographyTestFunction · 0.50
orbTestFunction · 0.50
orbFunction · 0.50

Calls 4

swapFunction · 0.85
dimsMethod · 0.45
ndimsMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected