Drop tracking with OpenCV


I have an EMGU (openCV wrapper) program that subtracts background from
The camera feeds and retrieves beautiful, clean drops.
Now I need something that will track these drops and assign them identifiers.
Any suggestions / libraries?


Thanks,
SW

+2
image-processing opencv computer-vision emgucv
source share
2 answers

Well, if you have several objects that you would like to track, you can try Particle Filter .

Particle filters basically β€œposition” particles in the image, each of which has a specific weight. At each time step, these weights are then updated, comparing them with the actual measured value of the object at that time. Particles with a large weight will have more particles in their direction (with the addition of a small random part in the direction) for the next time step. After several time steps, the particles will be grouped around the object measured by position. That is why this method is sometimes also called the survival of the fittest method ...

So, all this builds a circle:

Initialization ----> Sampling > \ / > Updating Prediction < / \ < Association 

Thus, this provides a good method of tracking objects in a given scene. One way to do tracking multiple objects would be to use this single particle filter on all objects that will work, but it has drawbacks when you try to give identifiers to objects, as well as when objects intersect with each other because particle clouds can lose one object and follow another.

To solve this problem, you can try a particle-mixture filter (Vermaak et al., [2003]). It tracks each of the objects with a separate particle filter (with, of course, less necessary particles).

A good article can be found here: http://www.springerlink.com/content/qn4704415gx65315/ (I can also provide you with a few other things if you like, and if you speak German, I can even give you a presentation that I kept this at my university a while ago)

EDIT:

I forgot to mention: since you are trying to do this in OpenCV: as far as I know, there is an implementation of the Condensation algorithm (the first one where you use one particle filter in the whole image), it is part of the OpenCV distribution, although this may be a bit dated. OpenCV may have newer ways to filter particles, but if you do not find many results on Google, if you are looking for OpenCV and particle filters

Hope that helps ... if not, please keep asking ...

+3
source share

You can simply adapt one of the EMGU CV examples that uses the VideoSurveillance namespace:

  public partial class VideoSurveilance : Form { private static MCvFont _font = new MCvFont(Emgu.CV.CvEnum.FONT.CV_FONT_HERSHEY_SIMPLEX, 1.0, 1.0); private static Capture _cameraCapture; private static BlobTrackerAuto<Bgr> _tracker; private static IBGFGDetector<Bgr> _detector; public VideoSurveilance() { InitializeComponent(); Run(); } void Run() { try { _cameraCapture = new Capture(); } catch (Exception e) { MessageBox.Show(e.Message); return; } _detector = new FGDetector<Bgr>(FORGROUND_DETECTOR_TYPE.FGD); _tracker = new BlobTrackerAuto<Bgr>(); Application.Idle += ProcessFrame; } void ProcessFrame(object sender, EventArgs e) { Image<Bgr, Byte> frame = _cameraCapture.QueryFrame(); frame._SmoothGaussian(3); //filter out noises #region use the background code book model to find the forground mask _detector.Update(frame); Image<Gray, Byte> forgroundMask = _detector.ForgroundMask; #endregion _tracker.Process(frame, forgroundMask); foreach (MCvBlob blob in _tracker) { frame.Draw(Rectangle.Round(blob), new Bgr(255.0, 255.0, 255.0), 2); frame.Draw(blob.ID.ToString(), ref _font, Point.Round(blob.Center), new Bgr(255.0, 255.0, 255.0)); } imageBox1.Image = frame; imageBox2.Image = forgroundMask; } } 
+2
source share

All Articles