KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cv_object_detect.h
Go to the documentation of this file.
1 /* =========================================================================== *
2  |
3  | Copyright (c) 1994-2011 by Kobus Barnard (author)
4  |
5  | Personal and educational use of this code is granted, provided that this
6  | header is kept intact, and that the authorship is not misrepresented, that
7  | its use is acknowledged in publications, and relevant papers are cited.
8  |
9  | For other use contact the author (kobus AT cs DOT arizona DOT edu).
10  |
11  | Please note that the code in this file has not necessarily been adequately
12  | tested. Naturally, there is no guarantee of performance, support, or fitness
13  | for any particular task. Nonetheless, I am interested in hearing about
14  | problems that you encounter.
15  |
16  | Author: Jinyan Guan
17  * =========================================================================== */
18 
19 /* $Id: cv_object_detect.h 17393 2014-08-23 20:19:14Z predoehl $ */
20 
21 #ifndef CV_OBJECT_DETECT_H_
22 #define CV_OBJECT_DEFECT_H_
23 
24 #ifdef KJB_HAVE_OPENCV
25 #include <wrap_opencv_cpp/cv.h>
26 #endif
27 
30 
31 #include <vector>
32 
33 namespace kjb
34 {
35 namespace opencv
36 {
37 #ifdef KJB_HAVE_OPENCV
38 
41 class CV_cascade_classifier
42 {
43 public:
44  // Constructors ...
45  CV_cascade_classifier(){}
46 
47  CV_cascade_classifier(const std::string& classifier_fname)
48  : cv_classifier(classifier_fname)
49  {}
50 
51  ~CV_cascade_classifier(){}
52 
53 public:
57  bool load(const std::string& classifier_fname)
58  {
59  return cv_classifier.load(classifier_fname);
60  }
61 
65  void detect_multiscale
66  (
67  const Image& img,
68  std::vector<Axis_aligned_rectangle_2d>& objs,
69  double scale_factor = 1.1,
70  int min_neighbors = 3,
71  int flags = 0,
72  int width = 0,
73  int height = 0
74  );
75 
76 private:
77  cv::CascadeClassifier cv_classifier;
78 
79 }; // class CV_cascade_classifier
80 
81 #endif
82 
83 } //namespace cv
84 } //namespace kjb
85 #endif /* CV_OBJECT_DETECT_H_ */
86 
87 
88 
height
Definition: APPgetLargeConnectedEdges.m:33
void load(Edge_set &edges, const std::string &fname)
Definition: edge.h:603
Class representing an axis-aligned, 2D rectangle.