One of the most important modern trends in the software — programs that have computer vision. This technology allows us to analyze the information in the images and video files. For example, read the text, or to detect the location of certain objects.
For the practical study of this technology I was given the task of determining cup in the photo. To implement it, it was decided to use the android + OpenCV (
http://opencv.org/). OpenCV is an open source computer vision library, designed for C ++, python, java and many other languages. It has many functions, but we are interested in the ability to process images and perform them search for objects using a cascade algorithm Viola-Jones.
Viola-Jones algorithm is a method for detecting objects in images based on Haar signs. Its main features are high speed and low false alarm rate. Initially the algorithm was developed for the face detection, but it can be trained to detect other objects. It splits an image into areas, evaluate brightness in these areas and cut-off areas where classified the subject is not clear. This algorithm is implemented in OpenCV as separate function, which requires the classifier file for input that defines the weights for the algorithm work and the image where the search will probe.
For training the classifier I have used a Cascade-Trainer-GUI program (
http://amin-ahmadi.com/cascade-trainer-gui/), which provides a window interface for standard software from a set of OpenCV — opencv_createsamples and opencv_traincascade.