PedestrainCounting
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ParticleFilter Class Reference

#include <ParticleFilter.h>

Inheritance diagram for ParticleFilter:
ParticleFilterConstVelocity

Public Member Functions

 ParticleFilter (int n=100, int szParticle=2)
 
void InitBuffer ()
 
void InitTarget (const Rect &target)
 
void Propagate (const Size &imgSize)
 
void Observe (const StrongClassifier *classifier, const IntegralImage *intImage)
 
void Observe (const StrongClassifier *classifier, const IntegralImage *intImage, const Rect &detection, float detectionWeight)
 
void ResampleWithBest ()
 
void ResampleWithConfidence ()
 
void DrawParticles (cv::Mat &img, const cv::Scalar &color) const
 
void DrawParticlesWithConfidence (cv::Mat &img, const cv::Scalar &color) const
 
void DrawTarget (cv::Mat &img, const cv::Scalar &color) const
 
const RectGetTarget () const
 
void SetTarget (const Rect &t)
 

Protected Member Functions

int BinarSearch (float prob) const
 
void InitParticles ()
 

Protected Attributes

const int numParticles
 
int * particles
 
const int sizeParticle
 
float * confidence
 
Rect target
 
std::deque< RectprevDets
 
std::default_random_engine generator
 
std::normal_distribution< float > gaussian
 
std::uniform_real_distribution< float > resampler
 
int * resampleBuffer
 

Detailed Description

A basic particle filter. It just propagates the particles and observe using the strong classifier's evaluate function. We leave the training to upper class.

This class doesn't support virtual function!!!!

Author
Zhengrong Wang.

Constructor & Destructor Documentation

ParticleFilter::ParticleFilter ( int  n = 100,
int  szParticle = 2 
)

This constructor doesn't initialize particles. Should call InitializeBuffer and InitializeTarget before actually using it.

Member Function Documentation

void ParticleFilter::InitBuffer ( )

Initialize the buffer, mainly the particles, confidence, resample buffer.

void ParticleFilter::InitParticles ( )
protected

Initialize the particles around the target.

void ParticleFilter::InitTarget ( const Rect target)

Initialize the target, used in multiple targets tracking.

void ParticleFilter::Observe ( const StrongClassifier classifier,
const IntegralImage intImage 
)

Observe with classifier output confidence.

void ParticleFilter::Observe ( const StrongClassifier classifier,
const IntegralImage intImage,
const Rect detection,
float  detectionWeight 
)

Observe with classifier output confidence and associated detection.

void ParticleFilter::Propagate ( const Size imgSize)

Propagate the particles.

Parameters
imgSizeIs the particle still inside the image?
void ParticleFilter::ResampleWithBest ( )

Resample directly around the best particle.

void ParticleFilter::ResampleWithConfidence ( )

Resample with the confidence.


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