Skip to content
Snippets Groups Projects
Commit 1f53f24b authored by Angel Santamaria-Navarro's avatar Angel Santamaria-Navarro
Browse files

FIX old match roi width and height

parent 54dafbb1
No related branches found
No related tags found
No related merge requests found
Showing
with 8 additions and 56 deletions
...@@ -242,7 +242,7 @@ void AlgorithmACTIVESEARCH::trackFrame(const FramePtr& _frame_old, FramePtr& _tr ...@@ -242,7 +242,7 @@ void AlgorithmACTIVESEARCH::trackFrame(const FramePtr& _frame_old, FramePtr& _tr
hitCell(target_feature[ii]); hitCell(target_feature[ii]);
// Set ROI // Set ROI
cv::Rect roi = setRoi(target_feature[ii].pt.x,target_feature[ii].pt.y, _mat_ptr->getParams()->roi_width, _mat_ptr->getParams()->roi_height); cv::Rect roi = setRoi(target_feature[ii].pt.x,target_feature[ii].pt.y, cell_size_(0), cell_size_(1));
// // draw ROI // // draw ROI
// if (params_ptr_->draw_results) // if (params_ptr_->draw_results)
......
...@@ -96,7 +96,7 @@ void AlgorithmTRACKFEATURES::trackFrame(const FramePtr& _frame_old, FramePtr& _t ...@@ -96,7 +96,7 @@ void AlgorithmTRACKFEATURES::trackFrame(const FramePtr& _frame_old, FramePtr& _t
for(int ii = 1; ii < target_kps.size(); ++ii) for(int ii = 1; ii < target_kps.size(); ++ii)
{ {
// Set a candidate ROI around the target feature // Set a candidate ROI around the target feature
cv::Rect roi = setRoi(target_kps[ii].pt.x, target_kps[ii].pt.y, _mat_ptr->getParams()->roi_width, _mat_ptr->getParams()->roi_width); cv::Rect roi = setRoi(target_kps[ii].pt.x, target_kps[ii].pt.y, params_ptr_->target_roi_height, params_ptr_->target_roi_width);
// // draw ROI // // draw ROI
// if (params_ptr_->draw_results) // if (params_ptr_->draw_results)
......
...@@ -21,7 +21,9 @@ VU_STRUCT_PTR_TYPEDEFS(AlgorithmParamsTRACKFEATURES); ...@@ -21,7 +21,9 @@ VU_STRUCT_PTR_TYPEDEFS(AlgorithmParamsTRACKFEATURES);
*/ */
struct AlgorithmParamsTRACKFEATURES: public AlgorithmParamsBase struct AlgorithmParamsTRACKFEATURES: public AlgorithmParamsBase
{ {
int min_feat_track; // Minimum features to track. With less than this number a new detection is called. int min_feat_track; // Minimum features to track. With less than this number a new detection is called.
int target_roi_width; // ROI width to search for a target match
int target_roi_height; // ROI width to search for a target match
~AlgorithmParamsTRACKFEATURES(){} ~AlgorithmParamsTRACKFEATURES(){}
}; };
......
...@@ -25,6 +25,9 @@ static ParamsBasePtr createParamsTRACKFEATURESAlgorithm(const std::string & _fil ...@@ -25,6 +25,9 @@ static ParamsBasePtr createParamsTRACKFEATURESAlgorithm(const std::string & _fil
{ {
params_ptr->draw_results = d_yaml["draw results"].as<bool>(); params_ptr->draw_results = d_yaml["draw results"].as<bool>();
params_ptr->min_feat_track = d_yaml["min features to track"].as<int>(); params_ptr->min_feat_track = d_yaml["min features to track"].as<int>();
Node troi_yaml = yaml_params["target roi"];
params_ptr->target_roi_width = troi_yaml["width"].as<int>();
params_ptr->target_roi_width = troi_yaml["height"].as<int>();
}else }else
{ {
std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl;
......
...@@ -26,9 +26,6 @@ descriptor: ...@@ -26,9 +26,6 @@ descriptor:
matcher: matcher:
type: "FLANNBASED" type: "FLANNBASED"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
min normalized score: 0.85 min normalized score: 0.85
algorithm: algorithm:
......
...@@ -3,7 +3,3 @@ sensor: ...@@ -3,7 +3,3 @@ sensor:
matcher: matcher:
type: "BRUTEFORCE" type: "BRUTEFORCE"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
\ No newline at end of file
...@@ -4,6 +4,3 @@ sensor: ...@@ -4,6 +4,3 @@ sensor:
matcher: matcher:
type: "BRUTEFORCE_HAMMING" type: "BRUTEFORCE_HAMMING"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
\ No newline at end of file
...@@ -4,6 +4,3 @@ sensor: ...@@ -4,6 +4,3 @@ sensor:
matcher: matcher:
type: "BRUTEFORCE_HAMMING_2" type: "BRUTEFORCE_HAMMING_2"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
\ No newline at end of file
...@@ -4,6 +4,3 @@ sensor: ...@@ -4,6 +4,3 @@ sensor:
matcher: matcher:
type: "BRUTEFORCE_L1" type: "BRUTEFORCE_L1"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
\ No newline at end of file
...@@ -23,9 +23,6 @@ descriptor: ...@@ -23,9 +23,6 @@ descriptor:
matcher: matcher:
type: "FLANNBASED" type: "FLANNBASED"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
min normalized score: 0.85 min normalized score: 0.85
algorithm: algorithm:
......
...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsBRUTEFORCEMatcher(const std::string & _filename ...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsBRUTEFORCEMatcher(const std::string & _filename
params_ptr->match_type = d_yaml["match type"].as<int>(); params_ptr->match_type = d_yaml["match type"].as<int>();
if (d_yaml["min normalized score"]) if (d_yaml["min normalized score"])
params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>(); params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>();
if (d_yaml["roi"]["width"])
params_ptr->roi_width = d_yaml["roi"]["width"].as<unsigned int>();
if (d_yaml["roi"]["height"])
params_ptr->roi_height = d_yaml["roi"]["height"].as<unsigned int>();
}else }else
{ {
std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl;
......
...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsBRUTEFORCE_HAMMINGMatcher(const std::string & _ ...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsBRUTEFORCE_HAMMINGMatcher(const std::string & _
params_ptr->match_type = d_yaml["match type"].as<int>(); params_ptr->match_type = d_yaml["match type"].as<int>();
if (d_yaml["min normalized score"]) if (d_yaml["min normalized score"])
params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>(); params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>();
if (d_yaml["roi"]["width"])
params_ptr->roi_width = d_yaml["roi"]["width"].as<unsigned int>();
if (d_yaml["roi"]["height"])
params_ptr->roi_height = d_yaml["roi"]["height"].as<unsigned int>();
}else }else
{ {
std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl;
......
...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsBRUTEFORCE_HAMMING_2Matcher(const std::string & ...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsBRUTEFORCE_HAMMING_2Matcher(const std::string &
params_ptr->match_type = d_yaml["match type"].as<int>(); params_ptr->match_type = d_yaml["match type"].as<int>();
if (d_yaml["min normalized score"]) if (d_yaml["min normalized score"])
params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>(); params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>();
if (d_yaml["roi"]["width"])
params_ptr->roi_width = d_yaml["roi"]["width"].as<unsigned int>();
if (d_yaml["roi"]["height"])
params_ptr->roi_height = d_yaml["roi"]["height"].as<unsigned int>();
}else }else
{ {
std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl;
......
...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsBRUTEFORCE_L1Matcher(const std::string & _filen ...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsBRUTEFORCE_L1Matcher(const std::string & _filen
params_ptr->match_type = d_yaml["match type"].as<int>(); params_ptr->match_type = d_yaml["match type"].as<int>();
if (d_yaml["min normalized score"]) if (d_yaml["min normalized score"])
params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>(); params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>();
if (d_yaml["roi"]["width"])
params_ptr->roi_width = d_yaml["roi"]["width"].as<unsigned int>();
if (d_yaml["roi"]["height"])
params_ptr->roi_height = d_yaml["roi"]["height"].as<unsigned int>();
}else }else
{ {
std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl;
......
...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsFLANNBASEDMatcher(const std::string & _filename ...@@ -27,10 +27,6 @@ static ParamsBasePtr createParamsFLANNBASEDMatcher(const std::string & _filename
params_ptr->match_type = d_yaml["match type"].as<int>(); params_ptr->match_type = d_yaml["match type"].as<int>();
if (d_yaml["min normalized score"]) if (d_yaml["min normalized score"])
params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>(); params_ptr->min_norm_score = d_yaml["min normalized score"].as<double>();
if (d_yaml["roi"]["width"])
params_ptr->roi_width = d_yaml["roi"]["width"].as<unsigned int>();
if (d_yaml["roi"]["height"])
params_ptr->roi_height = d_yaml["roi"]["height"].as<unsigned int>();
}else }else
{ {
std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl;
......
...@@ -37,8 +37,6 @@ struct MatcherParamsBase: public ParamsBase ...@@ -37,8 +37,6 @@ struct MatcherParamsBase: public ParamsBase
{ {
std::string type; std::string type;
int match_type = MATCH; // Type of Match. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 int match_type = MATCH; // Type of Match. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
int roi_width = 20; // ROI width around a keypoint to search for a match.
int roi_height = 20; // ROI height around a keypoint to search for a match.
double min_norm_score; //< [-1..0]: awful match; 1: perfect match; out of [-1,1]: error double min_norm_score; //< [-1..0]: awful match; 1: perfect match; out of [-1,1]: error
MatcherParamsBase(const std::string& _type): type(_type){} MatcherParamsBase(const std::string& _type): type(_type){}
virtual ~MatcherParamsBase(){} virtual ~MatcherParamsBase(){}
......
...@@ -26,9 +26,6 @@ descriptor: ...@@ -26,9 +26,6 @@ descriptor:
matcher: matcher:
type: "FLANNBASED" type: "FLANNBASED"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
min normalized score: 0.85 min normalized score: 0.85
algorithm: algorithm:
......
...@@ -3,6 +3,3 @@ sensor: ...@@ -3,6 +3,3 @@ sensor:
matcher: matcher:
type: "BRUTEFORCE" type: "BRUTEFORCE"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
\ No newline at end of file
...@@ -3,6 +3,3 @@ sensor: ...@@ -3,6 +3,3 @@ sensor:
matcher: matcher:
type: "BRUTEFORCE_HAMMING" type: "BRUTEFORCE_HAMMING"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
\ No newline at end of file
...@@ -3,6 +3,3 @@ sensor: ...@@ -3,6 +3,3 @@ sensor:
matcher: matcher:
type: "BRUTEFORCE_HAMMING_2" type: "BRUTEFORCE_HAMMING_2"
match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3 match type: 1 # Match type. MATCH = 1, KNNMATCH = 2, RADIUSMATCH = 3
roi:
width: 20
height: 20
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment