Beispiel #1
0
bool Archive::open(const char *fileName, const char *room) {
	// Copy the room name if provided
	// If the room name is not provided, it is assumed that
	// we are opening a multi-room archive
	_multipleRoom = room == 0;
	if (!_multipleRoom)
		Common::strlcpy(_roomName, room, sizeof(_roomName));

	if (_file.open(fileName)) {
		_readDirectory();
		return true;
	}
	
	return false;
}
  NICPAlignerGuiMainWindow::NICPAlignerGuiMainWindow(std::string directory, QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) {
    setupUi(this);

    _referenceScene = new QGraphicsScene();
    _currentScene = new QGraphicsScene();
    reference_graphicsView->setScene(_referenceScene);
    current_graphicsView->setScene(_currentScene);
    merge_pushButton->setEnabled(false);

    viewer->setAxisIsDrawn(true);

    // Init file list
    std::set<std::string> filenames = _readDirectory(directory);
    for(std::set<std::string>::const_iterator it = filenames.begin(); it != filenames.end(); ++it) {
      QString listItem(&(*it)[0]);
      if(listItem.endsWith(".pgm", Qt::CaseInsensitive) || listItem.endsWith(".png", Qt::CaseInsensitive)) {
	cloud_selection_listWidget->addItem(listItem);
      }
    }

    // Create class objects
    _sensorOffset = Eigen::Isometry3f::Identity();
    _sensorOffset.matrix().row(3) << 0.0f, 0.0f, 0.0f, 1.0f;

    _pinholeProjector = new nicp::PinholePointProjector();
    _sphericalProjector = new nicp::SphericalPointProjector();
    _depthImageConverterIntegralImage = new DepthImageConverterIntegralImage();
    _alignerProjective = new nicp::AlignerProjective();
    _alignerNN = new nicp::AlignerNN();
    _aligner = _alignerProjective;
    _linearizer = new nicp::Linearizer();
    _linearizer->setAligner(_aligner);
    _selectProjector();
    _statsCalculatorIntegralImage = new nicp::StatsCalculatorIntegralImage();
    _pointInformationMatrixCalculator = new nicp::PointInformationMatrixCalculator();
    _normalInformationMatrixCalculator = new nicp::NormalInformationMatrixCalculator();
    _depthImageConverterIntegralImage->setProjector(_projector);
    _depthImageConverterIntegralImage->setStatsCalculator(_statsCalculatorIntegralImage);
    _depthImageConverterIntegralImage->setPointInformationMatrixCalculator(_pointInformationMatrixCalculator);
    _depthImageConverterIntegralImage->setNormalInformationMatrixCalculator(_normalInformationMatrixCalculator);

    _correspondenceFinderProjective = new nicp::CorrespondenceFinderProjective();
    _correspondenceFinderNN = new nicp::CorrespondenceFinderNN();
    _alignerProjective->setProjector(_projector);
    _alignerProjective->setCorrespondenceFinder(_correspondenceFinderProjective);
    _alignerProjective->setLinearizer(_linearizer);
    _alignerNN->setProjector(_projector);
    _alignerNN->setCorrespondenceFinder(_correspondenceFinderNN);
    _alignerNN->setLinearizer(_linearizer);
    _aligner->setProjector(_projector);
    _aligner->setLinearizer(_linearizer);
    _correspondenceFinder = _aligner->correspondenceFinder();

    // Init class objects
    visualizationUpdate();
    statsUpdate();
    correspondencesUpdate();
    alignerUpdate();
    projectorsUpdate();

    _pngCounter = 0;
    _nicpCounter = 0;
  }