本文整理汇总了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));
}
}
示例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;
}
示例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;
}
}