本文整理匯總了C++中CBlob::AddInternalContour方法的典型用法代碼示例。如果您正苦於以下問題:C++ CBlob::AddInternalContour方法的具體用法?C++ CBlob::AddInternalContour怎麽用?C++ CBlob::AddInternalContour使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CBlob
的用法示例。
在下文中一共展示了CBlob::AddInternalContour方法的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;
}