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

Function homography

src/backend/cpu/homography.cpp:386–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384
385template<typename T>
386int homography(Array<T>& bestH, const Array<float>& x_src,
387 const Array<float>& y_src, const Array<float>& x_dst,
388 const Array<float>& y_dst, const Array<float>& initial,
389 const af_homography_type htype, const float inlier_thr,
390 const unsigned iterations) {
391 const dim4& idims = x_src.dims();
392 const unsigned nsamples = idims[0];
393
394 unsigned iter = iterations;
395 if (htype == AF_HOMOGRAPHY_LMEDS) {
396 iter = min(iter, static_cast<unsigned>(
397 log(1.f - LMEDSConfidence) /
398 log(1.f - pow(1.f - LMEDSOutlierRatio, 4.f))));
399 }
400
401 af::dim4 rdims(4, iter);
402 Array<float> fctr =
403 createValueArray<float>(rdims, static_cast<float>(nsamples));
404 Array<float> rnd = arithOp<float, af_mul_t>(initial, fctr, rdims);
405 rnd.eval();
406 getQueue().sync();
407
408 return findBestHomography<T>(bestH, x_src, y_src, x_dst, y_dst, rnd, iter,
409 nsamples, inlier_thr, htype);
410}
411
412#define INSTANTIATE(T) \
413 template int homography<T>( \

Callers

nothing calls this directly

Calls 7

logFunction · 0.85
powFunction · 0.85
minFunction · 0.70
getQueueFunction · 0.50
dimsMethod · 0.45
evalMethod · 0.45
syncMethod · 0.45

Tested by

no test coverage detected