void PinholePointProjector::projectIntervals(IntImage &intervalImage, 
					       const DepthImage &depthImage, 
					       const float worldRadius) const {
    assert(depthImage.rows > 0 && depthImage.cols > 0 && "PinholePointProjector: 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);
      int *i = &intervalImage(r, 0);
      for(int c = 0; c < depthImage.cols; c++, f++, i++) {
	*i = _projectInterval(r, c, *f, worldRadius);
      }
    }
  }
示例#2
0
  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);
    	}
    }
  }