-4

I want to use OpenCV to detect 3 basic shapes (arrow , cross , T-shape) and classify them.

The arrows will have to be classified by colour and orientation(left facing/right facing). The crosses will just have to be detected. I found this Python example which is almost what I need. I just have to add colour and orientation detection to it.

A simple if/else if structure will be the easiest for me to implement, since the onboard computer will be communicating to the drive controller using a virtual serial port. That way, I can send simple commands to the drive controller based on the detected shape.

I will be using a webcam as image source , so if you can give a nudge in the right direction for using it, it would help a lot.

All help is appreciated. I want to do this for an autonomous robot with image processing. I am new to OpenCV so please help me out. Both Python and C++ examples are welcome, but Python is more suitable since my onboard computer will run Linux. C++ examples are great too!

1
  • 1
    This is quite generic. Can you be more specific as to what your question is?
    – rae1
    Dec 22, 2012 at 4:48

1 Answer 1

2

Your problem requires a very extensive answer, but here's an outline of one possible approach:

  • If the shape can move, you need to detect it. If you have a static single-color background, this is easily done with thresholding. Here's an OpenCV tutorial on that.
  • Next, you need to classify the shape. One of the simplest classifiers is the K-NN. Here's a tutorial
  • Finally, you need to react on the classification output. Since you're using a robot, if you don't know how to interface with it, you're better served by asking a separate question for that.

Not the answer you're looking for? Browse other questions tagged or ask your own question.