github.com/aloncn/graphics-go@v0.0.1/graphics/detect/doc.go (about) 1 // Copyright 2011 The Graphics-Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 /* 6 Package detect implements an object detector cascade. 7 8 The technique used is a degenerate tree of Haar-like classifiers, commonly 9 used for face detection. It is described in 10 11 P. Viola, M. Jones. 12 Rapid Object Detection using a Boosted Cascade of Simple Features, 2001 13 IEEE Conference on Computer Vision and Pattern Recognition 14 15 A Cascade can be constructed manually from a set of Classifiers in stages, 16 or can be loaded from an XML file in the OpenCV format with 17 18 classifier, _, err := detect.ParseOpenCV(r) 19 20 The classifier can be used to determine if a full image is detected as an 21 object using Detect 22 23 if classifier.Match(m) { 24 // m is an image of a face. 25 } 26 27 It is also possible to search an image for occurrences of an object 28 29 objs := classifier.Find(m) 30 */ 31 package detect