• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by bananadrop · Jun 13, 2013 at 02:29 PM · c#trackingdetectingemgucv

How to detecting and tracking each person among 3 people

I am wring for asking the how to tracking the specific person after detecting for the interactive floors projecting like the link below.

http://www.youtube.com/watch?v=uNRY6qX7qgA

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)

 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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Multiple Cars not working 1 Answer

Emgu CV and Unity Issue 0 Answers

A node in a childnode? 1 Answer

Admob code question 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges