PedestrainCounting
Public Member Functions | List of all members
SingleTarget Class Reference

#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 RectGetTarget () const
 
void SetTarget (const Rect &t)
 

Detailed Description

Parameters for an empty target.

Parameters
nParticles# particles
targetthe target region
initVelocitythe initial velocity
numSelectors# selectors in strong classifier
numWeakClassifiers# weak classifiers
numBackups# backup weak classifiers
distWeightdistance weight for match score
velocityThrevelocity threshold for match score
velocitySigmaConstconst number for velocity sigma

Constructor & Destructor Documentation

SingleTarget::SingleTarget ( const Options ops)

Construct an empty target.

Member Function Documentation

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.

Parameters
intImagein: integral image
detsin: detections
marchArrayout: the match score
bool SingleTarget::CheckNearbyTarget ( const Rect det,
int  distThre 
) const

Check if the det is near the target

void SingleTarget::Observe ( const IntegralImage intImage,
const Rect detection,
float  detectionWeight 
)
inline

Observe the particles. weight_particle = detectionWeight * P(particle, detection) + (1.0f - detectionWeight) * Conf(particle)

Parameters
detectionThe associate detection, if any.
detectionWeightweight for detection term
classifierWeightweight for classifier term
void SingleTarget::Observe ( const IntegralImage intImage)
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.

Parameters
intImageintegral image
multiSamplerwhere we can find the samples
idthe id of this target
void SingleTarget::Train ( const IntegralImage intImage,
const SingleSampler sampler 
)
inline

Train with a single sampler.

void SingleTarget::UpdateSeq ( bool  isDetected)
inline

Update the detection sequence.


The documentation for this class was generated from the following files: