Page 1 of 1

how to get tracking object's location ?

PostPosted: Fri May 06, 2016 10:58 am
by ekort123
Hi guys. i made a proje

this project knows colors and draw ractangle.

how do i get tracki┼čng object's location. and label's text = tracking object's location.

Thank you.
Sorry my english

Code: Select all
foreach (Rectangle recs in rects)
                {
                    if (rects.Length > 0)
                    {
                        Rectangle objectRect = rects[0];
                       
                        Graphics g = pictureBox1.CreateGraphics();
                        using (Pen pen = new Pen(Color.FromArgb(252, 3, 26), 2))
                        {
                            g.DrawRectangle(pen, objectRect);
                        }
                       
                        int objectX = objectRect.X + (objectRect.Width / 2);
                        int objectY = objectRect.Y + (objectRect.Height / 2);
                       
                        g.Dispose();

                       
                    }
                }