Fixed reading/writing parameters for OrbDescriptorExtractor

This commit is contained in:
Andrey Kamaev 2011-08-04 06:18:24 +00:00
parent ff9da914ec
commit be5328178f
2 changed files with 3 additions and 2 deletions

View File

@ -261,6 +261,7 @@ void OrbDescriptorExtractor::computeImpl(const cv::Mat& image, std::vector<cv::K
void OrbDescriptorExtractor::read(const cv::FileNode& fn) void OrbDescriptorExtractor::read(const cv::FileNode& fn)
{ {
params_.read(fn); params_.read(fn);
orb_ = ORB(0, params_);
} }
void OrbDescriptorExtractor::write(cv::FileStorage& fs) const void OrbDescriptorExtractor::write(cv::FileStorage& fs) const
{ {

View File

@ -445,7 +445,7 @@ void ORB::CommonParams::read(const FileNode& fn)
{ {
scale_factor_ = fn["scaleFactor"]; scale_factor_ = fn["scaleFactor"];
n_levels_ = int(fn["nLevels"]); n_levels_ = int(fn["nLevels"]);
first_level_ = int(fn["firsLevel"]); first_level_ = int(fn["firstLevel"]);
edge_threshold_ = fn["edgeThreshold"]; edge_threshold_ = fn["edgeThreshold"];
patch_size_ = fn["patchSize"]; patch_size_ = fn["patchSize"];
} }
@ -454,7 +454,7 @@ void ORB::CommonParams::write(FileStorage& fs) const
{ {
fs << "scaleFactor" << scale_factor_; fs << "scaleFactor" << scale_factor_;
fs << "nLevels" << int(n_levels_); fs << "nLevels" << int(n_levels_);
fs << "firsLevel" << int(first_level_); fs << "firstLevel" << int(first_level_);
fs << "edgeThreshold" << int(edge_threshold_); fs << "edgeThreshold" << int(edge_threshold_);
fs << "patchSize" << int(patch_size_); fs << "patchSize" << int(patch_size_);
} }