min and max params become double

pull/137/head
marina.kolpakova 12 years ago
parent e379771c03
commit 8a3e897999
  1. 11
      modules/objdetect/include/opencv2/objdetect/objdetect.hpp
  2. 4
      modules/objdetect/src/icf.cpp
  3. 6
      modules/objdetect/src/softcascade.cpp

@ -523,12 +523,12 @@ public:
// Param gray is an input 1-channel gray image.
// Param integrals is a vector of integrals. Hog-channels will be appended to it.
// Param bins is a number of hog-bins
void appendHogBins(const cv::Mat gray, std::vector<cv::Mat>& integrals, int bins) const;
void appendHogBins(const cv::Mat& gray, std::vector<cv::Mat>& integrals, int bins) const;
// Converts 3-channel BGR input frame in Luv and appends each channel to the integrals.
// Param frame is an input 3-channel BGR colored image.
// Param integrals is a vector of integrals. Computed from the frame luv-channels will be appended to it.
void appendLuvBins(const cv::Mat frame, std::vector<cv::Mat>& integrals) const;
void appendLuvBins(const cv::Mat& frame, std::vector<cv::Mat>& integrals) const;
private:
int shrinkage;
@ -539,7 +539,7 @@ public:
// Param minScale is a maximum scale relative to the original size of the image on which cascade will be applyed.
// Param scales is a number of scales from minScale to maxScale.
// Param rejfactor is used for NMS.
SCascade(const float minScale = 0.4f, const float maxScale = 5.f, const int scales = 55, const int rejfactor = 1);
SCascade(const double minScale = 0.4, const double maxScale = 5., const int scales = 55, const int rejfactor = 1);
virtual ~SCascade();
@ -564,8 +564,9 @@ private:
struct Fields;
Fields* fields;
float minScale;
float maxScale;
double minScale;
double maxScale;
int scales;
int rejfactor;
};

@ -44,7 +44,7 @@
cv::SCascade::Channels::Channels(int shr) : shrinkage(shr) {}
void cv::SCascade::Channels::appendHogBins(const cv::Mat gray, std::vector<cv::Mat>& integrals, int bins) const
void cv::SCascade::Channels::appendHogBins(const cv::Mat& gray, std::vector<cv::Mat>& integrals, int bins) const
{
CV_Assert(gray.type() == CV_8UC1);
int h = gray.rows;
@ -92,7 +92,7 @@ void cv::SCascade::Channels::appendHogBins(const cv::Mat gray, std::vector<cv::M
integrals.push_back(mag);
}
void cv::SCascade::Channels::appendLuvBins(const cv::Mat frame, std::vector<cv::Mat>& integrals) const
void cv::SCascade::Channels::appendLuvBins(const cv::Mat& frame, std::vector<cv::Mat>& integrals) const
{
CV_Assert(frame.type() == CV_8UC3);
CV_Assert(!(frame.cols % shrinkage) && !(frame.rows % shrinkage));

@ -296,10 +296,10 @@ struct cv::SCascade::Fields
void calcLevels(const cv::Size& curr, float mins, float maxs, int total)
{
if (frameSize == curr && maxs == maxScale && mins == minScale && total == scales) return;
CV_Assert(scales > 1);
frameSize = curr;
maxScale = maxs; minScale = mins; scales = total;
CV_Assert(scales > 1);
levels.clear();
float logFactor = (log(maxScale) - log(minScale)) / (scales -1);
@ -415,7 +415,7 @@ struct cv::SCascade::Fields
}
};
cv::SCascade::SCascade(const float mins, const float maxs, const int nsc, const int rej)
cv::SCascade::SCascade(const double mins, const double maxs, const int nsc, const int rej)
: fields(0), minScale(mins), maxScale(maxs), scales(nsc), rejfactor(rej) {}
cv::SCascade::~SCascade() { delete fields;}
@ -462,7 +462,7 @@ void cv::SCascade::detect(cv::InputArray _image, cv::InputArray _rois, std::vect
CV_Assert(image.type() == CV_8UC3);
Fields& fld = *fields;
fld.calcLevels(image.size(),minScale, maxScale, scales);
fld.calcLevels(image.size(),(float) minScale, (float)maxScale, (float)scales);
objects.clear();

Loading…
Cancel
Save