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

Function updateIterations

src/backend/cpu/homography.cpp:138–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138unsigned updateIterations(float inlier_ratio, unsigned iter) {
139 float w = min(max(inlier_ratio, 0.0f), 1.0f);
140 float wn = pow(1 - w, 4.f);
141
142 float d = 1.f - wn;
143 if (d < numeric_limits<float>::min()) { return 0; }
144
145 d = log(d);
146
147 float p = min(max(RANSACConfidence, 0.0f), 1.0f);
148 float n = log(1.f - p);
149
150 return n <= d * static_cast<float>(iter)
151 ? iter
152 : static_cast<unsigned>(round(n / d));
153}
154
155template<typename T>
156int computeHomography(T* H_ptr, const float* rnd_ptr, const float* x_src_ptr,

Callers 1

findBestHomographyFunction · 0.85

Calls 5

powFunction · 0.85
logFunction · 0.85
roundFunction · 0.85
minFunction · 0.70
maxFunction · 0.70

Tested by

no test coverage detected