1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-21 23:01:45 +08:00

warning fixes

This commit is contained in:
manuele
2014-09-30 14:31:18 +02:00
parent 59099ecbc0
commit a9eebb91f9
5 changed files with 8 additions and 11 deletions

View File

@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
string out_image_path = parser.get<string>("out_image_path"); string out_image_path = parser.get<string>("out_image_path");
bool is_grayscale = parser.get<bool>("is_grayscale"); bool is_grayscale = parser.get<bool>("is_grayscale");
float threshold = parser.get<float>("threshold"); float threshold = parser.get<float>("threshold");
int step = parser.get<float>("step"); int step = parser.get<int>("step");
int min_rows, min_cols, max_rows, max_cols; int min_rows, min_cols, max_rows, max_cols;
string min_window_size = parser.get<string>("min_window_size"); string min_window_size = parser.get<string>("min_window_size");

View File

@@ -26,12 +26,14 @@ using cv::imread;
#include <opencv2/core/utility.hpp> #include <opencv2/core/utility.hpp>
using cv::CommandLineParser; using cv::CommandLineParser;
using cv::FileStorage; using cv::FileStorage;
#include <opencv2/core/utility.hpp>
#include <ctime> // std::time #include <ctime> // std::time
#include <cstdlib> // std::rand, std::srand #include <cstdlib> // std::rand, std::srand
#include <opencv2/xobjdetect.hpp> #include <opencv2/xobjdetect.hpp>
using cv::xobjdetect::ICFDetectorParams; using cv::xobjdetect::ICFDetectorParams;
using cv::xobjdetect::ICFDetector; using cv::xobjdetect::ICFDetector;
using cv::xobjdetect::WaldBoost; using cv::xobjdetect::WaldBoost;
@@ -160,16 +162,12 @@ int main(int argc, char *argv[])
if((int)((params.bg_per_image * bg_filenames.size()) + pos_filenames.size()) >max_samples_allowed) if((int)((params.bg_per_image * bg_filenames.size()) + pos_filenames.size()) >max_samples_allowed)
{ {
std::cout<<std::endl<<"ERROR: exceeded maximum number of samples "<<std::endl<<std::endl; CV_Error_(1, ("exceeded maximum number of samples. Maximum number of samples with %d features is %d\n",features_size,max_samples_allowed ));
std::cout<<"exceeded maximum number of samples (pos + neg) with "<<features_size<<" features is: "<<max_samples_allowed<<std::endl<<std::endl;
CV_Assert(false);
} }
if(params.feature_count >max_features_allowed) if(params.feature_count >max_features_allowed)
{ {
std::cout<<std::endl<<"ERROR: exceeded maximum number of features"<<std::endl<<std::endl; CV_Error_(1, ("exceeded maximum number of features. Maximum number of features with %d samples is %d\n",samples_size,max_features_allowed ));
std::cout<<"maximum number of features with "<<samples_size<<" samples is: "<<max_features_allowed<<std::endl<<std::endl;
CV_Assert(false);
} }
std::cout<<pos_filenames.size()<<std::endl; std::cout<<pos_filenames.size()<<std::endl;

View File

@@ -199,7 +199,7 @@ Detect objects on image.
.. ocv:function:: void ICFDetector::detect(const Mat& image, vector<Rect>& objects, float scaleFactor, Size minSize, Size maxSize, float threshold, int slidingStep, std::vector<float>& values) .. ocv:function:: void ICFDetector::detect(const Mat& image, vector<Rect>& objects, float scaleFactor, Size minSize, Size maxSize, float threshold, int slidingStep, std::vector<float>& values)
.. ocv:function:: detect(const Mat& img, std::vector<Rect>& objects, float minScaleFactor, float maxScaleFactor, float factorStep, float threshold, int slidingStep, std::vector<float>& values); .. ocv:function:: detect(const Mat& img, std::vector<Rect>& objects, float minScaleFactor, float maxScaleFactor, float factorStep, float threshold, int slidingStep, std::vector<float>& values)
:param image: image for detection :param image: image for detection
:param objects: output array of bounding boxes :param objects: output array of bounding boxes

View File

@@ -166,7 +166,7 @@ struct CV_EXPORTS ICFDetectorParams
bool use_fast_log; bool use_fast_log;
ICFDetectorParams(): feature_count(UINT_MAX), weak_count(100), ICFDetectorParams(): feature_count(UINT_MAX), weak_count(100),
model_n_rows(56), model_n_cols(56), bg_per_image(5), alpha(0.02), is_grayscale(false), use_fast_log(false) model_n_rows(56), model_n_cols(56), bg_per_image(5), alpha(0.02f), is_grayscale(false), use_fast_log(false)
{} {}
}; };

View File

@@ -256,8 +256,7 @@ void ICFDetector::detect(const Mat& img, vector<Rect>& objects,
if(factorStep <= 0) if(factorStep <= 0)
{ {
CV_Error(CV_StsBadArg, "factorStep must be > 0"); CV_Error_(CV_StsBadArg, ("factorStep must be > 0"));
CV_Assert(false);
} }
objects.clear(); objects.clear();