コード例 #1
0
ファイル: extracter.cpp プロジェクト: aa755/cfg3d
int main(int argc, char** argv) {
    ros::init(argc, argv, "Extractor");
    Extractor p;

    p.initialize(std::string(argv[1]));
    int i = 0;
    while(i < 1000 && p.compute_object(i)) {
        i++;
    }

    return (0);
}
コード例 #2
0
void getRectangles(const std::string &filename, std::vector<Flap> &rects) {
  Extractor p;

  // Get planes from point cloud
  std::vector<pcl::PointCloud<Point>::ConstPtr > segments;
  std::vector<pcl::ModelCoefficients::Ptr> coefficients;
  p.initializeFromFilename(filename);
  int i = 0;
  while ((i < 9) && (p.compute_object(i, segments, coefficients))) {
    std::vector<Eigen::Vector3f> corners;
    Flap rect = {segments.at(i), coefficients.at(i), corners};
    // this_flap.segment = segments.at(i);
    // this_flap.normal = coefficients.at(i);
    // this_flap.corners = corners;
    fitPlaneToRect(rect);

    rects.push_back(rect);
    i++;
  }

  std::cout << "num planes found: " << rects.size() << std::endl;
}