Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, this is what I am doing, I take the input from a web camera onto a picturebox in C# and draw a rectangle on the video using a mouse. Then I plan to track that particular area(e.g. right eye)enclosed by the rectangle, as the video streams, for instance if the person moves to the right, the rectangle will also move to the right but will stay glued to the right eye. In other words the rectangle will move along with the human eye. In the below video, the area under consideration is the right eye.

I am still learning to draw on a video. I have been looking at the Directshow sample bitmapmixer to get an idea.

What I want to know is how to isolate the frame which has the whole rectangle(since a person cant draw on a single frame) and how to track the region. I was thinking of getting the color histogram of the enclosed area and then searching for that area in the subsequent frames.

Check Image >>> http://i29.tinypic.com/2466s02.jpg

Any ideas.

Many Thanks.
Posted

1 solution

Hi,

your main problem will be the pattern recognition. Depending on what you are trying the recognize in an image this can be quite tricky and there are lots of libraries out there that will do this job for you but are very expensive.
- Cognex www.cognex.com

- National Instruments: http://www.ni.com/vision/[^]
- AForge Library: AForge.NET framework[^]

There are several good articles here on codeproject that might help you. Some even cover the problem of face and eye detection:

Face and Eyes Detection Using OpenCV[^]

Face Detection in C#[^]

Motion Detection Algorithms[^]

This should get you started since these articles do similar things like you want to achieve.

Regards,

JF
 
Share this answer
 
Comments
btap_644 18-Jul-10 7:50am    
ok i understand what you are trying to say. I can limit my project scope to identify, the face of a human, and use that to track the location of the human. My main concern is not detection but tracking. I want the tracker, which is the rectangle to move with the human but it must stay glued to the right eye(coz thats where i have drawn it).
JF2015 18-Jul-10 8:37am    
As soon as you have figured out how to identify a face/eyes in your video it should be easy to draw the rectangle on the right eye.
The article: http://www.codeproject.com/KB/audio-video/Motion_Detection.aspx explains how to draw a rectangle around a specific area in your screen.
Basically what you got to do for each frame is:
1. identify the eyes
2. draw a rectangle around the right eye

This is quite a lot of processing work that is necessary but in case of e.g. 15FPS this should be no problem for a current PC.
btap_644 18-Jul-10 9:23am    
Alright first things first, I want to apologize for not being clear enough. I am doing a project in C# called User Initiated Real Time Object Tracking. What I want is, take input from a webcamera to a picturebox(done using dshownet), then draw a rubber band rectangle on the video(say on a person's face/eye/nose/whole body - i think i am going to scope it down to face) using a mouse, then I want to track the area enclosed by the rubber band rectangle. I am currently going through dshownet bitmapmixer sample in the samples folder to draw on a video(no success yet, i have done the rubberband rectangle, its now a matter of making it work on top of the video). My main issue is to track, what is enclosed within the rubber band rectangle(after the rectangle is drawn it stays visible, unless erased with a button command). JF2015 said to go through Face and eyes Detection(I dont do detection in my project really). Well I might be wrong. The way I think of it is as this, I think if I could consider the area outside the rectangle as the background, and the extract the colour histograms of the area within the rectangle(foreground) and check if it pops up in the subsequent frames, I can successfully track[I actually dont know how to achieve this via code]. Is this correct ?? By the way, I consider the tracker to be the rectangle, which will stay visible as long as the video is streaming and move along with the person in the video. To start off, I am experimenting all this with a saved video file. That is all. I hope you have a good idea now. Thank you for your time.
btap_644 18-Jul-10 9:26am    
This project done in opencvdotnet is very similar to my project http://code.google.com/p/opencvdotnet/. I tried doing this, but opencvdotnet works with older versions visual studio. I am using VS 2008. I am open to suggestions.
btap_644 18-Jul-10 9:38am    
One more small question regarding face detection, I dont automatically detect a face, I allow the user to draw an enclosure(rubber band rectangle) around the face in a video(probably when the person is still) using the mouse. Does this still count as face detection ? Or is it just merely pattern matching ? Is auto face detection or drawing using mouse seems harder ?

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