0

I'm trying to track the position of a robot from an overhead webcam. However, as I don't have much access to the robot or the environment, so I have been working with snapshots from the webcam.
The robot has 5 bright LEDs positioned strategically which are a different enough color from the robot and the environment so as to easily isolate.
I have been able to do just that using EmguCV, resulting in a binary image like the one below. My question is now, how to I get the positions of the five blobs and use those positions to determine the position and orientation of the robot?

I have been experimenting with the Emgu.CV.VideoSurveillance.BlobTrackerAuto class, but it stubbornly refuses to detect the blobs in the above image. Being a bit of a newbie when it comes to any of this, I'm not sure what I could be doing wrong.
So what would be the best method of obtaining the positions of the blobs in the above image?

Community
  • 1
  • 1
death_au
  • 1,282
  • 2
  • 20
  • 41

3 Answers3

2

I can't tell you how to do it with emgucv in particular, you'd need to translate the calls from opencv to emgucv. You'd use cv::findContours to get the blobs and cv::moments to get the position of the blobs (the formula to get the middle points of the blobs is in the documentation of cv::moments). Then you'd use cv::estimateRigidTransform to get the position and orientation of the robot.

etarion
  • 16,935
  • 4
  • 43
  • 66
  • This has helped me a lot, thanks. Unfortunately, I can't seem to find an emguCV analogue to estimateRigidTransform, and have no idea how to call it... I'll keep looking, but so far you've helped me heaps. – death_au Feb 25 '11 at 04:23
  • 1
    @death_au: Shouldn't be too hard to do it yourself to get position&orientation when you have the 5 positions. Identify the middle point in the line that has 3 points, use the mean from the other 4 points as position and the direction from the mean to the 5th point as orientation. – etarion Feb 26 '11 at 15:37
  • @death_au: It's `CvInvoke.cvEstimateRigidTransform();` in Emgu – asakura89 Jul 31 '12 at 06:13
0

I wrote a python module to do this very thing.

http://letsmakerobots.com/node/38883#comments

C. Thomas Brittain
  • 376
  • 1
  • 5
  • 12
0

I use cvBlob library to work blobs. Yesterday i worked with it to detect small blobs and works fine.

Jorge Vega Sánchez
  • 7,430
  • 14
  • 55
  • 77