A review of openCV of detection and recognition

learning openCVThis post has been scheduled for ages since i posted an?announcement in a previous post to write a review of openCV of detection and recognition, particularly in perspectives of hand detections and recognitions. The announcement post is here as a reference.

About openCV

A library of programming functions for real time computer vision,released under a BSD?license, and free for academic and commercial use (a). Current version is openCV 2.1, this version has been installed and compiled under my VS 2008 environment but with some errors, may not be very easy to configure this version. While the stabilities of openCV 1.0 have been firmly proved already and that is easier to install and configure. Install guides can be found as ?openCV install guide in openCV wiki,?installing openCV in windows, vc2008 install openCV 2.0/2.1(in Chinese)?and get started with openCV.

A easy start of ‘hello world‘ application using openCV can be very helpful. Under most occasions, openCV is used within windows console applications with a black command window and openCV’s own interfaces (highgui) to display images and draw patterns, as the ‘hello world’ example shows. As well there are some other interface components included in openCV library such as sliders, mouse movement events and key input events. Using these provided features of openCV, object detection could be done via capturing webcam images, analysing them and finally output the consequences.

One recommendation of learning openCV online is Yahoo openCV group. It is a group with huge number of active members posting hundreds of messages each day, may be a little massive, but a good place to raise questions and meet other people, highly recommended.

About detections & recognitions

Detections are core functions of openCV. Color knobs, objects, motions, gestures and faces are subjects of openCV detections and recognitions.

Color knob detections

detecting colors using openCV is basic, there could be several ways to achieve the color detections. For instance, as the color detection used in my hand recognition project, the target color is divided into three perspectives of H, B, and V. By combining these parameters, theoretically it is available to detect any color. But the fault of HSV method is that the background colours are usually too sensitive to be specified. So does another method which uses simple brightness threshold to get target colours, but it is limited as well. A better way of detecting a range of colours is to use ‘camshift’ which requires a source image which represents colour information for target colours. There is an example of using ‘camshift’ here.

Object detections

Object detection is kind of similar as colour extraction since to recognise the objects they should be detected first. Here is an example of using Actionscript 3.0 to tracking objects via webcam. In openCV it is simple as well. Tracking the objects, then using circle or line detection methods to extract rough object shapes. It could be very accurate of detecting object angles which are demonstrated here, and another object detection example illustration here. Detecting an array of object is nearly the same as detecting solo object, except some extra work is needed to loop all objects at one time and draw them out, this could be seem here as detecting combined objects.

Motion detections

motion detectionThere is an example of motion detections in openCV’s example folders, which is called motemlp.exe and a source file motempl.c. The picture on the left shows the motion directions and sub components’ directions are being marked clearly.

Gesture and face detections
lena face detectionFace detections are maturely applied in digital cameras presently. It is dependant on haar trainings and classifiers therefore the detection results seem robust. As well, a face detection example with source code can be found in openCV’s example folder. In this review face detection would not be emphasised too much as there are millions of tutorials telling how to detect the face in either static or dynamic circumstances.

hand detectionRecognitions of hand gestures is the challenging part.  On current stage, hand gestures especially finger tips are still tough due to the natural shapes of hands are ambiguous for computer to identify which is which. Therefore some simple and intuitive gestures are commonly adopted to relatively improve the accuracy of recognitions. Recognition gestures requires two factors: a. correct contours and b. predefined gesture patterns. The first factor is reachable but the second requires more work to cheer up. Concerning the second factor, there have been some theoretical papers raising solutions of detecting hand gestures. Toughly, putting these theoretical methods into practical use and generate kind of applications providing open source codes still has long way to go. A progressive project can be referred here as hand detection and image descriptions.

Useful toolkits



Author: Andol Li

A HCI researcher, a digital media lecturer, an information product designer, and a python/php/java coder.

26 Comments On “ A review of openCV of detection and recognition”

  1. This is such a great resource that you are providing and you give it away for free. I enjoy seeing websites that understand the value of providing a prime resource for free. I truly loved reading your post. Thanks!

  2. Hi, I am starting to learn the opencv, but I don’t know how to use boosted classifiers in opencv, Would you mind to tell me how to setup it(I get the code form OpenCV example) and gen the xml for hand detection?

    • @John Lin Few xml files for hand detection are published for public use, since the sample images and trainings are difficult to achieve. About using classifiers, i may not tell this in several words, but you can google it, plenty of documents about this.

  3. Thank you for your help! And also I have leaning how to use ARToolkit, Would you mind to tell me can I import opencv function such as hand detection into ARToolKit free version? I want to import some 3D model into hand detection, but it seems to be too difficult.. any suggestion of this aspect ?… Thanks you.

  4. Hi , I try to using the ARToolkit’s drawing function in opencv, but I don’t know how to match with them, because of the hand detection only output two points i.e.(cvpoint1.x, cvpoint1.y) &(cvpoint2.x, cvpoint2.y), and ARToolkit need 3×4 array to draw the cube. Do you know how to match with these?
    Also, how about combine opencv with opengl, and how to convert the cvpoint to openGl format? because I want to draw something(3D cube ) to the detected hand. My English is poor sorry….

  5. The cvPoint can be broke into two parameters of x and y, to put this point into an array of 3*4 it is necessary to make up some other points depends on your requirements. And to make openCV and openGL together is not difficult as long as you include all relevant head files and pass parameters with each other. More information you’d better refer Google or else.

  6. You you could make changes to the page name A review of openCV of detection and recognition | Andol to something more specific for your subject you write. I loved the post withal.

  7. i have done the tracking but frame rate is very slow… i want to increase the frame rate of the video how can i do that?

  8. Hey, thanks a lot for providing that code. I am programming a tracker using opencv, and the motempl.c is very usefull.
    Just a little question, do you know which detector of feature could be the best?

  9. Hello sir,
    I have only 1 month time ,in that i have to detect a car in a vedio stream which is in opposite direction so please help me sir?

    • @Venkatesh
      two steps to detect the opposite-direction car – detecting all cars – blob tracking may help, then detecting cars’ directions – motion detection may be helpful in this stage.

  10. Sir can you help me in counting the objects using reference image??
    I’m currently working on a project called vision based parking lot syatem where in I need to count and the no of cars detected in the given area.
    Thanks in advance.

    • @Vinay Bn
      to count objects using openCV, these objects need no overlaps, when two objects are connected together these are only counted as one.
      So based on this point, counting objects needs to separate objects and get the number of closed object contours.

  11. Hello there I am so grateful I found your web site, I really found you by accident,
    while I was searching on Yahoo for something else,
    Regardless I am here now and would just like to say
    thanks a lot for a tremendous post and a all round thrilling blog (I also love the theme/design), I don’t have time to go through it all
    at the minute but I have book-marked it and
    also added in your RSS feeds, so when I have time I will be back to
    read a lot more, Please do keep up the great work.

Leave a comment
Due to technical adjustments, the comment function is shortly closed and will be re-openning soon. Thanks.

Copyrights 2006-2017 © All rights reserved
Theme Tree2, re-designed by Andol Li, powered by WordPress and Bootsrap
WWW.ANDOL.ME | 浙ICP备15040508号-1
公安备案图标 浙公网安备33010602004018号
Back to top