Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am wring for asking the how to tracking the specific person after detecting for the interactive floors.
We would like to express like a pond which the fishes are in it.
When person comes into the scanning zone, some fishes are gathering around the person with gentle wave.
Specially, If there are 4 people, the action invoke separately. So you might need the algorithm for calculating which fishes are closer to the person.

Kinect is set on the ceiling heading to floor like this.
http://www.eyeclick.com/UserFiles/Image/eyestep.jpg[^]

And I'm using C#, EmguCV.

I already found the blob using FindContours.
These screen shots are showing how to detect and tracking people's head.
http://postfiles7.naver.net/20130613_38/tophanna87_1371131511454ypqkq_JPEG/1.JPG?type=w2[^]
http://postfiles2.naver.net/20130613_177/tophanna87_13711315203740WXhh_JPEG/2.JPG?type=w2[^]


But What I want to do now is give ID to each blob to distinguish who's who.
I don't know how to set the ID.
When the person has gone in depth map's area, the blob has to be released.
When new person comes in to the area, the new blob ID has to be set.

People who has to give the ID is maximum 3 people.
As a result, each game object has to follow to each person until the person is in the area.
( gameObject 1 - blob1,
gameObject 2 - blob2,
gameObject 3 - blob3)


C#
void Update()
   {
       if (Kinect.pollDepth())
       {
           IntPtr image = this.SliceDepthImage(Kinect.depthImg, 640, 480, 1000, 2300);
           Image<Bgra, Byte> openCVImg = new Image<Bgra, byte>(640, 480, 2560, image);
           Image<Gray, byte> gray_image = openCVImg.Convert<Gray, byte>();


           using (MemStorage stor = new MemStorage())
           {
               //Find contours with no holes try CV_RETR_EXTERNAL to find holes
               Contour<System.Drawing.Point> contours = gray_image.FindContours(Emgu.CV.CvEnum.CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE, Emgu.CV.CvEnum.RETR_TYPE.CV_RETR_EXTERNAL, stor);

               for (int i = 0; contours != null; contours = contours.HNext) //array of contours
               {
                   if ((contours.Area > Math.Pow(70, 2)))
                   {
                       MCvBox2D rectContour = contours.GetMinAreaRect();
                       openCVImg.Draw(rectContour, new Bgra(0x00, 0x00, 0xFF, 0xFF), 3);

                       //get contour's center point
                       PointF centerPos = new PointF(rectContour.center.X, rectContour.center.Y);

                   }
                   i++;
               }
           }


Please, help me.
Posted

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