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

Function homography

src/api/c/homography.cpp:28–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27template<typename T>
28static inline void homography(af_array& H, int& inliers, const af_array x_src,
29 const af_array y_src, const af_array x_dst,
30 const af_array y_dst,
31 const af_homography_type htype,
32 const float inlier_thr,
33 const unsigned iterations) {
34 Array<T> bestH = createEmptyArray<T>(af::dim4(3, 3));
35 af_array initial;
36 unsigned d = (iterations + 256 - 1) / 256;
37 dim_t rdims[] = {4, d * 256};
38 AF_CHECK(af_randu(&initial, 2, rdims, f32));
39 inliers =
40 homography<T>(bestH, getArray<float>(x_src), getArray<float>(y_src),
41 getArray<float>(x_dst), getArray<float>(y_dst),
42 getArray<float>(initial), htype, inlier_thr, iterations);
43 AF_CHECK(af_release_array(initial));
44
45 H = getHandle<T>(bestH);
46}
47
48af_err af_homography(af_array* H, int* inliers, const af_array x_src,
49 const af_array y_src, const af_array x_dst,

Callers 1

TESTFunction · 0.50

Calls 3

af_randuFunction · 0.70
af_release_arrayFunction · 0.70
dim4Class · 0.50

Tested by

no test coverage detected