Ask Your Question

kirubhaRK's profile - activity

2017-09-07 23:46:48 -0500 received badge  Popular Question (source)
2014-06-12 02:11:01 -0500 commented question Template matching is not working correctly?Is there a way to solve this

hand size will vary for person to person.Can you suggest me any suitable approach for my experiment , so that it will be very helpful to achieve my goal?

2014-06-10 10:08:38 -0500 commented question Template matching is not working correctly?Is there a way to solve this

Actually i am trying to match the hand template like this exactly during the different poses while he is sleeping.I tried matchtemplate,findcontour methods but it is not exactly matching during motion of that person.

https://onedrive.live.com/redir?resid=D1FCABDC07D1ED9!1851&authkey=!AEhmit8_kGLON5k&v=3&ithint=photo%2c.jpg

Can you please suggest any method , which will identify the hand like this exactly.

2014-06-10 06:33:34 -0500 commented question Template matching is not working correctly?Is there a way to solve this

Thanks berak, Yes i asked in emgu forum too, waiting for reply.In the meanwhile can you suggest me some other approach so that i could match my moving hand with any other hand template and mark exactly my hand.

2014-06-10 05:51:23 -0500 asked a question Template matching is not working correctly?Is there a way to solve this

Hi,

I am using opencv for template matching.Actually i want to match the left hand or right hand of the person exactly by comparing it with sample left hand or right hand template that i have took and seperate his hand alone from that original image.

The following function is used for template matching:-

public void Template_Matching(Image template)

{

using (Image result = openCVImg.MatchTemplate(template, Emgu.CV.CvEnum.TM_TYPE.CV_TM_CCOEFF))

    {

        double[] minValues, maxValues;

        System.Drawing.Point[] minLocations, maxLocations;

        result.MinMax(out minValues, out maxValues, out minLocations, out maxLocations);

        var bytes = result.Bytes;

        if (maxValues[0] > 1.1)
        {
            istracking = true;

            // This is a match. Do something with it, for example draw a rectangle around it.
         //   System.Drawing.Rectangle match = new System.Drawing.Rectangle(maxLocations[0].X, maxLocations[0].Y, template.Width / 2, template.Height);
            System.Drawing.Rectangle match = new System.Drawing.Rectangle(new System.Drawing.Point(maxLocations[0].X, maxLocations[0].Y), new System.Drawing.Size(template.Width, template.Height));

            openCVImg.Draw(match, new Bgr(System.Drawing.Color.Red), 1);
            //   imageToShow.DrawPolyline(minLocations, false, new Bgr(System.Drawing.Color.Red), 3);

        }
        else
        {
            istracking = false;
        }

    }

}

But the above function is not working correctly.For example in the below picture,

Fig 1:- i have compared the hand template with the person showing hand.Now it is matching correctly and the rectangle is drawn over the hand of the person.

Fig 2:- I have compared the hand template with closed hand of that person.But here it is highlighting the head of the person.(Why?)

Consider the person is in sleeping mode, My goal is to remove the left hand and right hand of the person simultaneously by matching the left hand of right hand template of any other person.I want to do pixel by pixel comparison of these two pictures and remove the left hand and right hand completely from the original image.

Can you please suggest me any other approach to acheive my goal?

handtrack.png handtrackwrong.png