mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-19 19:44:14 +08:00
Replace a dummy pointer with the smart in ERStat
This commit is contained in:
@@ -82,7 +82,7 @@ public:
|
|||||||
Rect rect;
|
Rect rect;
|
||||||
double raw_moments[2]; //!< order 1 raw moments to derive the centroid
|
double raw_moments[2]; //!< order 1 raw moments to derive the centroid
|
||||||
double central_moments[3]; //!< order 2 central moments to construct the covariance matrix
|
double central_moments[3]; //!< order 2 central moments to construct the covariance matrix
|
||||||
std::deque<int> *crossings;//!< horizontal crossings
|
Ptr<std::deque<int> > crossings;//!< horizontal crossings
|
||||||
float med_crossings; //!< median of the crossings at three different height levels
|
float med_crossings; //!< median of the crossings at three different height levels
|
||||||
|
|
||||||
//! 2nd stage features
|
//! 2nd stage features
|
||||||
|
@@ -97,7 +97,7 @@ ERStat::ERStat(int init_level, int init_pixel, int init_x, int init_y) : pixel(i
|
|||||||
central_moments[0] = 0.0;
|
central_moments[0] = 0.0;
|
||||||
central_moments[1] = 0.0;
|
central_moments[1] = 0.0;
|
||||||
central_moments[2] = 0.0;
|
central_moments[2] = 0.0;
|
||||||
crossings = new deque<int>();
|
crossings = makePtr<deque<int> >();
|
||||||
crossings->push_back(0);
|
crossings->push_back(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,9 +526,7 @@ void ERFilterNM::er_tree_extract( InputArray image )
|
|||||||
ERStat *stat = er_stack.at(r);
|
ERStat *stat = er_stack.at(r);
|
||||||
if (stat->crossings)
|
if (stat->crossings)
|
||||||
{
|
{
|
||||||
stat->crossings->clear();
|
stat->crossings.release();
|
||||||
delete(stat->crossings);
|
|
||||||
stat->crossings = NULL;
|
|
||||||
}
|
}
|
||||||
deleteERStatTree(stat);
|
deleteERStatTree(stat);
|
||||||
}
|
}
|
||||||
@@ -665,9 +663,7 @@ void ERFilterNM::er_merge(ERStat *parent, ERStat *child)
|
|||||||
child->med_crossings = (float)m_crossings.at(1);
|
child->med_crossings = (float)m_crossings.at(1);
|
||||||
|
|
||||||
// free unnecessary mem
|
// free unnecessary mem
|
||||||
child->crossings->clear();
|
child->crossings.release();
|
||||||
delete(child->crossings);
|
|
||||||
child->crossings = NULL;
|
|
||||||
|
|
||||||
// recover the original grey-level
|
// recover the original grey-level
|
||||||
child->level = child->level*thresholdDelta;
|
child->level = child->level*thresholdDelta;
|
||||||
@@ -714,9 +710,7 @@ void ERFilterNM::er_merge(ERStat *parent, ERStat *child)
|
|||||||
// free mem
|
// free mem
|
||||||
if(child->crossings)
|
if(child->crossings)
|
||||||
{
|
{
|
||||||
child->crossings->clear();
|
child->crossings.release();
|
||||||
delete(child->crossings);
|
|
||||||
child->crossings = NULL;
|
|
||||||
}
|
}
|
||||||
delete(child);
|
delete(child);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user