Face and eyes detection using Haar Cascades

OpenCV algorithm is currently using the following Haar-like features which are the input to the basic classifiers:

Haar-like features

Haar-like features

Cascading is a particular case of ensemble learning based on the concatenation of several classifiers, using all information collected from the output from a given classifier as additional information for the next classifier in the cascade. Unlike voting or stacking ensembles, which are multi-expert systems, cascading is a multistage one.

stages Pictures source

Continue reading

Hand detection using contour method

Contours can be explained simply as a curve joining all the continuous points (along the boundary), having same color or intensity. The contours are a useful tool for shape analysis and object detection and recognition.

There are 3 flags under cv2.findContours() category, but I am discussing only the first two – cv2.CHAIN_APPROX_NONE and cv2.CHAIN_APPROX_SIMPLE.

First one finds all the points on the contour or the boundary. But actually do we need all the points? For e.g. , you found the contour of a straight line. Do you need all the points on the line to represent that line? No, we need just two end points of that line. This is what second flag does. It removes all redundant points and compresses the contour.

Continue reading