Fixed issue 22

git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@339 620bd6b2-0a58-f614-fd9a-1bd335dccda9
This commit is contained in:
matlabbe 2014-06-19 15:29:00 +00:00
parent 580aa6c6fc
commit 83e932eae3
2 changed files with 8 additions and 1 deletions

View File

@ -462,6 +462,7 @@ void ParametersToolBox::changeParameter(const int & value)
{ {
QComboBox * descriptorBox = (QComboBox*)this->getParameterWidget(Settings::kFeature2D_2Descriptor()); QComboBox * descriptorBox = (QComboBox*)this->getParameterWidget(Settings::kFeature2D_2Descriptor());
QComboBox * nnBox = (QComboBox*)this->getParameterWidget(Settings::kNearestNeighbor_1Strategy()); QComboBox * nnBox = (QComboBox*)this->getParameterWidget(Settings::kNearestNeighbor_1Strategy());
QComboBox * distBox = (QComboBox*)this->getParameterWidget(Settings::kNearestNeighbor_2Distance_type());
bool isBinaryDescriptor = descriptorBox->currentText().compare("ORB") == 0 || bool isBinaryDescriptor = descriptorBox->currentText().compare("ORB") == 0 ||
descriptorBox->currentText().compare("Brief") == 0 || descriptorBox->currentText().compare("Brief") == 0 ||
descriptorBox->currentText().compare("BRISK") == 0 || descriptorBox->currentText().compare("BRISK") == 0 ||
@ -481,9 +482,11 @@ void ParametersToolBox::changeParameter(const int & value)
*tmp.begin() = '8'; // set HAMMING *tmp.begin() = '8'; // set HAMMING
Settings::setNearestNeighbor_2Distance_type(tmp); Settings::setNearestNeighbor_2Distance_type(tmp);
nnBox->blockSignals(true); nnBox->blockSignals(true);
distBox->blockSignals(true);
this->updateParameter(Settings::kNearestNeighbor_1Strategy()); this->updateParameter(Settings::kNearestNeighbor_1Strategy());
this->updateParameter(Settings::kNearestNeighbor_2Distance_type()); this->updateParameter(Settings::kNearestNeighbor_2Distance_type());
nnBox->blockSignals(false); nnBox->blockSignals(false);
distBox->blockSignals(false);
if(sender() == nnBox) if(sender() == nnBox)
{ {
this->updateParametersVisibility(); this->updateParametersVisibility();
@ -491,6 +494,7 @@ void ParametersToolBox::changeParameter(const int & value)
} }
nnStrategyChanged = true; nnStrategyChanged = true;
paramChanged.append(Settings::kNearestNeighbor_1Strategy()); paramChanged.append(Settings::kNearestNeighbor_1Strategy());
paramChanged.append(Settings::kNearestNeighbor_2Distance_type());
} }
else if(!isBinaryDescriptor && nnBox->currentText().compare("Lsh") == 0) else if(!isBinaryDescriptor && nnBox->currentText().compare("Lsh") == 0)
{ {
@ -507,9 +511,11 @@ void ParametersToolBox::changeParameter(const int & value)
*tmp.begin() = '0'; // set EUCLIDEAN_L2 *tmp.begin() = '0'; // set EUCLIDEAN_L2
Settings::setNearestNeighbor_2Distance_type(tmp); Settings::setNearestNeighbor_2Distance_type(tmp);
nnBox->blockSignals(true); nnBox->blockSignals(true);
distBox->blockSignals(true);
this->updateParameter(Settings::kNearestNeighbor_1Strategy()); this->updateParameter(Settings::kNearestNeighbor_1Strategy());
this->updateParameter(Settings::kNearestNeighbor_2Distance_type()); this->updateParameter(Settings::kNearestNeighbor_2Distance_type());
nnBox->blockSignals(false); nnBox->blockSignals(false);
distBox->blockSignals(false);
if(sender() == nnBox) if(sender() == nnBox)
{ {
this->updateParametersVisibility(); this->updateParametersVisibility();
@ -517,6 +523,7 @@ void ParametersToolBox::changeParameter(const int & value)
} }
nnStrategyChanged = true; nnStrategyChanged = true;
paramChanged.append(Settings::kNearestNeighbor_1Strategy()); paramChanged.append(Settings::kNearestNeighbor_1Strategy());
paramChanged.append(Settings::kNearestNeighbor_2Distance_type());
} }
} }

View File

@ -597,7 +597,7 @@ cvflann::flann_distance_t Settings::getFlannDistanceType()
if(ok) if(ok)
{ {
QStringList strategies = split.last().split(';'); QStringList strategies = split.last().split(';');
if(strategies.size() == 8 && index>=0 && index<8) if(strategies.size() == 9 && index>=0 && index<=8)
{ {
distance = (cvflann::flann_distance_t)(index+1); distance = (cvflann::flann_distance_t)(index+1);
} }