当前位置: 首页>>代码示例>>C++>>正文


C++ Octree::getDepth方法代码示例

本文整理汇总了C++中Octree::getDepth方法的典型用法代码示例。如果您正苦于以下问题:C++ Octree::getDepth方法的具体用法?C++ Octree::getDepth怎么用?C++ Octree::getDepth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Octree的用法示例。


在下文中一共展示了Octree::getDepth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void sure::keypoints::allocateEntropyPayload(Octree& octree, Scalar samplingrate, sure::memory::FixedSizeAllocatorWithDirectAccess<EntropyPayload>& allocator)
{
  unsigned depth = octree.getDepth(samplingrate);
  allocator.resizeIfSmaller(octree[depth].size());
  for(unsigned int i=0; i<octree[depth].size(); ++i)
  {
    Node* node = octree[depth][i];
    EntropyPayload* payload = allocator.allocate(i);
    node->setOptionalPayload(static_cast<sure::payload::Payload*>(payload));
  }
}
开发者ID:bigjun,项目名称:sure3d,代码行数:11,代码来源:keypoint_calculation.cpp

示例2: keypoints

unsigned sure::keypoints::extractKeypoints(Octree& octree, Scalar samplingrate, Scalar searchRadius, Scalar featureRadius, std::vector<Feature>& features, std::vector<Node*>& keypointNodes)
{
  unsigned samplingDepth = octree.getDepth(samplingrate);
  unsigned keypoints(0);

  for(unsigned int i=0; i<octree[samplingDepth].size(); ++i)
  {
    Node* currNode = octree[samplingDepth][i];
    EntropyPayload* payload = static_cast<EntropyPayload*>(currNode->opt());
    if( payload->flag_ != POSSIBLE )
    {
      continue;
    }
    NodeVector neighbors = octree.getNodes(currNode, octree.getUnitSize(searchRadius));
    for(unsigned int j=0; j<neighbors.size(); ++j)
    {
      Node* currNeighbor = neighbors[j];
      EntropyPayload* neighborPayload = static_cast<EntropyPayload*>(currNeighbor->opt());
      if( neighborPayload->flag_ == IS_MAXIMUM )
      {
        payload->flag_ = SUPPRESSED;
        break;
      }
      else if( neighborPayload->flag_ == POSSIBLE )
      {
        if( payload->entropy_ < neighborPayload->entropy_ )
        {
          payload->flag_ = SUPPRESSED;
          break;
        }
      }
      else
      {
        continue;
      }
    }
    if( payload->flag_ == POSSIBLE )
    {
      payload->flag_ = IS_MAXIMUM;
      sure::feature::Feature f;

      f.radius() = featureRadius;
      f.position() = currNode->fixed().getMeanPosition();
      features.push_back(f);
      keypointNodes.push_back(currNode);
      keypoints++;
    }
  }
  return keypoints;
}
开发者ID:bigjun,项目名称:sure3d,代码行数:50,代码来源:keypoint_calculation.cpp

示例3: switch

void sure::keypoints::calculateEntropy(Octree& octree, Scalar samplingrate, Scalar normalSamplingrate, Scalar radius, Scalar threshold, EntropyCalculationMode mode, Scalar influenceRadius)
{
  unsigned samplingDepth = octree.getDepth(samplingrate);

  for(unsigned int i=0; i<octree[samplingDepth].size(); ++i)
  {
    Node* node = octree[samplingDepth][i];
    EntropyPayload* payload = static_cast<EntropyPayload*>(node->opt());

    if( payload->flag_ != NOT_CALCULATED )
    {
      continue;
    }

    switch( mode )
    {
      default:
      case NORMALS:
        payload->entropy_ = calculateEntropyWithNormals(octree, node, normalSamplingrate, radius, influenceRadius);
        break;
      case CROSS_PRODUCTS_W_MAIN:
        payload->entropy_ = calculateEntropyWithCrossproducts(octree, node, normalSamplingrate, radius, influenceRadius);
        break;
      case CROSS_PRODUCTS_PAIRWISE:
        payload->entropy_ = calculateEntropyWithCrossproductsPairwise(octree, node, normalSamplingrate, radius, influenceRadius);
        break;
    }

    if( payload->entropy_ < threshold )
    {
      payload->flag_ = ENTROPY_TOO_LOW;
      continue;
    }
    payload->flag_ = POSSIBLE;
  }
}
开发者ID:bigjun,项目名称:sure3d,代码行数:36,代码来源:keypoint_calculation.cpp


注:本文中的Octree::getDepth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。