diff --git a/src/FileStorageModel.cpp b/src/FileStorageModel.cpp index b1392ae..235ad81 100644 --- a/src/FileStorageModel.cpp +++ b/src/FileStorageModel.cpp @@ -37,6 +37,7 @@ */ #include +#include #include #include "FileStorageModel.hpp" @@ -145,7 +146,12 @@ bool FileStorageModel::deserialize(const std::string& filename) { part["parentid"] >> parentid_[c][p]; part["filterid"] >> filterid_[c][p]; part["biasid"] >> biasid_[c][p]; - part["defid"] >> defid_[c][p]; + + cv::FileNode defid = part["defid"]; + if(defid.isInt()) + defid >> defid_[c][p]; + else + defid_[c][p].push_back(0); } } diff --git a/src/Visualize.cpp b/src/Visualize.cpp index 20574db..87b9375 100644 --- a/src/Visualize.cpp +++ b/src/Visualize.cpp @@ -64,7 +64,7 @@ void Visualize::candidates(const Mat& im, const vectorCandidate& candidates, uns const unsigned int ncolors = candidates[0].parts().size(); vector colors; for (unsigned int n = 0; n < ncolors; ++n) { - Mat color(Size(1,1), CV_32FC3); + Mat color(Size(1,3), CV_32FC3); // Hue is in degrees, not radians (because consistency is over-rated) color.at(0) = (360) / ncolors * n; color.at(1) = 1.0;