-2

I am a newbie to OpenCV. I would like to work on a small project for tracking the rotation speed of a gear (by using webcam). However, until now, I have no idea how to work on this. The posted image shows a machine which contains two 'big' gears. What I am interested in the gear only on left hand side (the red line as I highlighted).

Link

My plan is:

  1. Extract the Interested gear region .

  2. Mask all unrelated region. So, the masked image shows the left gear only (ROI).

  3. .....

    The problem is, how can I locate/extract/mask the ROI and mask?.
    I go through some example about cvMatchTemplate(), but it doesn't support rotations and scalings. Due to using webcam, the captured image may scaled or rotated. cvfindcontour() will extract all contours in the image rather then ROI.

Angie Quijano
  • 4,167
  • 3
  • 25
  • 30
joe shum
  • 17
  • 3
  • 1
    Please improve your question if you want a good answer. Post the image on a website, so users won't be needed to download it. Make clear statements, and also post what have you tried and what have you studied before. – Sam Aug 20 '12 at 11:24

1 Answers1

5

If you previously know the gear you can use a picture of it to extract keypoints with SIFT, SURF, FAST or any corner detection algorithm. Then do as follows:

1- Apply FAST on every frame to detect keypoints.

2- Extract SIFT descriptors from those keypoints

3- Match detected points in the scene with your previously extracted points from the image. You can use FLANN matcher for this.

4- Those matches will define a region in the scene containing the gear you are looking for.

This is not trivial so you will need to look for information in OpenCV documentation for using all these functions.

Jav_Rock
  • 22,059
  • 20
  • 123
  • 164