Instrumentation for OpenCV API regions and IPP functions;

This commit is contained in:
Pavel Vlasov
2016-08-18 09:53:00 +03:00
parent 680ca88ce0
commit 30a6cee2fe
133 changed files with 1691 additions and 456 deletions
+8
View File
@@ -89,6 +89,8 @@ BOWKMeansTrainer::BOWKMeansTrainer( int _clusterCount, const TermCriteria& _term
Mat BOWKMeansTrainer::cluster() const
{
CV_INSTRUMENT_REGION()
CV_Assert( !descriptors.empty() );
Mat mergedDescriptors( descriptorsCount(), descriptors[0].cols, descriptors[0].type() );
@@ -106,6 +108,8 @@ BOWKMeansTrainer::~BOWKMeansTrainer()
Mat BOWKMeansTrainer::cluster( const Mat& _descriptors ) const
{
CV_INSTRUMENT_REGION()
Mat labels, vocabulary;
kmeans( _descriptors, clusterCount, labels, termcrit, attempts, flags, vocabulary );
return vocabulary;
@@ -139,6 +143,8 @@ const Mat& BOWImgDescriptorExtractor::getVocabulary() const
void BOWImgDescriptorExtractor::compute( InputArray image, std::vector<KeyPoint>& keypoints, OutputArray imgDescriptor,
std::vector<std::vector<int> >* pointIdxsOfClusters, Mat* descriptors )
{
CV_INSTRUMENT_REGION()
imgDescriptor.release();
if( keypoints.empty() )
@@ -168,6 +174,8 @@ int BOWImgDescriptorExtractor::descriptorType() const
void BOWImgDescriptorExtractor::compute( InputArray keypointDescriptors, OutputArray _imgDescriptor, std::vector<std::vector<int> >* pointIdxsOfClusters )
{
CV_INSTRUMENT_REGION()
CV_Assert( !vocabulary.empty() );
int clusterCount = descriptorSize(); // = vocabulary.rows