本文整理汇总了C++中Booster::setShowDebugInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ Booster::setShowDebugInfo方法的具体用法?C++ Booster::setShowDebugInfo怎么用?C++ Booster::setShowDebugInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Booster
的用法示例。
在下文中一共展示了Booster::setShowDebugInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trainWithChannels
// input: multiple imgPtr, gtPtr (arrays of pointers)
// multiple img sizes
// returns a BoosterModel *
// -- BEWARE: this function is a mix of dirty tricks right now
DLL_EXPORT
void * trainWithChannels( ImagePixelType **imgPtr,
void **evecPtr,
GTPixelType **gtPtr,
int *width, int *height, int *depth,
int numStacks,
IntegralImagePixelType **chImgPtr,
int numChannels, double zAnisotropyFactor,
int numStumps,
int gtNegativeLabel, int gtPositiveLabel,
int debugOutput )
{
BoosterModel *modelPtr = 0;
try
{
std::unique_ptr<ROIData[]> rois(new ROIData[numStacks]); // TODO: remove
MultipleROIData allROIs;
std::unique_ptr<ROIData::IntegralImageType[]> ii(new ROIData::IntegralImageType[numStacks*numChannels]); // TODO: remove
for (int i=0; i < numStacks; i++)
{
rois[i].setGTNegativeSampleLabel(gtNegativeLabel);
rois[i].setGTPositiveSampleLabel(gtPositiveLabel);
rois[i].init( imgPtr[i], gtPtr[i], 0, 0, width[i], height[i], depth[i],
zAnisotropyFactor, 0.0, (const ROIData::RotationMatrixType *) evecPtr[i] );
for (int ch=0; ch < numChannels; ch++)
{
ii[i*numChannels+ch].fromSharedData(chImgPtr[i*numChannels+ch], width[i], height[i], depth[i]);
rois[i].addII( ii[i*numChannels+ch].internalImage().data() );
}
allROIs.add( shared_ptr_nodelete(ROIData, &rois[i]) );
}
BoosterInputData bdata;
bdata.init( shared_ptr_nodelete(MultipleROIData, &allROIs) );
bdata.showInfo();
Booster adaboost;
adaboost.setShowDebugInfo( debugOutput != 0 );
adaboost.train( bdata, numStumps );
// create by copying
modelPtr = new BoosterModel( adaboost.model() );
}
catch( std::exception &e )
{
printf("Error training: %s\n", e.what());
delete modelPtr;
return 0;
}
return modelPtr;
}
示例2: train
// input: multiple imgPtr, gtPtr (arrays of pointers)
// multiple img sizes
// returns a BoosterModel *
// -- BEWARE: this function is a mix of dirty tricks right now
DLL_EXPORT
void * train( ImagePixelType **imgPtr, GTPixelType **gtPtr,
int *width, int *height, int *depth,
int numStacks,
int numStumps, int debugOutput )
{
BoosterModel *modelPtr = 0;
try
{
std::unique_ptr<ROIData[]> rois(new ROIData[numStacks]); // TODO: remove
std::unique_ptr<ROIData::IntegralImageType[]> ii(new ROIData::IntegralImageType[numStacks]); // TODO: remove
MultipleROIData allROIs;
for (int i=0; i < numStacks; i++)
{
rois[i].init( imgPtr[i], gtPtr[i], 0, 0, width[i], height[i], depth[i] );
// raw image to integral image
// TODO: this should be removed and passed directly to train()
ii[i].compute( rois[i].rawImage );
rois[i].addII( ii[i].internalImage().data() );
allROIs.add( shared_ptr_nodelete(ROIData, &rois[i]) );
}
BoosterInputData bdata;
bdata.init( shared_ptr_nodelete(MultipleROIData, &allROIs) );
bdata.showInfo();
Booster adaboost;
adaboost.setShowDebugInfo( debugOutput != 0 );
adaboost.train( bdata, numStumps );
// create by copying
modelPtr = new BoosterModel( adaboost.model() );
}
catch( std::exception &e )
{
printf("Error training: %s\n", e.what());
delete modelPtr;
return 0;
}
return modelPtr;
}