@@ -60,13 +60,13 @@ struct LshIndexParams : public IndexParams
60
60
{
61
61
LshIndexParams (unsigned int table_number = 12 , unsigned int key_size = 20 , unsigned int multi_probe_level = 2 )
62
62
{
63
- (* this )[" algorithm" ] = FLANN_INDEX_LSH;
63
+ (*this )[" algorithm" ] = FLANN_INDEX_LSH;
64
64
// The number of hash tables to use
65
- (*this )[" table_number" ] = table_number;
65
+ (*this )[" table_number" ] = static_cast < int >( table_number) ;
66
66
// The length of the key in the hash tables
67
- (*this )[" key_size" ] = key_size;
67
+ (*this )[" key_size" ] = static_cast < int >( key_size) ;
68
68
// Number of levels to use in multi-probe (0 for standard LSH)
69
- (*this )[" multi_probe_level" ] = multi_probe_level;
69
+ (*this )[" multi_probe_level" ] = static_cast < int >( multi_probe_level) ;
70
70
}
71
71
};
72
72
@@ -94,9 +94,9 @@ class LshIndex : public NNIndex<Distance>
94
94
{
95
95
// cv::flann::IndexParams sets integer params as 'int', so it is used with get_param
96
96
// in place of 'unsigned int'
97
- table_number_ = ( unsigned int ) get_param< int > (index_params_," table_number" ,12 );
98
- key_size_ = ( unsigned int ) get_param< int > (index_params_," key_size" ,20 );
99
- multi_probe_level_ = ( unsigned int ) get_param< int > (index_params_," multi_probe_level" ,2 );
97
+ table_number_ = get_param (index_params_," table_number" ,12 );
98
+ key_size_ = get_param (index_params_," key_size" ,20 );
99
+ multi_probe_level_ = get_param (index_params_," multi_probe_level" ,2 );
100
100
101
101
feature_size_ = (unsigned )dataset_.cols ;
102
102
fill_xor_mask (0 , key_size_, multi_probe_level_, xor_masks_);
@@ -112,7 +112,7 @@ class LshIndex : public NNIndex<Distance>
112
112
void buildIndex () CV_OVERRIDE
113
113
{
114
114
tables_.resize (table_number_);
115
- for (unsigned int i = 0 ; i < table_number_; ++i) {
115
+ for (int i = 0 ; i < table_number_; ++i) {
116
116
lsh::LshTable<ElementType>& table = tables_[i];
117
117
table = lsh::LshTable<ElementType>(feature_size_, key_size_);
118
118
@@ -378,11 +378,11 @@ class LshIndex : public NNIndex<Distance>
378
378
IndexParams index_params_;
379
379
380
380
/* * table number */
381
- unsigned int table_number_;
381
+ int table_number_;
382
382
/* * key size */
383
- unsigned int key_size_;
383
+ int key_size_;
384
384
/* * How far should we look for neighbors in multi-probe LSH */
385
- unsigned int multi_probe_level_;
385
+ int multi_probe_level_;
386
386
387
387
/* * The XOR masks to apply to a key to get the neighboring buckets */
388
388
std::vector<lsh::BucketKey> xor_masks_;
0 commit comments