67 float mfp = refV->footPrintScaled(p);
68 math::Vec3f refDir = (p - refV->camPos).normalized();
69 std::map<std::size_t, math::Vec3f> viewDir;
70 std::map<std::size_t, math::Vec3f> epipolarPlane;
71 std::map<std::size_t, float> ncc;
73 for (std::size_t i = 0; i < views.size(); ++i) {
76 float tmpNCC = sampler->getFastNCC(i);
83 viewDir[i] = (p - views[i]->camPos).normalized();
84 epipolarPlane[i] = (viewDir[i].cross(refDir)).normalized();
86 IndexSet::const_iterator sel;
88 viewDir[*sel] = (p - views[*sel]->camPos).normalized();
89 epipolarPlane[*sel] = (viewDir[*sel].cross(refDir)).normalized();
96 std::size_t maxView = 0;
98 for (std::size_t i = 0; i < views.size(); ++i) {
101 float score = ncc[i];
104 float nfp = views[i]->footPrint(p);
105 if (mfp / nfp < 0.5f) {
111 float plx = std::acos(dp) * 180.f /
pi;
117 dp =
math::clamp(viewDir[*sel].dot(viewDir[i]), -1.f, 1.f);
118 plx = std::acos(dp) * 180.f /
pi;
122 dp = epipolarPlane[i].dot(epipolarPlane[*sel]);
124 float angle = std::abs(std::acos(dp) * 180.f /
pi);
126 angle = 180.f - angle;
128 angle = std::max(angle, 1.f);
133 if (score > maxScore) {
T const & clamp(T const &v, T const &min=T(0), T const &max=T(1))
Returns value 'v' clamped to the interval specified by 'min' and 'max'.