13 min_cosine = cos(angle_thres);
14 dist2_thres = dist_thres * dist_thres;
19 int div = 1 << level_index;
20 f = make_float2(fx/div, fy/div);
21 c = make_float2(cx/div, cy/div);
22 finv = make_float2(1.f/f.x, 1.f/f.y);
40 operator float*() {
return locked_buffer.
data; }
41 operator cudaStream_t() {
return stream; }
48 float *data_A = A.val;
49 float *data_b = b.val;
52 for (
int i = 0; i < 6; ++i)
53 for (
int j = i; j < 7; ++j)
55 float value = locked_buffer.
data[shift++];
59 data_A[j * 6 + i] = data_A[i * 6 + j] = value;
70 const int iters[] = {10, 5, 4, 0};
71 std::vector<int> vector_iters(iters, iters + 4);
99 copy(iters.begin(), iters.end(),
iters_.begin());
106 for(; i >= 0 && !
iters_[i]; --i);
121 CV_Assert(!
"Not implemented");
131 affine = Affine3f::Identity();
133 for(
int level_index = LEVELS - 1; level_index >= 0; --level_index)
140 helper.
dcurr = dcurr[level_index];
141 helper.
ncurr = ncurr[level_index];
143 for(
int iter = 0; iter <
iters_[level_index]; ++iter)
146 helper(dprev[level_index], n,
buffer_, sh, sh);
152 double det = cv::determinant(A);
154 if (fabs (det) < 1e-15 || cv::viz::isNan(det))
156 if (cv::viz::isNan(det)) cout <<
"qnan" << endl;
161 cv::solve(A, b, r, cv::DECOMP_SVD);
163 affine = Tinc * affine;
175 affine = Affine3f::Identity();
177 for(
int level_index = LEVELS - 1; level_index >= 0; --level_index)
185 helper.
vcurr = vcurr[level_index];
186 helper.
ncurr = ncurr[level_index];
188 for(
int iter = 0; iter <
iters_[level_index]; ++iter)
197 double det = cv::determinant(A);
199 if (fabs (det) < 1e-15 || cv::viz::isNan (det))
201 if (cv::viz::isNan (det)) cout <<
"qnan" << endl;
206 cv::solve(A, b, r, cv::DECOMP_SVD);
209 affine = Tinc * affine;
std::vector< Cloud > PointsPyr
ProjectiveICP()
ProjectiveICP.
device::ComputeIcpHelper::PageLockHelper PageLockHelper
float getAngleThreshold() const
void setAngleThreshold(float angle)
static void allocate_buffer(DeviceArray2D< float > &buffer, int partials_count=-1)
int rows() const
Returns number of rows.
float getDistThreshold() const
std::vector< Depth > DepthPyr
ComputeIcpHelper(float dist_thres, float angle_thres)
ComputeIcpHelper.
#define cudaSafeCall(expr)
ProjectiveICP::StreamHelper.
D device_cast(const S &source)
std::vector< int > iters_
PageLockHelper locked_buffer
cv::Ptr< StreamHelper > shelp_
std::vector< Normals > NormalsPyr
DeviceArray2D< float > buffer_
virtual bool estimateTransform(Affine3f &affine, const Intr &intr, const Frame &curr, const Frame &prev)
int getUsedLevelsNum() const
float deg2rad(float alpha)
void setDistThreshold(float distance)
void setIterationsNum(const std::vector< int > &iters)
void setLevelIntr(int level_index, float fx, float fy, float cx, float cy)
int cols() const
Returns number of elements in each row.