add const qualifier to detectMultiScale method
This commit is contained in:
parent
9771c3c7ec
commit
2d2c46e717
@ -512,7 +512,7 @@ public:
|
|||||||
|
|
||||||
//! return vector of bounding boxes. Each box contains one detected object
|
//! return vector of bounding boxes. Each box contains one detected object
|
||||||
virtual void detectMultiScale(const Mat& image, const std::vector<cv::Rect>& rois, std::vector<cv::Rect>& objects,
|
virtual void detectMultiScale(const Mat& image, const std::vector<cv::Rect>& rois, std::vector<cv::Rect>& objects,
|
||||||
int rejectfactor = 1);
|
int rejectfactor = 1) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum { BOOST = 0 };
|
enum { BOOST = 0 };
|
||||||
|
@ -419,7 +419,6 @@ struct cv::SoftCascade::Filds
|
|||||||
float rescale(const Feature& feature, const float scaling, const float relScale,
|
float rescale(const Feature& feature, const float scaling, const float relScale,
|
||||||
cv::Rect& scaledRect, const float threshold) const
|
cv::Rect& scaledRect, const float threshold) const
|
||||||
{
|
{
|
||||||
// float scaling = CascadeIntrinsics::getFor(feature.channel, relScale);
|
|
||||||
scaledRect = feature.rect;
|
scaledRect = feature.rect;
|
||||||
|
|
||||||
dprintf("feature %d box %d %d %d %d\n", feature.channel, scaledRect.x, scaledRect.y,
|
dprintf("feature %d box %d %d %d %d\n", feature.channel, scaledRect.x, scaledRect.y,
|
||||||
@ -439,18 +438,13 @@ struct cv::SoftCascade::Filds
|
|||||||
|
|
||||||
float sarea = (scaledRect.width - scaledRect.x) * (scaledRect.height - scaledRect.y);
|
float sarea = (scaledRect.width - scaledRect.x) * (scaledRect.height - scaledRect.y);
|
||||||
|
|
||||||
float approx = 1.f;
|
|
||||||
// if (fabs(farea - 0.f) > FLT_EPSILON && fabs(farea - 0.f) > FLT_EPSILON)
|
|
||||||
{
|
|
||||||
const float expected_new_area = farea * relScale * relScale;
|
const float expected_new_area = farea * relScale * relScale;
|
||||||
approx = sarea / expected_new_area;
|
float approx = sarea / expected_new_area;
|
||||||
|
|
||||||
dprintf(" rel areas %f %f\n", expected_new_area, sarea);
|
dprintf(" rel areas %f %f\n", expected_new_area, sarea);
|
||||||
}
|
|
||||||
|
|
||||||
// compensation areas rounding
|
// compensation areas rounding
|
||||||
float rootThreshold = threshold * approx;
|
float rootThreshold = threshold * approx * scaling;
|
||||||
rootThreshold *= scaling;
|
|
||||||
|
|
||||||
dprintf("approximation %f %f -> %f %f\n", approx, threshold, rootThreshold, scaling);
|
dprintf("approximation %f %f -> %f %f\n", approx, threshold, rootThreshold, scaling);
|
||||||
|
|
||||||
@ -718,7 +712,7 @@ bool cv::SoftCascade::load( const string& filename, const float minScale, const
|
|||||||
//#define DEBUG_SHOW_RESULT
|
//#define DEBUG_SHOW_RESULT
|
||||||
|
|
||||||
void cv::SoftCascade::detectMultiScale(const Mat& image, const std::vector<cv::Rect>& /*rois*/,
|
void cv::SoftCascade::detectMultiScale(const Mat& image, const std::vector<cv::Rect>& /*rois*/,
|
||||||
std::vector<cv::Rect>& objects, const int /*rejectfactor*/)
|
std::vector<cv::Rect>& objects, const int /*rejectfactor*/) const
|
||||||
{
|
{
|
||||||
typedef std::vector<cv::Rect>::const_iterator RIter_t;
|
typedef std::vector<cv::Rect>::const_iterator RIter_t;
|
||||||
// only color images are supperted
|
// only color images are supperted
|
||||||
|
Loading…
x
Reference in New Issue
Block a user