PedestrainCounting
|
#include <SingleTarget.h>
Public Member Functions | |
SingleTarget (const Options &ops) | |
void | InitializeTarget (const Rect &target, const Point2D &initVelocity) |
void | Propagate (const Size &imgSize) |
void | Train (const IntegralImage *intImage, const MultiSampler *multiSampler, int id) |
void | Train (const IntegralImage *intImage, const SingleSampler *sampler) |
void | CalculateMatchScore (const IntegralImage *intImage, const Pool< Rect > &dets, std::vector< MatchMatrix::MatchScore >::iterator &matchArray) const |
bool | CheckNearbyTarget (const Rect &det, int distThre) const |
void | Observe (const IntegralImage *intImage, const Rect &detection, float detectionWeight) |
void | Observe (const IntegralImage *intImage) |
void | UpdateSeq (bool isDetected) |
void | ResampleWithBest () |
void | ResampleWithConfidence () |
void | DrawTarget (cv::Mat &img, const cv::Scalar &color) const |
void | DrawParticles (cv::Mat &img, const cv::Scalar &color) const |
void | DrawParticlesWithConfidence (cv::Mat &img, const cv::Scalar &color) const |
const Rect & | GetTarget () const |
void | SetTarget (const Rect &t) |
Parameters for an empty target.
nParticles | # particles |
target | the target region |
initVelocity | the initial velocity |
numSelectors | # selectors in strong classifier |
numWeakClassifiers | # weak classifiers |
numBackups | # backup weak classifiers |
distWeight | distance weight for match score |
velocityThre | velocity threshold for match score |
velocitySigmaConst | const number for velocity sigma |
SingleTarget::SingleTarget | ( | const Options & | ops | ) |
Construct an empty target.
void SingleTarget::CalculateMatchScore | ( | const IntegralImage * | intImage, |
const Pool< Rect > & | dets, | ||
std::vector< MatchMatrix::MatchScore >::iterator & | matchArray | ||
) | const |
Calculate the match score with all the detections.
intImage | in: integral image |
dets | in: detections |
marchArray | out: the match score |
bool SingleTarget::CheckNearbyTarget | ( | const Rect & | det, |
int | distThre | ||
) | const |
Check if the det is near the target
|
inline |
Observe the particles. weight_particle = detectionWeight * P(particle, detection) + (1.0f - detectionWeight) * Conf(particle)
detection | The associate detection, if any. |
detectionWeight | weight for detection term |
classifierWeight | weight for classifier term |
|
inline |
Observe the particles without matched detections.
void SingleTarget::Propagate | ( | const Size & | imgSize | ) |
Propagate the particles. It sets the sigma for velocity and then call ParticleFilter::Propagate.
void SingleTarget::Train | ( | const IntegralImage * | intImage, |
const MultiSampler * | multiSampler, | ||
int | id | ||
) |
Train the classifier. Only used when there are no overlapping detection and we are damn sure this is the correct one.
intImage | integral image |
multiSampler | where we can find the samples |
id | the id of this target |
|
inline |
Train with a single sampler.
|
inline |
Update the detection sequence.