本文整理汇总了C++中CBlob::GetStorage方法的典型用法代码示例。如果您正苦于以下问题:C++ CBlob::GetStorage方法的具体用法?C++ CBlob::GetStorage怎么用?C++ CBlob::GetStorage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlob
的用法示例。
在下文中一共展示了CBlob::GetStorage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComponentLabeling
//.........这里部分代码省略.........
{
pLabels++;
pVisitedPoints++;
continue;
}
// new external contour: current label == 0 and above pixel is background
if( j > 0 )
{
externalContour = ((*pAboveInputImage == backgroundColor) ||
(maskImage && *pAboveMask == 0)) &&
(*pLabels == 0);
}
else
externalContour = (*pLabels == 0);
// new internal contour: below pixel is background and not visited
if( !externalContour && j < imageHeight - 1 )
{
internalContour = *pBelowInputImage == backgroundColor &&
!GET_BELOW_VISITEDPIXEL( pVisitedPoints, imageWidth);
}
else
{
internalContour = false;
}
if( externalContour )
{
currentPoint = cvPoint(i,j);
// assign label to labelled image
*pLabels = currentLabel;
// create new blob
currentBlob = new CBlob(currentLabel, currentPoint, imageSizes );
// contour tracing with currentLabel
contourTracing( inputImage, maskImage, currentPoint,
labelledImage, visitedPoints,
currentLabel, false, backgroundColor, currentBlob->GetExternalContour() );
// add new created blob
blobs.push_back(currentBlob);
currentLabel++;
}
else
{
if( internalContour )
{
currentPoint = cvPoint(i,j);
if( *pLabels == 0 )
{
// take left neightbour value as current
if( i > 0 )
contourLabel = *(pLabels - 1);
}
else
{
contourLabel = *pLabels;
}
if(contourLabel>0)
{
currentBlob = blobs[contourLabel-1];
CBlobContour newContour(currentPoint, currentBlob->GetStorage());
// contour tracing with contourLabel
contourTracing( inputImage, maskImage, currentPoint, labelledImage, visitedPoints,
contourLabel, true, backgroundColor, &newContour );
currentBlob->AddInternalContour( newContour );
}
}
// neither internal nor external contour
else
{
// take left neightbour value as current if it is not labelled
if( i > 0 && *pLabels == 0 )
*pLabels = *(pLabels - 1);
}
}
pLabels++;
pVisitedPoints++;
}
}
// free auxiliary buffers
free( labelledImage );
free( visitedPoints );
return true;
}