Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, I want to do my project of tracking people using kalman filter. I know theoretical how it works. Can you show me sample tracking people code with kalman filter in opencv.
Posted
Comments
[no name] 12-Jan-14 23:39pm    
If only life were that simple. Have you posted this question at opencv.org? More importantly have you tried Google?
Member 10366626 13-Jan-14 0:53am    
Can u please give me some hint abt how to use kalman filter in my application. What i should add for

measurement(0)
measurement(1)

1 solution

I don't think you have done enough work on this yourself. It is not simple stuff and this site is not for getting boilerplate code that you just slots into your project.

You can begin by reading this:
http://dasl.mem.drexel.edu/~noahKuntz/openCVTut9.html[^]

This gives you a place to start coding:
http://www.morethantechnical.com/2011/06/17/simple-kalman-filter-for-tracking-using-opencv-2-2-w-code/[^]
 
Share this answer
 
Comments
Member 10366626 14-Jan-14 23:07pm    
I am getting the error related to cvRand, should i use any header file for this.
error:cvRand was not declared in this scope
cvRandSetRange was not declared in this scope
cvRandInit was not declared in this scope
Member 10366626 15-Jan-14 4:23am    
I am able to solve the error myself. I have added the proper the header
Member 10366626 21-Jan-14 4:38am    
I want to create arrays to hold the x and y co-ordinates.
The below code:
CvSeq* circles = cvHoughCircles( gray, cvCreateMemStorage(0),CV_HOUGH_GRADIENT, 2 , gray->height/6, 3 );
printf ("%d circles detected\n", circles->total);
int *px =new int[circles->total];
int *py =new int[circles->total];
if(circles->total > 0) {
int i = 0;
float * p = (float*)cvGetSeqElem( circles, i );
//px[i] is the X co-ordinate of the center
//py[i] is the Y co-ordinate of the center
px[i]=cvRound(p[0]);
py[i]=cvRound(p[1]);
int
radius = cvRound(p[2]);
Member 10366626 21-Jan-14 4:40am    
I want to create arrays to hold the x and y co-ordinates.
The below code:
CvSeq* circles = cvHoughCircles( gray, cvCreateMemStorage(0),CV_HOUGH_GRADIENT, 2 , gray->height/6, 3 );
printf ("%d circles detected\n", circles->total);
int *px =new int[circles->total];
int *py =new int[circles->total];
if(circles->total > 0) {
int i = 0;
float * p = (float*)cvGetSeqElem( circles, i );
px[i]=cvRound(p[0]);
py[i]=cvRound(p[1]);
int radius = cvRound(p[2]);

This will draw a circle. Can u please tell me how can i create lines instead of circle.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900