"Xstd_rgb" means standard deviation of observation noise, which means noise you get when you observe the state of something.

"Xstd_pos" and "Xstd_vec" mean standard deviation of system noise, which describes how far actual movement of target object differs from the ideal model (in this case, linear uniform motion).

State space become of 2 componets, one is "position of particle" and another is "speed of particle".

You can define these 3 types of noise by these parameters.

First of all, thanks for sharing the code, it helps me a lot. I will ask question about parameters :
Xstd_rgb = 50;
Xstd_pos = 25;
Xstd_vec = 5;
How did you find the numbers like 50,25 and 5?
I want to generalize this for every color not spesific to red one. So, how can I start to modify this program ?