Fix win build errors

pull/40/head
Vlad Shakhuro 11 years ago
parent 95548c9864
commit 4834c0c87f
  1. 2
      modules/adas/tools/fcw_detect/fcw_detect.cpp
  2. 6
      modules/adas/tools/fcw_train/fcw_train.cpp
  3. 2
      modules/xobjdetect/include/opencv2/xobjdetect.hpp
  4. 4
      modules/xobjdetect/src/acffeature.cpp
  5. 6
      modules/xobjdetect/src/icfdetector.cpp
  6. 14
      modules/xobjdetect/src/waldboost.cpp

@ -86,7 +86,7 @@ int main(int argc, char *argv[])
fs.release();
vector<Rect> objects;
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);
imwrite(out_image_path, visualize(img, objects));
}

@ -73,9 +73,9 @@ int main(int argc, char *argv[])
string model_filename = parser.get<string>("model_filename");
ICFDetectorParams params;
params.feature_count = parser.get<size_t>("feature_count");
params.weak_count = parser.get<size_t>("weak_count");
params.bg_per_image = parser.get<size_t>("bg_per_image");
params.feature_count = int(parser.get<size_t>("feature_count"));
params.weak_count = int(parser.get<size_t>("weak_count"));
params.bg_per_image = int(parser.get<size_t>("bg_per_image"));
string model_size = parser.get<string>("model_size");
if( !read_model_size(model_size.c_str(), &params.model_n_rows,

@ -194,7 +194,7 @@ public:
maxSize max size of objects in pixels
*/
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 */
void write(FileStorage &fs) const;

@ -222,7 +222,7 @@ Ptr<FeatureEvaluator> createFeatureEvaluator(
else if( type == "icf" )
evaluator = new ICFFeatureEvaluatorImpl(features);
else
CV_Assert(false);
CV_Error(CV_StsBadArg, "type value is either acf or icf");
return Ptr<FeatureEvaluator>(evaluator);
}
@ -264,7 +264,7 @@ vector<vector<int> > generateFeatures(Size window_size, const std::string& type,
}
}
else
CV_Assert(false);
CV_Error(CV_StsBadArg, "type value is either acf or icf");
return features;
}

@ -191,7 +191,7 @@ void ICFDetector::read(const FileNode& node)
}
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,
model_n_rows_ / (float)maxSize.height);
@ -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 )
{
cout << "scale " << scale << endl;
int new_width = img.cols * scale;
int new_width = int(img.cols * scale);
new_width -= new_width % 4;
int new_height = img.rows * scale;
int new_height = int(img.rows * scale);
new_height -= new_height % 4;
resize(img, rescaled_image, Size(new_width, new_height));

@ -92,20 +92,6 @@ static int count(const Mat_<int> &m, int elem)
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)
{
FileNode params = node["waldboost_params"];

Loading…
Cancel
Save