Commit 4834c0c8 authored by Vlad Shakhuro's avatar Vlad Shakhuro

Fix win build errors

parent 95548c98
...@@ -86,7 +86,7 @@ int main(int argc, char *argv[]) ...@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
fs.release(); fs.release();
vector<Rect> objects; vector<Rect> objects;
Mat img = imread(image_path); Mat img = imread(image_path);
detector.detect(img, objects, 1.1, Size(40, 40), detector.detect(img, objects, 1.1f, Size(40, 40),
Size(300, 300), threshold); Size(300, 300), threshold);
imwrite(out_image_path, visualize(img, objects)); imwrite(out_image_path, visualize(img, objects));
} }
...@@ -73,9 +73,9 @@ int main(int argc, char *argv[]) ...@@ -73,9 +73,9 @@ int main(int argc, char *argv[])
string model_filename = parser.get<string>("model_filename"); string model_filename = parser.get<string>("model_filename");
ICFDetectorParams params; ICFDetectorParams params;
params.feature_count = parser.get<size_t>("feature_count"); params.feature_count = int(parser.get<size_t>("feature_count"));
params.weak_count = parser.get<size_t>("weak_count"); params.weak_count = int(parser.get<size_t>("weak_count"));
params.bg_per_image = parser.get<size_t>("bg_per_image"); params.bg_per_image = int(parser.get<size_t>("bg_per_image"));
string model_size = parser.get<string>("model_size"); string model_size = parser.get<string>("model_size");
if( !read_model_size(model_size.c_str(), &params.model_n_rows, if( !read_model_size(model_size.c_str(), &params.model_n_rows,
......
...@@ -194,7 +194,7 @@ public: ...@@ -194,7 +194,7 @@ public:
maxSize — max size of objects in pixels maxSize — max size of objects in pixels
*/ */
void detect(const Mat& image, std::vector<Rect>& objects, void detect(const Mat& image, std::vector<Rect>& objects,
double scaleFactor, Size minSize, Size maxSize, float threshold); float scaleFactor, Size minSize, Size maxSize, float threshold);
/* Write detector to FileStorage */ /* Write detector to FileStorage */
void write(FileStorage &fs) const; void write(FileStorage &fs) const;
......
...@@ -222,7 +222,7 @@ Ptr<FeatureEvaluator> createFeatureEvaluator( ...@@ -222,7 +222,7 @@ Ptr<FeatureEvaluator> createFeatureEvaluator(
else if( type == "icf" ) else if( type == "icf" )
evaluator = new ICFFeatureEvaluatorImpl(features); evaluator = new ICFFeatureEvaluatorImpl(features);
else else
CV_Assert(false); CV_Error(CV_StsBadArg, "type value is either acf or icf");
return Ptr<FeatureEvaluator>(evaluator); return Ptr<FeatureEvaluator>(evaluator);
} }
...@@ -264,7 +264,7 @@ vector<vector<int> > generateFeatures(Size window_size, const std::string& type, ...@@ -264,7 +264,7 @@ vector<vector<int> > generateFeatures(Size window_size, const std::string& type,
} }
} }
else else
CV_Assert(false); CV_Error(CV_StsBadArg, "type value is either acf or icf");
return features; return features;
} }
......
...@@ -191,7 +191,7 @@ void ICFDetector::read(const FileNode& node) ...@@ -191,7 +191,7 @@ void ICFDetector::read(const FileNode& node)
} }
void ICFDetector::detect(const Mat& img, vector<Rect>& objects, void ICFDetector::detect(const Mat& img, vector<Rect>& objects,
double scaleFactor, Size minSize, Size maxSize, float threshold) float scaleFactor, Size minSize, Size maxSize, float threshold)
{ {
float scale_from = min(model_n_cols_ / (float)maxSize.width, float scale_from = min(model_n_cols_ / (float)maxSize.width,
model_n_rows_ / (float)maxSize.height); model_n_rows_ / (float)maxSize.height);
...@@ -205,9 +205,9 @@ void ICFDetector::detect(const Mat& img, vector<Rect>& objects, ...@@ -205,9 +205,9 @@ void ICFDetector::detect(const Mat& img, vector<Rect>& objects,
for( float scale = scale_from; scale < scale_to + 0.001; scale *= scaleFactor ) for( float scale = scale_from; scale < scale_to + 0.001; scale *= scaleFactor )
{ {
cout << "scale " << scale << endl; cout << "scale " << scale << endl;
int new_width = img.cols * scale; int new_width = int(img.cols * scale);
new_width -= new_width % 4; new_width -= new_width % 4;
int new_height = img.rows * scale; int new_height = int(img.rows * scale);
new_height -= new_height % 4; new_height -= new_height % 4;
resize(img, rescaled_image, Size(new_width, new_height)); resize(img, rescaled_image, Size(new_width, new_height));
......
...@@ -92,20 +92,6 @@ static int count(const Mat_<int> &m, int elem) ...@@ -92,20 +92,6 @@ static int count(const Mat_<int> &m, int elem)
return res; return res;
} }
void write(FileStorage& fs, String&, const WaldBoost& waldboost)
{
waldboost.write(fs);
}
void read(const FileNode& node, WaldBoost& w,
const WaldBoost& default_value)
{
if( node.empty() )
w = default_value;
else
w.read(node);
}
void WaldBoostImpl::read(const FileNode& node) void WaldBoostImpl::read(const FileNode& node)
{ {
FileNode params = node["waldboost_params"]; FileNode params = node["waldboost_params"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment