mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Update bagofwords.cpp
This commit is contained in:
parent
fc742da6e3
commit
ba5f9d68c4
@ -91,11 +91,7 @@ Mat BOWKMeansTrainer::cluster() const
|
|||||||
{
|
{
|
||||||
CV_Assert( !descriptors.empty() );
|
CV_Assert( !descriptors.empty() );
|
||||||
|
|
||||||
int descCount = 0;
|
Mat mergedDescriptors( descriptorsCount(), descriptors[0].cols, descriptors[0].type() );
|
||||||
for( size_t i = 0; i < descriptors.size(); i++ )
|
|
||||||
descCount += descriptors[i].rows;
|
|
||||||
|
|
||||||
Mat mergedDescriptors( descCount, descriptors[0].cols, descriptors[0].type() );
|
|
||||||
for( size_t i = 0, start = 0; i < descriptors.size(); i++ )
|
for( size_t i = 0, start = 0; i < descriptors.size(); i++ )
|
||||||
{
|
{
|
||||||
Mat submut = mergedDescriptors.rowRange((int)start, (int)(start + descriptors[i].rows));
|
Mat submut = mergedDescriptors.rowRange((int)start, (int)(start + descriptors[i].rows));
|
||||||
|
Loading…
Reference in New Issue
Block a user