예제 #1
0
파일: lk.cpp 프로젝트: azaganidis/rgbdpro
//extract indices of largest planar component
pcl::PointIndices::Ptr extractIndicesPCD(pcl::PointCloud<pcl::PointXYZ>::Ptr pcd_t){ 
    pcl::PointCloud<pcl::PointXYZ>::Ptr pcd(new pcl::PointCloud<pcl::PointXYZ>());
    (*pcd) = (*pcd_t); //devo fare una copia altrimenti filtro l'originale
    pcl::ExtractIndices<pcl::PointXYZ> extract;
    pcl::ModelCoefficients::Ptr coefficients (new pcl::ModelCoefficients ());
    pcl::PointIndices::Ptr inliers (new pcl::PointIndices ());
    
    pcl::SACSegmentation<pcl::PointXYZ> seg;
    seg.setOptimizeCoefficients (true);
    seg.setModelType (pcl::SACMODEL_PLANE);
    seg.setMethodType (pcl::SAC_RANSAC);
    seg.setMaxIterations (500);
    seg.setDistanceThreshold (0.01);
    
    // Segment the largest planar component from the remaining cloud
    seg.setInputCloud (pcd);
    seg.segment (*inliers, *coefficients);
    if (inliers->indices.size () == 0)
    {
        std::cerr << "Could not estimate a planar model for the given dataset." << std::endl;
    }
    // Extract the inliers
    extract.setInputCloud (pcd);
    extract.setIndices (inliers);
    extract.setNegative (false);
    extract.filter (*pcd);
    
    return inliers;
}
예제 #2
0
clams::Cloud::Ptr clams::StreamSequenceBase::getCloud(double timestamp, double* dt) const
{
  Cloud::Ptr pcd(new Cloud);
  Frame frame;
  readFrame(timestamp, dt, &frame);
  proj_.frameToCloud(frame, pcd.get());
  return pcd;
}
예제 #3
0
clams::Cloud::Ptr clams::StreamSequenceBase::getCloud(size_t idx) const
{
  Cloud::Ptr pcd(new Cloud);
  Frame frame;
  readFrame(idx, &frame);
  proj_.frameToCloud(frame, pcd.get());
  return pcd;
}
예제 #4
0
/* PaletteEntryPanel::colourise
 * Colourises the colours of the current palette
 *******************************************************************/
bool PaletteEntryPanel::colourise()
{
	Palette8bit* pal = new Palette8bit;
	if (pal == NULL) return false;
	pal->copyPalette(palettes[cur_palette]);
	PaletteColouriseDialog pcd(theMainWindow, pal);
	if (pcd.ShowModal() == wxID_OK)
	{
		palettes[cur_palette]->copyPalette(pcd.getFinalPalette());
		showPalette(cur_palette);
		setModified();
	}
	delete pal;
	return true;
}