void CylindricalPointProjector::projectIntervals(IntervalImage &intervalImage, const DepthImage &depthImage, const float worldRadius) const { assert(depthImage.rows > 0 && depthImage.cols > 0 && "CylindricalPointProjector: Depth image has zero dimensions"); intervalImage.create(depthImage.rows, depthImage.cols); for(int r = 0; r < depthImage.rows; r++){ const float *f = &depthImage(r, 0); cv::Vec2i *i = &intervalImage(r, 0); for(int c = 0; c < depthImage.cols; c++, f++, i++) { *i = _projectInterval(r, c, *f, worldRadius); } } }
void SphericalPointProjector::projectIntervals(IntervalImage &intervalImage, const DepthImage &depthImage, const float worldRadius) const { if(_imageRows == 0 || _imageCols == 0) { throw "SphericalPointProjector: Depth image has zero dimensions"; } intervalImage.create(depthImage.rows, depthImage.cols); for(int r = 0; r < depthImage.rows; r++){ const float *f = &depthImage(r, 0); cv::Vec2i *i = &intervalImage(r, 0); for(int c = 0; c < depthImage.cols; c++, f++, i++) { *i = _projectInterval(r, c, *f, worldRadius); } } }