I'm trying to track a moving LED using Emgu CV C#. I threshold the captured image until I have only the LED as a white spot/blob. I've used blob analysis/tracking and it works but the problem is that if I move the light around too fast, it can no longer track it. If I slow down, it works. Is there any way to speed things up ?
In th开发者_JAVA百科e end, I basically need to draw on my computer using the LED. And I also need the position/center of the LED for other purposes.
The code that I've used for blob analysis and tracking is the same as the code in Emgu.CV.Examples --> Video Surveillance.
Well YES and NO. You can examine your code and streamline the process so that your image processing takes as little time as possible i.e reduce loops or calculations. You could change the hardware of the computer; a faster processor with more cores would allow more threads for processing at a faster speed. You could invest in a CUDA graphics card and do you processing on this, however if your code isn't that complex your performance may even be reduced. A high end graphics card is suggested.
A majority of time is in fact wasted displaying the results on screen dramatic improvements could be made by eliminating this. If none of this improves your performance then the only option is to move your analysis algorithms to FPGA Hardware devices (effectively these are custom based processes) this is time expensive and if you’ve never done anything like it very hard. Real-Time processing of images is hard to implement and achieve. A possible alternative is to cheat the XBOX Kinect actually introduces complex algorithms to predict a users movement in between frames. This is why game play is sometimes jumpy.
A suggested route would be to examine your blob tracking routine if you’re using Hough blob tracking try hard coding your own an look at the sum of rows and columns of the image this will give you a peak value corresponding to X an Y position however only 1 LED can therefore be used. This may improve performance as you remove hidden processes involved in the Hough blob tracking function.
Secondly try changing your thresholding techniques for the simplest possible (if you haven’t already) if the light is bright just subtract a constant say 250 from a greyscale image this will hopefully just leave the LED unless your in a bright room or these another light source.
I’m currently doing a PHD in image processing so I warn you achieving real time processing can take a life time. I would also suggest not to expect the best results a web cam will acquire images at about 30 fps and with processing you can expect 25 fps at best maybe even as low as 10 fps.
An alternative to a standard LED is a Infra Red LED with an appropriate light filter for your camera. This will allow just a blob to be seen from the LED with little background noise. Check Instructables.com for examples.
Hope some of the helps Chris
精彩评论