38 #include "../CondensImg.hh"
39 #include "Base/ImageUtils/ImageDraw.hh"
40 #include "Base/Image/ImageIO.hh"
62 observation.
Init(320,240,1);
65 condensation.
Init(500);
73 int n=0,iterations=20;
74 int x=50,y=50,x2=250,y2=200;
76 while (n<iterations) {
78 cout<<
"Iteration: "<<n<<
"/"<<iterations
79 <<
" Mean State: "<<mean[0]<<
","<<mean[1]<<endl;
96 sprintf(fileName,
"observationImage_%04d",n);
101 sprintf(fileName,
"sampleImage_%04d",n);
void DrawSamples(Image< unsigned char > &img, unsigned char value=255)
this draws the sample weights as circles
int InitPrior()
sets the sample positions for first time step
int Init(unsigned int nrSmaples)
Init the Condensation directly after constructor, with the desired amount of Samples, there more the better the approximation of the real densities.
void Process()
This really does one iteration of Condensation.
void SetColorModel(EColorModel Model)
int GetUniformDistributedInt(const int min, const int max)
get uniform distributed random variable including min/max
Vector< double > GetMean()
returns the mean state of the density distribution
void SetArea(Vector2< double > min, Vector2< double > max)
The area for the initial uniform distribution.
void SetObservation(Image< unsigned char > &osbImg)
converts to Image<float> and calls the function above
static int RectangleCenterGreyFill(Image< StorageType > &im, const int x, const int y, const int size, const StorageType value)
void FillImageWithConstValue(StorageType Value)
fill grey images
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
example class for condensation with a 2-dim state vector.
class for producing random numbers from different distributions
int PredictNewSamplePositions()