Ask Your Question

Revision history [back]

For people who may be interested in the question in the future. I believe you all want to use the ICPCUDA code. If you want to get the same result as using pangolin after replacing it by opencv you need

1: Use cv::Mat firstRaw = cv::imread(first_path , -1); to read image
2: divided the image value by 5(original code has a scale 5). Something like

void loadDepthOpencv(cv::Mat &firstRaw, std::string path) {

  for (unsigned int i = 0; i < firstRaw.rows; i++) {
    for (unsigned int j = 0; j < firstRaw.cols; j++) {
      firstRaw.ptr<ushort>(i)[j] = firstRaw.ptr<ushort>(i)[j]/5;
    }
  }

  return;
}

3: Give the scaled data to ICP model

  icpOdom.initICPModel((unsigned short*)firstRaw.data);
  icpOdom.initICP((unsigned short*)secondRaw.data);//same work flow as the first one