A and B are used for the calculation of log likelihood. This log likelihood is calculated under the assumption that RGB color of the object is observed with gaussian noise. But this assumption might not be true. Please think this is a toy to understand particle filter.
thank you for sharing code.My question is why do you use the formula：
A = -log(sqrt(2 * pi) * Xstd_rgb);
B = - 0.5 / (Xstd_rgb.^2);
to make the likelihood,which reasons was it based on?
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 ?
"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.
Initial location of each particle is decided by random numbers. And initial speed is set to zero. Initial conditions are decided by function "create_particles".
hello, thanks for your contribution.
I got a problem with ''particle_filter_by_saved_movie.m file'' the error shows like [Dot name reference on non-scalar structure. Error in VideoReader/read (line 91) if( ~isempty(obj.NumberOfFrames) )] I don't know why? can you help me ? thank you
Please, I will use this code to track the face of person how do I change the resampling function given that I used the intesection of HSV histogram as a function likelhood. Please help me. it is critical to know this. thanks a lot.
Thank you very much for your feedback. Even though research of image processing is not my main job, but if you create some interesting application, please let me know.
Hello!
I think that you used the exp() in the resampling function to convert the -Inf values of L() to zero. If you didn't convert these values, when you make Q, you will obtain a NaN values. Tahnks a lot for your cooperation.
If you are interested by the image processing and video processing we can work in cooperation. happy weekend.
thanks a lot,
really my problem is in the resampling task, when w e change the likelhood distance. I used the intersection between histogramme to determine the likelhood for each particle but in the resampling task. I think that you must change the first line of your programm exp(L-max(L)) by L-max(L). Thanks
Because I'm not an expert of image processing, I might not be able to give you the best advice of this area.
But I have a few general advice which I can think of. I hope these comments may become your help.
1. Start with the simplest case
Maybe you can simply start with changing the target color from red to skin color,
and check if my program works with your skin color or not.
And after that, you can evolve the algorithm to detect the orientation of face.
If you know the ceter location of face, it's going to be easier to detect the orientation of face.
Maybe you can create some face images rotated 0, 45, 90, 135,or 180 degree, then you might can find a good way (function) to detect the orientaion of the face.
2. Basic attitude of algorithm development
I think the following web seminar might be useful for learning the basic attitude of alogrithm development. This is the another example of color tracking.
Hi!
I want to fit a square a round a face of a person. I consider each particle as a square and I added the square orienatation caracteristic the system of mouvemnt. Thus, I have, (position,speed,orientation). My problem is when I compare the histogram of the reference model and each particle using the distance of Bhattacharya and I do the resampling task, the result is very bad. Thus, I think that it is due to the result comparaison. Therefore, I used your method by modelate the color by gaussian but the result is also very bad. Please, have you any idea? thanks a lot.
Hi, this is a great example (one of the best I have seen). There is just one correction, In PDF, Calculation of “likelihood” in likelihood, "sigma" should be out of square root or it should be sigma^2. One more time, great work!
Please,
I read some document and I found that there are several resampling method such as the systematic resampling. please which methods did you used? and normally, resampling stage aims to select the appropriate particles belongs to their weights but in your code I don't see this choice. thanks to expalin me more thgis fucntion.