| 26 | |
| 27 | template<typename T> |
| 28 | static 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 | |
| 48 | af_err af_homography(af_array* H, int* inliers, const af_array x_src, |
| 49 | const af_array y_src, const af_array x_dst, |
no test coverage detected