Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Multi state particle filter

Hi, I have a particle filter with state vector as(xposition, yposiiton, width). I want to modify the particle filter to a multistate particle filter where the state vector is (xposition, yposiiton, width,pose angle). Here the xposition, yposition and width are continuous variables and pose angle is a discrete variable.

How can I modify the code to make the state vector a 4D and do the tracking?

click to hide/show revision 2
No.2 Revision

updated 2015-05-28 03:13:58 -0600

berak gravatar image

Multi state particle filter

Hi, I have a particle filter with state vector as(xposition, yposiiton, width). I want to modify the particle filter to a multistate particle filter where the state vector is (xposition, yposiiton, width,pose angle). Here the xposition, yposition and width are continuous variables and pose angle is a discrete variable.

How can I modify the code to make the state vector a 4D and do the tracking?

#ifndef PARTICLES_H
#define PARTICLES_H
#include <opencv/cv.h>
#define SD 1
#define SCALE_SD 0.01
using namespace cv;
typedef struct part {
    //weight
    float w;
    //position information
    float x;
    float y;

    float dx;
    float dy;
    float ds;
    //scale information
    float scale;
    int width;
    int height;
    //histogram
    MatND *hist;
    RNG * rand;
    RNG * rand_s;
} particle;

extern RNG* rng;
extern RNG* rng1;
extern RNG* rng2;

particle* init_particles(Rect *region, MatND* hist, int regn, int partn);
void updateParticles(particle* pArr,particle *oArr,int partn, Mat &hsvIm,const MatND &refHist,float sd,float scale_sd);
particle getBest(particle* pArr,int partn);
particle* resampleParticles(particle* pArr,int partn);
void sortParticles(particle* pArr, int partn);
#endif
click to hide/show revision 3
No.3 Revision

updated 2015-05-28 03:15:35 -0600

berak gravatar image

Multi state particle filter

Hi, I have a particle filter with state vector as(xposition, yposiiton, width). I want to modify the particle filter to a multistate particle filter where the state vector is (xposition, yposiiton, width,pose angle). Here the xposition, yposition and width are continuous variables and pose angle is a discrete variable.

How can I modify the code to make the state vector a 4D and do the tracking?

#ifndef PARTICLES_H
#define PARTICLES_H
#include <opencv/cv.h>
#define SD 1
#define SCALE_SD 0.01
using namespace cv;
typedef struct part {
    //weight
    float w;
    //position information
    float x;
    float y;

    float dx;
    float dy;
    float ds;
    //scale information
    float scale;
    int width;
    int height;
    //histogram
    MatND *hist;
    RNG * rand;
    RNG * rand_s;
} particle;

extern RNG* rng;
extern RNG* rng1;
extern RNG* rng2;

particle* init_particles(Rect *region, MatND* hist, int regn, int partn);
void updateParticles(particle* pArr,particle *oArr,int partn, Mat &hsvIm,const MatND &refHist,float sd,float scale_sd);
particle getBest(particle* pArr,int partn);
particle* resampleParticles(particle* pArr,int partn);
void sortParticles(particle* pArr, int partn);
#endif