This example writes some images, which show the observations made for each time step and the position and weights of the samples. The observations are such that on the left a real observation, where the random position of the Gauss on the right is like a false measurement.
- Author
- MIP
#include "../CondensImg.hh"
#include "Base/ImageUtils/ImageDraw.hh"
#include "Base/Image/ImageIO.hh"
using namespace BIAS;
using namespace std;
int main()
{
observation.
Init(320,240,1);
char fileName[255];
int n=0,iterations=20;
int x=50,y=50,x2=250,y2=200;
while (n<iterations) {
cout<<"Iteration: "<<n<< "/"<<iterations
<<" Mean State: "<<mean[0]<<","<<mean[1]<<endl;
if (n<10 || n>13) {
x, y, 20, 100);
x2, y2, 20, 255);
}
y+=10;
sprintf(fileName,"observationImage_%04d",n);
sprintf(fileName,"sampleImage_%04d",n);
n++;
}
}