alejocb / dpptam

DPPTAM: Dense Piecewise Planar Tracking and Mapping from a Monocular Sequence
GNU General Public License v3.0
219 stars 82 forks source link

Possible coding mistake in DenseMapping.cpp line 857 #32

Open a3626a opened 7 years ago

a3626a commented 7 years ago

DenseMapping.cpp line 857 is : variance_points_tracked.at(round(projected_points.at(ii, 0)), round(projected_points.at(ii, 1))) = real_points.at(ii, 6);

The statement : real_points.at(ii, 6); really does real_points.at(ii+1, 0);

Because, the width (number of columns) of real_points is 6, and it tries to access out the matrix. However, OpenCV Mat stores data in an one dimensional array which follows the next : at(WANT_ROW, WANT_COL) == data[WANT_ROW * numCols + WANT_COL] so when WANT_COL exceeds number of columns, it accesses the next row.

I changed this code to real_points.at(ii, 5), but DPPTAM still worked. Is this intended or not?