From 499cf9877e9e48764f333d60766b7a766083cfba Mon Sep 17 00:00:00 2001 From: wky555 Date: Wed, 1 Apr 2015 13:11:25 +0800 Subject: [PATCH 1/2] Update FileStorageModel.cpp --- src/FileStorageModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FileStorageModel.cpp b/src/FileStorageModel.cpp index b8ef87e..9506e8a 100644 --- a/src/FileStorageModel.cpp +++ b/src/FileStorageModel.cpp @@ -146,7 +146,7 @@ bool FileStorageModel::deserialize(const std::string& filename) { part["biasid"] >> biasid_[c][p]; cv::FileNode defid = part["defid"]; - if(defid.isInt()) + if(!defid.isNone()) defid >> defid_[c][p]; else defid_[c][p].push_back(0); From 024e8a7989b650819a9a1ab8567127a5b87aa8bc Mon Sep 17 00:00:00 2001 From: wky555 Date: Wed, 1 Apr 2015 13:23:41 +0800 Subject: [PATCH 2/2] Update Parts.hpp --- include/Parts.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Parts.hpp b/include/Parts.hpp index 56e2306..cfbee69 100644 --- a/include/Parts.hpp +++ b/include/Parts.hpp @@ -171,7 +171,7 @@ class ComponentPart { //! the part's bias vectorf bias(size_t mixture = 0) const { const int offset = (*biasid_)[self_][mixture]; - return vectorf(&((*biasw_)[offset]), &((*biasw_)[offset+nmixtures()])); + return vectorf((*biasw_).begin()+offset, (*biasw_).begin()+offset+nmixtures()); } //! the part's bias index int biasi(size_t mixture = 0) const { return (*biasi_)[(*biasid_)[self_][mixture]]; }