template
// C++ code:
7 | * 8 | * 9 | *public:
10 | * 11 | *typedef _Tp value_type;
12 | * 13 | *// various constructors
14 | * 15 | *Point_();
16 | * 17 | *Point_(_Tp _x, _Tp _y);
18 | * 19 | *Point_(const Point_& pt);
20 | * 21 | *Point_(const CvPoint& pt);
22 | * 23 | *Point_(const CvPoint2D32f& pt);
24 | * 25 | *Point_(const Size_<_Tp>& sz);
26 | * 27 | *Point_(const Vec<_Tp, 2>& v);
28 | * 29 | *Point_& operator = (const Point_& pt);
30 | * 31 | *//! conversion to another data type
32 | * 33 | *template
//! conversion to the old-style C structures
36 | * 37 | *operator CvPoint() const;
38 | * 39 | *operator CvPoint2D32f() const;
40 | * 41 | *operator Vec<_Tp, 2>() const;
42 | * 43 | *//! dot product
44 | * 45 | *_Tp dot(const Point_& pt) const;
46 | * 47 | *//! dot product computed in double-precision arithmetics
48 | * 49 | *double ddot(const Point_& pt) const;
50 | * 51 | *//! cross-product
52 | * 53 | *double cross(const Point_& pt) const;
54 | * 55 | *//! checks whether the point is inside the specified rectangle
56 | * 57 | *bool inside(const Rect_<_Tp>& r) const;
58 | * 59 | *_Tp x, y; //< the point coordinates
60 | * 61 | *};
62 | * 63 | *Template class for 2D points specified by its coordinates
64 | * 65 | *x and y.
66 | * An instance of the class is interchangeable with C structures,
67 | * CvPoint
and CvPoint2D32f
. There is also a cast
68 | * operator to convert point coordinates to the specified type. The conversion
69 | * from floating-point coordinates to integer coordinates is done by rounding.
70 | * Commonly, the conversion uses thisoperation for each of the coordinates.
71 | * Besides the class members listed in the declaration above, the following
72 | * operations on points are implemented:
// C++ code:
75 | * 76 | *pt1 = pt2 + pt3;
77 | * 78 | *pt1 = pt2 - pt3;
79 | * 80 | *pt1 = pt2 * a;
81 | * 82 | *pt1 = a * pt2;
83 | * 84 | *pt1 += pt2;
85 | * 86 | *pt1 -= pt2;
87 | * 88 | *pt1 *= a;
89 | * 90 | *double value = norm(pt); // L2 norm
91 | * 92 | *pt1 == pt2;
93 | * 94 | *pt1 != pt2;
95 | * 96 | *For your convenience, the following type aliases are defined:
97 | * 98 | *typedef Point_
typedef Point2i Point;
101 | * 102 | *typedef Point_
typedef Point_
Example:
107 | * 108 | *Point2f a(0.3f, 0.f), b(0.f, 0.4f);
109 | * 110 | *Point pt = (a + b)*10.f;
111 | * 112 | *cout << pt.x << ", " << pt.y << endl;
113 | * 114 | * @see org.opencv.core.Point_ 115 | */ 116 | public class Point { 117 | 118 | public double x, y; 119 | 120 | public Point(double x, double y) { 121 | this.x = x; 122 | this.y = y; 123 | } 124 | 125 | public Point() { 126 | this(0, 0); 127 | } 128 | 129 | public Point(double[] vals) { 130 | this(); 131 | set(vals); 132 | } 133 | 134 | public void set(double[] vals) { 135 | if (vals != null) { 136 | x = vals.length > 0 ? vals[0] : 0; 137 | y = vals.length > 1 ? vals[1] : 0; 138 | } else { 139 | x = 0; 140 | y = 0; 141 | } 142 | } 143 | 144 | public Point clone() { 145 | return new Point(x, y); 146 | } 147 | 148 | public double dot(Point p) { 149 | return x * p.x + y * p.y; 150 | } 151 | 152 | @Override 153 | public int hashCode() { 154 | final int prime = 31; 155 | int result = 1; 156 | long temp; 157 | temp = Double.doubleToLongBits(x); 158 | result = prime * result + (int) (temp ^ (temp >>> 32)); 159 | temp = Double.doubleToLongBits(y); 160 | result = prime * result + (int) (temp ^ (temp >>> 32)); 161 | return result; 162 | } 163 | 164 | @Override 165 | public boolean equals(Object obj) { 166 | if (this == obj) return true; 167 | if (!(obj instanceof Point)) return false; 168 | Point it = (Point) obj; 169 | return x == it.x && y == it.y; 170 | } 171 | 172 | public boolean inside(Rect r) { 173 | return r.contains(this); 174 | } 175 | 176 | @Override 177 | public String toString() { 178 | return "{" + x + ", " + y + "}"; 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/core/Point3.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | /** 4 | *template
// C++ code:
7 | * 8 | * 9 | *public:
10 | * 11 | *typedef _Tp value_type;
12 | * 13 | *// various constructors
14 | * 15 | *Point3_();
16 | * 17 | *Point3_(_Tp _x, _Tp _y, _Tp _z);
18 | * 19 | *Point3_(const Point3_& pt);
20 | * 21 | *explicit Point3_(const Point_<_Tp>& pt);
22 | * 23 | *Point3_(const CvPoint3D32f& pt);
24 | * 25 | *Point3_(const Vec<_Tp, 3>& v);
26 | * 27 | *Point3_& operator = (const Point3_& pt);
28 | * 29 | *//! conversion to another data type
30 | * 31 | *template
//! conversion to the old-style CvPoint...
34 | * 35 | *operator CvPoint3D32f() const;
36 | * 37 | *//! conversion to cv.Vec<>
38 | * 39 | *operator Vec<_Tp, 3>() const;
40 | * 41 | *//! dot product
42 | * 43 | *_Tp dot(const Point3_& pt) const;
44 | * 45 | *//! dot product computed in double-precision arithmetics
46 | * 47 | *double ddot(const Point3_& pt) const;
48 | * 49 | *//! cross product of the 2 3D points
50 | * 51 | *Point3_ cross(const Point3_& pt) const;
52 | * 53 | *_Tp x, y, z; //< the point coordinates
54 | * 55 | *};
56 | * 57 | *Template class for 3D points specified by its coordinates
58 | * 59 | *x, y and z.
60 | * An instance of the class is interchangeable with the C structure
61 | * CvPoint2D32f
. Similarly to Point_
, the coordinates
62 | * of 3D points can be converted to another type. The vector arithmetic and
63 | * comparison operations are also supported.
64 | * The following Point3_<>
aliases are available:
// C++ code:
67 | * 68 | *typedef Point3_
typedef Point3_
typedef Point3_
Template class specifying a continuous subsequence (slice) of a sequence.
5 | * 6 | *class CV_EXPORTS Range
// C++ code:
9 | * 10 | * 11 | *public:
12 | * 13 | *Range();
14 | * 15 | *Range(int _start, int _end);
16 | * 17 | *Range(const CvSlice& slice);
18 | * 19 | *int size() const;
20 | * 21 | *bool empty() const;
22 | * 23 | *static Range all();
24 | * 25 | *operator CvSlice() const;
26 | * 27 | *int start, end;
28 | * 29 | *};
30 | * 31 | *The class is used to specify a row or a column span in a matrix (
32 | * 33 | *"Mat") and for many other purposes. Range(a,b)
is basically the
34 | * same as a:b
in Matlab or a..b
in Python. As in
35 | * Python, start
is an inclusive left boundary of the range and
36 | * end
is an exclusive right boundary of the range. Such a
37 | * half-opened interval is usually denoted as [start,end).
38 | * The static method Range.all()
returns a special variable that
39 | * means "the whole sequence" or "the whole range", just like " :
"
40 | * in Matlab or " ...
" in Python. All the methods and functions in
41 | * OpenCV that take Range
support this special Range.all()
42 | * value. But, of course, in case of your own custom processing, you will
43 | * probably have to check and handle it explicitly:
// C++ code:
46 | * 47 | *void my_function(..., const Range& r,....)
48 | * 49 | * 50 | *if(r == Range.all()) {
51 | * 52 | *// process all the data
53 | * 54 | * 55 | *else {
56 | * 57 | *// process [r.start, r.end)
58 | * 59 | * 60 | * 61 | * 62 | * 63 | * @see org.opencv.core.Range 64 | */ 65 | public class Range { 66 | 67 | public int start, end; 68 | 69 | public Range(int s, int e) { 70 | this.start = s; 71 | this.end = e; 72 | } 73 | 74 | public Range() { 75 | this(0, 0); 76 | } 77 | 78 | public Range(double[] vals) { 79 | set(vals); 80 | } 81 | 82 | public void set(double[] vals) { 83 | if (vals != null) { 84 | start = vals.length > 0 ? (int) vals[0] : 0; 85 | end = vals.length > 1 ? (int) vals[1] : 0; 86 | } else { 87 | start = 0; 88 | end = 0; 89 | } 90 | 91 | } 92 | 93 | public int size() { 94 | return empty() ? 0 : end - start; 95 | } 96 | 97 | public boolean empty() { 98 | return end <= start; 99 | } 100 | 101 | public static Range all() { 102 | return new Range(Integer.MIN_VALUE, Integer.MAX_VALUE); 103 | } 104 | 105 | public Range intersection(Range r1) { 106 | Range r = new Range(Math.max(r1.start, this.start), Math.min(r1.end, this.end)); 107 | r.end = Math.max(r.end, r.start); 108 | return r; 109 | } 110 | 111 | public Range shift(int delta) { 112 | return new Range(start + delta, end + delta); 113 | } 114 | 115 | public Range clone() { 116 | return new Range(start, end); 117 | } 118 | 119 | @Override 120 | public int hashCode() { 121 | final int prime = 31; 122 | int result = 1; 123 | long temp; 124 | temp = Double.doubleToLongBits(start); 125 | result = prime * result + (int) (temp ^ (temp >>> 32)); 126 | temp = Double.doubleToLongBits(end); 127 | result = prime * result + (int) (temp ^ (temp >>> 32)); 128 | return result; 129 | } 130 | 131 | @Override 132 | public boolean equals(Object obj) { 133 | if (this == obj) return true; 134 | if (!(obj instanceof Range)) return false; 135 | Range it = (Range) obj; 136 | return start == it.start && end == it.end; 137 | } 138 | 139 | @Override 140 | public String toString() { 141 | return "[" + start + ", " + end + ")"; 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/core/RotatedRect.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | public class RotatedRect { 4 | 5 | public Point center; 6 | public Size size; 7 | public double angle; 8 | 9 | public RotatedRect() { 10 | this.center = new Point(); 11 | this.size = new Size(); 12 | this.angle = 0; 13 | } 14 | 15 | public RotatedRect(Point c, Size s, double a) { 16 | this.center = c.clone(); 17 | this.size = s.clone(); 18 | this.angle = a; 19 | } 20 | 21 | public RotatedRect(double[] vals) { 22 | this(); 23 | set(vals); 24 | } 25 | 26 | public void set(double[] vals) { 27 | if (vals != null) { 28 | center.x = vals.length > 0 ? (double) vals[0] : 0; 29 | center.y = vals.length > 1 ? (double) vals[1] : 0; 30 | size.width = vals.length > 2 ? (double) vals[2] : 0; 31 | size.height = vals.length > 3 ? (double) vals[3] : 0; 32 | angle = vals.length > 4 ? (double) vals[4] : 0; 33 | } else { 34 | center.x = 0; 35 | center.x = 0; 36 | size.width = 0; 37 | size.height = 0; 38 | angle = 0; 39 | } 40 | } 41 | 42 | public void points(Point pt[]) 43 | { 44 | double _angle = angle * Math.PI / 180.0; 45 | double b = (double) Math.cos(_angle) * 0.5f; 46 | double a = (double) Math.sin(_angle) * 0.5f; 47 | 48 | pt[0] = new Point( 49 | center.x - a * size.height - b * size.width, 50 | center.y + b * size.height - a * size.width); 51 | 52 | pt[1] = new Point( 53 | center.x + a * size.height - b * size.width, 54 | center.y - b * size.height - a * size.width); 55 | 56 | pt[2] = new Point( 57 | 2 * center.x - pt[0].x, 58 | 2 * center.y - pt[0].y); 59 | 60 | pt[3] = new Point( 61 | 2 * center.x - pt[1].x, 62 | 2 * center.y - pt[1].y); 63 | } 64 | 65 | public Rect boundingRect() 66 | { 67 | Point pt[] = new Point[4]; 68 | points(pt); 69 | Rect r = new Rect((int) Math.floor(Math.min(Math.min(Math.min(pt[0].x, pt[1].x), pt[2].x), pt[3].x)), 70 | (int) Math.floor(Math.min(Math.min(Math.min(pt[0].y, pt[1].y), pt[2].y), pt[3].y)), 71 | (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].x, pt[1].x), pt[2].x), pt[3].x)), 72 | (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].y, pt[1].y), pt[2].y), pt[3].y))); 73 | r.width -= r.x - 1; 74 | r.height -= r.y - 1; 75 | return r; 76 | } 77 | 78 | public RotatedRect clone() { 79 | return new RotatedRect(center, size, angle); 80 | } 81 | 82 | @Override 83 | public int hashCode() { 84 | final int prime = 31; 85 | int result = 1; 86 | long temp; 87 | temp = Double.doubleToLongBits(center.x); 88 | result = prime * result + (int) (temp ^ (temp >>> 32)); 89 | temp = Double.doubleToLongBits(center.y); 90 | result = prime * result + (int) (temp ^ (temp >>> 32)); 91 | temp = Double.doubleToLongBits(size.width); 92 | result = prime * result + (int) (temp ^ (temp >>> 32)); 93 | temp = Double.doubleToLongBits(size.height); 94 | result = prime * result + (int) (temp ^ (temp >>> 32)); 95 | temp = Double.doubleToLongBits(angle); 96 | result = prime * result + (int) (temp ^ (temp >>> 32)); 97 | return result; 98 | } 99 | 100 | @Override 101 | public boolean equals(Object obj) { 102 | if (this == obj) return true; 103 | if (!(obj instanceof RotatedRect)) return false; 104 | RotatedRect it = (RotatedRect) obj; 105 | return center.equals(it.center) && size.equals(it.size) && angle == it.angle; 106 | } 107 | 108 | @Override 109 | public String toString() { 110 | return "{ " + center + " " + size + " * " + angle + " }"; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/core/Scalar.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | /** 4 | *Template class for a 4-element vector derived from Vec.
5 | * 6 | *template
// C++ code:
9 | * 10 | * 11 | *public:
12 | * 13 | *//! various constructors
14 | * 15 | *Scalar_();
16 | * 17 | *Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0);
18 | * 19 | *Scalar_(const CvScalar& s);
20 | * 21 | *Scalar_(_Tp v0);
22 | * 23 | *//! returns a scalar with all elements set to v0
24 | * 25 | *static Scalar_<_Tp> all(_Tp v0);
26 | * 27 | *//! conversion to the old-style CvScalar
28 | * 29 | *operator CvScalar() const;
30 | * 31 | *//! conversion to another data type
32 | * 33 | *template
//! per-element product
36 | * 37 | *Scalar_<_Tp> mul(const Scalar_<_Tp>& t, double scale=1) const;
38 | * 39 | *// returns (v0, -v1, -v2, -v3)
40 | * 41 | *Scalar_<_Tp> conj() const;
42 | * 43 | *// returns true iff v1 == v2 == v3 == 0
44 | * 45 | *bool isReal() const;
46 | * 47 | *};
48 | * 49 | *typedef Scalar_
Being derived from Vec<_Tp, 4>
, Scalar_
and
52 | * Scalar
can be used just as typical 4-element vectors. In
53 | * addition, they can be converted to/from CvScalar
. The type
54 | * Scalar
is widely used in OpenCV to pass pixel values.
55 | *
template
// C++ code:
7 | * 8 | * 9 | *public:
10 | * 11 | *typedef _Tp value_type;
12 | * 13 | *//! various constructors
14 | * 15 | *Size_();
16 | * 17 | *Size_(_Tp _width, _Tp _height);
18 | * 19 | *Size_(const Size_& sz);
20 | * 21 | *Size_(const CvSize& sz);
22 | * 23 | *Size_(const CvSize2D32f& sz);
24 | * 25 | *Size_(const Point_<_Tp>& pt);
26 | * 27 | *Size_& operator = (const Size_& sz);
28 | * 29 | *//! the area (width*height)
30 | * 31 | *_Tp area() const;
32 | * 33 | *//! conversion of another data type.
34 | * 35 | *template
//! conversion to the old-style OpenCV types
38 | * 39 | *operator CvSize() const;
40 | * 41 | *operator CvSize2D32f() const;
42 | * 43 | *_Tp width, height; // the width and the height
44 | * 45 | *};
46 | * 47 | *Template class for specifying the size of an image or rectangle. The class
48 | * includes two members called width
and height
. The
49 | * structure can be converted to and from the old OpenCV structures
CvSize
and CvSize2D32f
. The same set of arithmetic
52 | * and comparison operations as for Point_
is available.
53 | * OpenCV defines the following Size_<>
aliases:
// C++ code:
56 | * 57 | *typedef Size_
typedef Size2i Size;
60 | * 61 | *typedef Size_
class CV_EXPORTS TermCriteria
// C++ code:
7 | * 8 | * 9 | *public:
10 | * 11 | *enum
12 | * 13 | * 14 | *COUNT=1, //!< the maximum number of iterations or elements to compute
15 | * 16 | *MAX_ITER=COUNT, //!< ditto
17 | * 18 | *EPS=2 //!< the desired accuracy or change in parameters at which the 19 | * iterative algorithm stops
20 | * 21 | *};
22 | * 23 | *//! default constructor
24 | * 25 | *TermCriteria();
26 | * 27 | *//! full constructor
28 | * 29 | *TermCriteria(int type, int maxCount, double epsilon);
30 | * 31 | *//! conversion from CvTermCriteria
32 | * 33 | *TermCriteria(const CvTermCriteria& criteria);
34 | * 35 | *//! conversion to CvTermCriteria
36 | * 37 | *operator CvTermCriteria() const;
38 | * 39 | *int type; //!< the type of termination criteria: COUNT, EPS or COUNT + EPS
40 | * 41 | *int maxCount; // the maximum number of iterations/elements
42 | * 43 | *double epsilon; // the desired accuracy
44 | * 45 | *};
46 | * 47 | *The class defining termination criteria for iterative algorithms. You can 48 | * initialize it by default constructor and then override any parameters, or the 49 | * structure may be fully initialized using the advanced variant of the 50 | * constructor. 51 | *
52 | * 53 | * @see org.opencv.core.TermCriteria 54 | */ 55 | public class TermCriteria { 56 | 57 | /** 58 | * The maximum number of iterations or elements to compute 59 | */ 60 | public static final int COUNT = 1; 61 | /** 62 | * The maximum number of iterations or elements to compute 63 | */ 64 | public static final int MAX_ITER = COUNT; 65 | /** 66 | * The desired accuracy threshold or change in parameters at which the iterative algorithm is terminated. 67 | */ 68 | public static final int EPS = 2; 69 | 70 | public int type; 71 | public int maxCount; 72 | public double epsilon; 73 | 74 | /** 75 | * Termination criteria for iterative algorithms. 76 | * 77 | * @param type 78 | * the type of termination criteria: COUNT, EPS or COUNT + EPS. 79 | * @param maxCount 80 | * the maximum number of iterations/elements. 81 | * @param epsilon 82 | * the desired accuracy. 83 | */ 84 | public TermCriteria(int type, int maxCount, double epsilon) { 85 | this.type = type; 86 | this.maxCount = maxCount; 87 | this.epsilon = epsilon; 88 | } 89 | 90 | /** 91 | * Termination criteria for iterative algorithms. 92 | */ 93 | public TermCriteria() { 94 | this(0, 0, 0.0); 95 | } 96 | 97 | public TermCriteria(double[] vals) { 98 | set(vals); 99 | } 100 | 101 | public void set(double[] vals) { 102 | if (vals != null) { 103 | type = vals.length > 0 ? (int) vals[0] : 0; 104 | maxCount = vals.length > 1 ? (int) vals[1] : 0; 105 | epsilon = vals.length > 2 ? (double) vals[2] : 0; 106 | } else { 107 | type = 0; 108 | maxCount = 0; 109 | epsilon = 0; 110 | } 111 | } 112 | 113 | public TermCriteria clone() { 114 | return new TermCriteria(type, maxCount, epsilon); 115 | } 116 | 117 | @Override 118 | public int hashCode() { 119 | final int prime = 31; 120 | int result = 1; 121 | long temp; 122 | temp = Double.doubleToLongBits(type); 123 | result = prime * result + (int) (temp ^ (temp >>> 32)); 124 | temp = Double.doubleToLongBits(maxCount); 125 | result = prime * result + (int) (temp ^ (temp >>> 32)); 126 | temp = Double.doubleToLongBits(epsilon); 127 | result = prime * result + (int) (temp ^ (temp >>> 32)); 128 | return result; 129 | } 130 | 131 | @Override 132 | public boolean equals(Object obj) { 133 | if (this == obj) return true; 134 | if (!(obj instanceof TermCriteria)) return false; 135 | TermCriteria it = (TermCriteria) obj; 136 | return type == it.type && maxCount == it.maxCount && epsilon == it.epsilon; 137 | } 138 | 139 | @Override 140 | public String toString() { 141 | return "{ type: " + type + ", maxCount: " + maxCount + ", epsilon: " + epsilon + "}"; 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/features2d/DMatch.java: -------------------------------------------------------------------------------- 1 | package org.opencv.features2d; 2 | 3 | //C++: class DMatch 4 | 5 | /** 6 | * Structure for matching: query descriptor index, train descriptor index, train 7 | * image index and distance between descriptors. 8 | */ 9 | public class DMatch { 10 | 11 | /** 12 | * Query descriptor index. 13 | */ 14 | public int queryIdx; 15 | /** 16 | * Train descriptor index. 17 | */ 18 | public int trainIdx; 19 | /** 20 | * Train image index. 21 | */ 22 | public int imgIdx; 23 | 24 | public float distance; 25 | 26 | public DMatch() { 27 | this(-1, -1, Float.MAX_VALUE); 28 | } 29 | 30 | public DMatch(int _queryIdx, int _trainIdx, float _distance) { 31 | queryIdx = _queryIdx; 32 | trainIdx = _trainIdx; 33 | imgIdx = -1; 34 | distance = _distance; 35 | } 36 | 37 | public DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance) { 38 | queryIdx = _queryIdx; 39 | trainIdx = _trainIdx; 40 | imgIdx = _imgIdx; 41 | distance = _distance; 42 | } 43 | 44 | /** 45 | * Less is better. 46 | */ 47 | public boolean lessThan(DMatch it) { 48 | return distance < it.distance; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return "DMatch [queryIdx=" + queryIdx + ", trainIdx=" + trainIdx 54 | + ", imgIdx=" + imgIdx + ", distance=" + distance + "]"; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/gpu/Gpu.java: -------------------------------------------------------------------------------- 1 | package org.opencv.gpu; 2 | 3 | public class Gpu { 4 | 5 | public static final int 6 | FEATURE_SET_COMPUTE_10 = 10, 7 | FEATURE_SET_COMPUTE_11 = 11, 8 | FEATURE_SET_COMPUTE_12 = 12, 9 | FEATURE_SET_COMPUTE_13 = 13, 10 | FEATURE_SET_COMPUTE_20 = 20, 11 | FEATURE_SET_COMPUTE_21 = 21, 12 | FEATURE_SET_COMPUTE_30 = 30, 13 | FEATURE_SET_COMPUTE_35 = 35, 14 | GLOBAL_ATOMICS = FEATURE_SET_COMPUTE_11, 15 | SHARED_ATOMICS = FEATURE_SET_COMPUTE_12, 16 | NATIVE_DOUBLE = FEATURE_SET_COMPUTE_13, 17 | WARP_SHUFFLE_FUNCTIONS = FEATURE_SET_COMPUTE_30, 18 | DYNAMIC_PARALLELISM = FEATURE_SET_COMPUTE_35; 19 | 20 | 21 | // 22 | // C++: bool deviceSupports(int feature_set) 23 | // 24 | 25 | public static boolean deviceSupports(int feature_set) 26 | { 27 | boolean retVal = deviceSupports_0(feature_set); 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: int getCudaEnabledDeviceCount() 34 | // 35 | 36 | public static int getCudaEnabledDeviceCount() 37 | { 38 | int retVal = getCudaEnabledDeviceCount_0(); 39 | return retVal; 40 | } 41 | 42 | 43 | // 44 | // C++: int getDevice() 45 | // 46 | 47 | public static int getDevice() 48 | { 49 | int retVal = getDevice_0(); 50 | return retVal; 51 | } 52 | 53 | 54 | // 55 | // C++: void printCudaDeviceInfo(int device) 56 | // 57 | 58 | public static void printCudaDeviceInfo(int device) 59 | { 60 | printCudaDeviceInfo_0(device); 61 | return; 62 | } 63 | 64 | 65 | // 66 | // C++: void printShortCudaDeviceInfo(int device) 67 | // 68 | 69 | public static void printShortCudaDeviceInfo(int device) 70 | { 71 | printShortCudaDeviceInfo_0(device); 72 | return; 73 | } 74 | 75 | 76 | // 77 | // C++: void resetDevice() 78 | // 79 | 80 | public static void resetDevice() 81 | { 82 | resetDevice_0(); 83 | return; 84 | } 85 | 86 | 87 | // 88 | // C++: void setDevice(int device) 89 | // 90 | 91 | public static void setDevice(int device) 92 | { 93 | setDevice_0(device); 94 | return; 95 | } 96 | 97 | 98 | 99 | 100 | // C++: bool deviceSupports(int feature_set) 101 | private static native boolean deviceSupports_0(int feature_set); 102 | 103 | // C++: int getCudaEnabledDeviceCount() 104 | private static native int getCudaEnabledDeviceCount_0(); 105 | 106 | // C++: int getDevice() 107 | private static native int getDevice_0(); 108 | 109 | // C++: void printCudaDeviceInfo(int device) 110 | private static native void printCudaDeviceInfo_0(int device); 111 | 112 | // C++: void printShortCudaDeviceInfo(int device) 113 | private static native void printShortCudaDeviceInfo_0(int device); 114 | 115 | // C++: void resetDevice() 116 | private static native void resetDevice_0(); 117 | 118 | // C++: void setDevice(int device) 119 | private static native void setDevice_0(int device); 120 | 121 | } 122 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/gpu/TargetArchs.java: -------------------------------------------------------------------------------- 1 | package org.opencv.gpu; 2 | 3 | // C++: class TargetArchs 4 | public class TargetArchs { 5 | 6 | protected final long nativeObj; 7 | protected TargetArchs(long addr) { nativeObj = addr; } 8 | 9 | 10 | // 11 | // C++: static bool TargetArchs::builtWith(int feature_set) 12 | // 13 | 14 | public static boolean builtWith(int feature_set) 15 | { 16 | boolean retVal = builtWith_0(feature_set); 17 | return retVal; 18 | } 19 | 20 | 21 | // 22 | // C++: static bool TargetArchs::has(int major, int minor) 23 | // 24 | 25 | public static boolean has(int major, int minor) 26 | { 27 | boolean retVal = has_0(major, minor); 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: static bool TargetArchs::hasBin(int major, int minor) 34 | // 35 | 36 | public static boolean hasBin(int major, int minor) 37 | { 38 | boolean retVal = hasBin_0(major, minor); 39 | return retVal; 40 | } 41 | 42 | 43 | // 44 | // C++: static bool TargetArchs::hasEqualOrGreater(int major, int minor) 45 | // 46 | 47 | public static boolean hasEqualOrGreater(int major, int minor) 48 | { 49 | boolean retVal = hasEqualOrGreater_0(major, minor); 50 | return retVal; 51 | } 52 | 53 | 54 | // 55 | // C++: static bool TargetArchs::hasEqualOrGreaterBin(int major, int minor) 56 | // 57 | 58 | public static boolean hasEqualOrGreaterBin(int major, int minor) 59 | { 60 | boolean retVal = hasEqualOrGreaterBin_0(major, minor); 61 | return retVal; 62 | } 63 | 64 | 65 | // 66 | // C++: static bool TargetArchs::hasEqualOrGreaterPtx(int major, int minor) 67 | // 68 | 69 | public static boolean hasEqualOrGreaterPtx(int major, int minor) 70 | { 71 | boolean retVal = hasEqualOrGreaterPtx_0(major, minor); 72 | return retVal; 73 | } 74 | 75 | 76 | // 77 | // C++: static bool TargetArchs::hasEqualOrLessPtx(int major, int minor) 78 | // 79 | 80 | public static boolean hasEqualOrLessPtx(int major, int minor) 81 | { 82 | boolean retVal = hasEqualOrLessPtx_0(major, minor); 83 | return retVal; 84 | } 85 | 86 | 87 | // 88 | // C++: static bool TargetArchs::hasPtx(int major, int minor) 89 | // 90 | 91 | public static boolean hasPtx(int major, int minor) 92 | { 93 | boolean retVal = hasPtx_0(major, minor); 94 | return retVal; 95 | } 96 | 97 | 98 | @Override 99 | protected void finalize() throws Throwable { 100 | delete(nativeObj); 101 | } 102 | 103 | 104 | 105 | // C++: static bool TargetArchs::builtWith(int feature_set) 106 | private static native boolean builtWith_0(int feature_set); 107 | 108 | // C++: static bool TargetArchs::has(int major, int minor) 109 | private static native boolean has_0(int major, int minor); 110 | 111 | // C++: static bool TargetArchs::hasBin(int major, int minor) 112 | private static native boolean hasBin_0(int major, int minor); 113 | 114 | // C++: static bool TargetArchs::hasEqualOrGreater(int major, int minor) 115 | private static native boolean hasEqualOrGreater_0(int major, int minor); 116 | 117 | // C++: static bool TargetArchs::hasEqualOrGreaterBin(int major, int minor) 118 | private static native boolean hasEqualOrGreaterBin_0(int major, int minor); 119 | 120 | // C++: static bool TargetArchs::hasEqualOrGreaterPtx(int major, int minor) 121 | private static native boolean hasEqualOrGreaterPtx_0(int major, int minor); 122 | 123 | // C++: static bool TargetArchs::hasEqualOrLessPtx(int major, int minor) 124 | private static native boolean hasEqualOrLessPtx_0(int major, int minor); 125 | 126 | // C++: static bool TargetArchs::hasPtx(int major, int minor) 127 | private static native boolean hasPtx_0(int major, int minor); 128 | 129 | // native support for java finalize() 130 | private static native void delete(long nativeObj); 131 | 132 | } 133 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/imgproc/CLAHE.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.imgproc; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | import org.opencv.core.Size; 10 | 11 | // C++: class CLAHE 12 | public class CLAHE extends Algorithm { 13 | 14 | protected CLAHE(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: void CLAHE::apply(Mat src, Mat& dst) 19 | // 20 | 21 | public void apply(Mat src, Mat dst) 22 | { 23 | 24 | apply_0(nativeObj, src.nativeObj, dst.nativeObj); 25 | 26 | return; 27 | } 28 | 29 | 30 | // 31 | // C++: void CLAHE::setClipLimit(double clipLimit) 32 | // 33 | 34 | public void setClipLimit(double clipLimit) 35 | { 36 | 37 | setClipLimit_0(nativeObj, clipLimit); 38 | 39 | return; 40 | } 41 | 42 | 43 | // 44 | // C++: void CLAHE::setTilesGridSize(Size tileGridSize) 45 | // 46 | 47 | public void setTilesGridSize(Size tileGridSize) 48 | { 49 | 50 | setTilesGridSize_0(nativeObj, tileGridSize.width, tileGridSize.height); 51 | 52 | return; 53 | } 54 | 55 | 56 | @Override 57 | protected void finalize() throws Throwable { 58 | delete(nativeObj); 59 | } 60 | 61 | 62 | 63 | // C++: void CLAHE::apply(Mat src, Mat& dst) 64 | private static native void apply_0(long nativeObj, long src_nativeObj, long dst_nativeObj); 65 | 66 | // C++: void CLAHE::setClipLimit(double clipLimit) 67 | private static native void setClipLimit_0(long nativeObj, double clipLimit); 68 | 69 | // C++: void CLAHE::setTilesGridSize(Size tileGridSize) 70 | private static native void setTilesGridSize_0(long nativeObj, double tileGridSize_width, double tileGridSize_height); 71 | 72 | // native support for java finalize() 73 | private static native void delete(long nativeObj); 74 | 75 | } 76 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/ml/CvERTrees.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | import org.opencv.core.Mat; 8 | 9 | // C++: class CvERTrees 10 | /** 11 | *The class implements the Extremely randomized trees algorithm.
12 | * CvERTrees
is inherited from "CvRTrees" and has the same
13 | * interface, so see description of "CvRTrees" class to get details. To set the
14 | * training parameters of Extremely randomized trees the same class "CvRTParams"
15 | * is used.
GBT training parameters.
12 | * 13 | *The structure contains parameters for each single decision tree in the 14 | * ensemble, as well as the whole model characteristics. The structure is 15 | * derived from "CvDTreeParams" but not all of the decision tree parameters are 16 | * supported: cross-validation, pruning, and class priorities are not used.
17 | * 18 | * @see org.opencv.ml.CvGBTreesParams : public CvDTreeParams 19 | */ 20 | public class CvGBTreesParams extends CvDTreeParams { 21 | 22 | protected CvGBTreesParams(long addr) { super(addr); } 23 | 24 | 25 | // 26 | // C++: CvGBTreesParams::CvGBTreesParams() 27 | // 28 | 29 | /** 30 | *By default the following constructor is used: CvGBTreesParams(CvGBTrees.SQUARED_LOSS,
31 | * 200, 0.8f, 0.01f, 3, false)
// C++ code:
34 | * 35 | *: CvDTreeParams(3, 10, 0, false, 10, 0, false, false, 0)
36 | * 37 | * @see org.opencv.ml.CvGBTreesParams.CvGBTreesParams 38 | */ 39 | public CvGBTreesParams() 40 | { 41 | 42 | super( CvGBTreesParams_0() ); 43 | 44 | return; 45 | } 46 | 47 | 48 | // 49 | // C++: int CvGBTreesParams::weak_count 50 | // 51 | 52 | public int get_weak_count() 53 | { 54 | 55 | int retVal = get_weak_count_0(nativeObj); 56 | 57 | return retVal; 58 | } 59 | 60 | 61 | // 62 | // C++: void CvGBTreesParams::weak_count 63 | // 64 | 65 | public void set_weak_count(int weak_count) 66 | { 67 | 68 | set_weak_count_0(nativeObj, weak_count); 69 | 70 | return; 71 | } 72 | 73 | 74 | // 75 | // C++: int CvGBTreesParams::loss_function_type 76 | // 77 | 78 | public int get_loss_function_type() 79 | { 80 | 81 | int retVal = get_loss_function_type_0(nativeObj); 82 | 83 | return retVal; 84 | } 85 | 86 | 87 | // 88 | // C++: void CvGBTreesParams::loss_function_type 89 | // 90 | 91 | public void set_loss_function_type(int loss_function_type) 92 | { 93 | 94 | set_loss_function_type_0(nativeObj, loss_function_type); 95 | 96 | return; 97 | } 98 | 99 | 100 | // 101 | // C++: float CvGBTreesParams::subsample_portion 102 | // 103 | 104 | public float get_subsample_portion() 105 | { 106 | 107 | float retVal = get_subsample_portion_0(nativeObj); 108 | 109 | return retVal; 110 | } 111 | 112 | 113 | // 114 | // C++: void CvGBTreesParams::subsample_portion 115 | // 116 | 117 | public void set_subsample_portion(float subsample_portion) 118 | { 119 | 120 | set_subsample_portion_0(nativeObj, subsample_portion); 121 | 122 | return; 123 | } 124 | 125 | 126 | // 127 | // C++: float CvGBTreesParams::shrinkage 128 | // 129 | 130 | public float get_shrinkage() 131 | { 132 | 133 | float retVal = get_shrinkage_0(nativeObj); 134 | 135 | return retVal; 136 | } 137 | 138 | 139 | // 140 | // C++: void CvGBTreesParams::shrinkage 141 | // 142 | 143 | public void set_shrinkage(float shrinkage) 144 | { 145 | 146 | set_shrinkage_0(nativeObj, shrinkage); 147 | 148 | return; 149 | } 150 | 151 | 152 | @Override 153 | protected void finalize() throws Throwable { 154 | delete(nativeObj); 155 | } 156 | 157 | 158 | 159 | // C++: CvGBTreesParams::CvGBTreesParams() 160 | private static native long CvGBTreesParams_0(); 161 | 162 | // C++: int CvGBTreesParams::weak_count 163 | private static native int get_weak_count_0(long nativeObj); 164 | 165 | // C++: void CvGBTreesParams::weak_count 166 | private static native void set_weak_count_0(long nativeObj, int weak_count); 167 | 168 | // C++: int CvGBTreesParams::loss_function_type 169 | private static native int get_loss_function_type_0(long nativeObj); 170 | 171 | // C++: void CvGBTreesParams::loss_function_type 172 | private static native void set_loss_function_type_0(long nativeObj, int loss_function_type); 173 | 174 | // C++: float CvGBTreesParams::subsample_portion 175 | private static native float get_subsample_portion_0(long nativeObj); 176 | 177 | // C++: void CvGBTreesParams::subsample_portion 178 | private static native void set_subsample_portion_0(long nativeObj, float subsample_portion); 179 | 180 | // C++: float CvGBTreesParams::shrinkage 181 | private static native float get_shrinkage_0(long nativeObj); 182 | 183 | // C++: void CvGBTreesParams::shrinkage 184 | private static native void set_shrinkage_0(long nativeObj, float shrinkage); 185 | 186 | // native support for java finalize() 187 | private static native void delete(long nativeObj); 188 | 189 | } 190 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/ml/CvParamGrid.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | 8 | 9 | // C++: class CvParamGrid 10 | /** 11 | *The structure represents the logarithmic grid range of statmodel parameters. 12 | * It is used for optimizing statmodel accuracy by varying model parameters, the 13 | * accuracy estimate being computed by cross-validation.
14 | * 15 | *Minimum value of the statmodel parameter.
16 | * 17 | *Maximum value of the statmodel parameter.
18 | *
// C++ code:
21 | * 22 | *Logarithmic step for iterating the statmodel parameter.
23 | * 24 | *The grid determines the following iteration sequence of the statmodel 25 | * parameter values:
26 | * 27 | *(min_val, min_val*step, min_val*(step)^2, dots, min_val*(step)^n),
28 | * 29 | *where n is the maximal index satisfying
30 | * 31 | *min_val * step ^n < max_val
32 | * 33 | *The grid is logarithmic, so step
must always be greater then 1.
The constructors.
58 | * 59 | *The full constructor initializes corresponding members. The default 60 | * constructor creates a dummy grid:
61 | * 62 | *// C++ code:
65 | * 66 | *CvParamGrid.CvParamGrid()
67 | * 68 | * 69 | *min_val = max_val = step = 0;
70 | * 71 | * 72 | * @see org.opencv.ml.CvParamGrid.CvParamGrid 73 | */ 74 | public CvParamGrid() 75 | { 76 | 77 | nativeObj = CvParamGrid_0(); 78 | 79 | return; 80 | } 81 | 82 | 83 | // 84 | // C++: double CvParamGrid::min_val 85 | // 86 | 87 | public double get_min_val() 88 | { 89 | 90 | double retVal = get_min_val_0(nativeObj); 91 | 92 | return retVal; 93 | } 94 | 95 | 96 | // 97 | // C++: void CvParamGrid::min_val 98 | // 99 | 100 | public void set_min_val(double min_val) 101 | { 102 | 103 | set_min_val_0(nativeObj, min_val); 104 | 105 | return; 106 | } 107 | 108 | 109 | // 110 | // C++: double CvParamGrid::max_val 111 | // 112 | 113 | public double get_max_val() 114 | { 115 | 116 | double retVal = get_max_val_0(nativeObj); 117 | 118 | return retVal; 119 | } 120 | 121 | 122 | // 123 | // C++: void CvParamGrid::max_val 124 | // 125 | 126 | public void set_max_val(double max_val) 127 | { 128 | 129 | set_max_val_0(nativeObj, max_val); 130 | 131 | return; 132 | } 133 | 134 | 135 | // 136 | // C++: double CvParamGrid::step 137 | // 138 | 139 | public double get_step() 140 | { 141 | 142 | double retVal = get_step_0(nativeObj); 143 | 144 | return retVal; 145 | } 146 | 147 | 148 | // 149 | // C++: void CvParamGrid::step 150 | // 151 | 152 | public void set_step(double step) 153 | { 154 | 155 | set_step_0(nativeObj, step); 156 | 157 | return; 158 | } 159 | 160 | 161 | @Override 162 | protected void finalize() throws Throwable { 163 | delete(nativeObj); 164 | } 165 | 166 | 167 | 168 | // C++: CvParamGrid::CvParamGrid() 169 | private static native long CvParamGrid_0(); 170 | 171 | // C++: double CvParamGrid::min_val 172 | private static native double get_min_val_0(long nativeObj); 173 | 174 | // C++: void CvParamGrid::min_val 175 | private static native void set_min_val_0(long nativeObj, double min_val); 176 | 177 | // C++: double CvParamGrid::max_val 178 | private static native double get_max_val_0(long nativeObj); 179 | 180 | // C++: void CvParamGrid::max_val 181 | private static native void set_max_val_0(long nativeObj, double max_val); 182 | 183 | // C++: double CvParamGrid::step 184 | private static native double get_step_0(long nativeObj); 185 | 186 | // C++: void CvParamGrid::step 187 | private static native void set_step_0(long nativeObj, double step); 188 | 189 | // native support for java finalize() 190 | private static native void delete(long nativeObj); 191 | 192 | } 193 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/ml/CvRTParams.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | import org.opencv.core.TermCriteria; 8 | 9 | // C++: class CvRTParams 10 | /** 11 | *Training parameters of random trees.
12 | * 13 | *The set of training parameters for the forest is a superset of the training 14 | * parameters for a single tree. However, random trees do not need all the 15 | * functionality/features of decision trees. Most noticeably, the trees are not 16 | * pruned, so the cross-validation parameters are not used.
17 | * 18 | * @see org.opencv.ml.CvRTParams : public CvDTreeParams 19 | */ 20 | public class CvRTParams extends CvDTreeParams { 21 | 22 | protected CvRTParams(long addr) { super(addr); } 23 | 24 | 25 | // 26 | // C++: CvRTParams::CvRTParams() 27 | // 28 | 29 | public CvRTParams() 30 | { 31 | 32 | super( CvRTParams_0() ); 33 | 34 | return; 35 | } 36 | 37 | 38 | // 39 | // C++: bool CvRTParams::calc_var_importance 40 | // 41 | 42 | public boolean get_calc_var_importance() 43 | { 44 | 45 | boolean retVal = get_calc_var_importance_0(nativeObj); 46 | 47 | return retVal; 48 | } 49 | 50 | 51 | // 52 | // C++: void CvRTParams::calc_var_importance 53 | // 54 | 55 | public void set_calc_var_importance(boolean calc_var_importance) 56 | { 57 | 58 | set_calc_var_importance_0(nativeObj, calc_var_importance); 59 | 60 | return; 61 | } 62 | 63 | 64 | // 65 | // C++: int CvRTParams::nactive_vars 66 | // 67 | 68 | public int get_nactive_vars() 69 | { 70 | 71 | int retVal = get_nactive_vars_0(nativeObj); 72 | 73 | return retVal; 74 | } 75 | 76 | 77 | // 78 | // C++: void CvRTParams::nactive_vars 79 | // 80 | 81 | public void set_nactive_vars(int nactive_vars) 82 | { 83 | 84 | set_nactive_vars_0(nativeObj, nactive_vars); 85 | 86 | return; 87 | } 88 | 89 | 90 | // 91 | // C++: TermCriteria CvRTParams::term_crit 92 | // 93 | 94 | public TermCriteria get_term_crit() 95 | { 96 | 97 | TermCriteria retVal = new TermCriteria(get_term_crit_0(nativeObj)); 98 | 99 | return retVal; 100 | } 101 | 102 | 103 | // 104 | // C++: void CvRTParams::term_crit 105 | // 106 | 107 | public void set_term_crit(TermCriteria term_crit) 108 | { 109 | 110 | set_term_crit_0(nativeObj, term_crit.type, term_crit.maxCount, term_crit.epsilon); 111 | 112 | return; 113 | } 114 | 115 | 116 | @Override 117 | protected void finalize() throws Throwable { 118 | delete(nativeObj); 119 | } 120 | 121 | 122 | 123 | // C++: CvRTParams::CvRTParams() 124 | private static native long CvRTParams_0(); 125 | 126 | // C++: bool CvRTParams::calc_var_importance 127 | private static native boolean get_calc_var_importance_0(long nativeObj); 128 | 129 | // C++: void CvRTParams::calc_var_importance 130 | private static native void set_calc_var_importance_0(long nativeObj, boolean calc_var_importance); 131 | 132 | // C++: int CvRTParams::nactive_vars 133 | private static native int get_nactive_vars_0(long nativeObj); 134 | 135 | // C++: void CvRTParams::nactive_vars 136 | private static native void set_nactive_vars_0(long nativeObj, int nactive_vars); 137 | 138 | // C++: TermCriteria CvRTParams::term_crit 139 | private static native double[] get_term_crit_0(long nativeObj); 140 | 141 | // C++: void CvRTParams::term_crit 142 | private static native void set_term_crit_0(long nativeObj, int term_crit_type, int term_crit_maxCount, double term_crit_epsilon); 143 | 144 | // native support for java finalize() 145 | private static native void delete(long nativeObj); 146 | 147 | } 148 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/ml/Ml.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | 8 | 9 | public class Ml { 10 | 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/objdetect/Objdetect.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.objdetect; 6 | 7 | import org.opencv.core.Mat; 8 | import org.opencv.core.MatOfInt; 9 | import org.opencv.core.MatOfRect; 10 | 11 | public class Objdetect { 12 | 13 | public static final int 14 | CASCADE_DO_CANNY_PRUNING = 1, 15 | CASCADE_SCALE_IMAGE = 2, 16 | CASCADE_FIND_BIGGEST_OBJECT = 4, 17 | CASCADE_DO_ROUGH_SEARCH = 8; 18 | 19 | 20 | // 21 | // C++: void drawDataMatrixCodes(Mat& image, vector_string codes, Mat corners) 22 | // 23 | 24 | // Unknown type 'vector_string' (I), skipping the function 25 | 26 | 27 | // 28 | // C++: void findDataMatrix(Mat image, vector_string& codes, Mat& corners = Mat(), vector_Mat& dmtx = vector_Mat()) 29 | // 30 | 31 | // Unknown type 'vector_string' (O), skipping the function 32 | 33 | 34 | // 35 | // C++: void groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) 36 | // 37 | 38 | /** 39 | *Groups the object candidate rectangles.
40 | * 41 | *The function is a wrapper for the generic function "partition". It clusters
42 | * all the input rectangles using the rectangle equivalence criteria that
43 | * combines rectangles with similar sizes and similar locations. The similarity
44 | * is defined by eps
. When eps=0
, no clustering is
45 | * done at all. If eps-> +inf, all the rectangles are put in one
46 | * cluster. Then, the small clusters containing less than or equal to
47 | * groupThreshold
rectangles are rejected. In each other cluster,
48 | * the average rectangle is computed and put into the output rectangle list.
Groups the object candidate rectangles.
71 | * 72 | *The function is a wrapper for the generic function "partition". It clusters
73 | * all the input rectangles using the rectangle equivalence criteria that
74 | * combines rectangles with similar sizes and similar locations. The similarity
75 | * is defined by eps
. When eps=0
, no clustering is
76 | * done at all. If eps-> +inf, all the rectangles are put in one
77 | * cluster. Then, the small clusters containing less than or equal to
78 | * groupThreshold
rectangles are rejected. In each other cluster,
79 | * the average rectangle is computed and put into the output rectangle list.
Base class for background/foreground segmentation.
13 | * 14 | *class BackgroundSubtractor : public Algorithm
// C++ code:
17 | * 18 | * 19 | *public:
20 | * 21 | *virtual ~BackgroundSubtractor();
22 | * 23 | *virtual void operator()(InputArray image, OutputArray fgmask, double 24 | * learningRate=0);
25 | * 26 | *virtual void getBackgroundImage(OutputArray backgroundImage) const;
27 | * 28 | *};
29 | * 30 | *The class is only used to define the common interface for the whole family of 31 | * background/foreground segmentation algorithms. 32 | *
33 | * 34 | * @see org.opencv.video.BackgroundSubtractor : public Algorithm 35 | */ 36 | public class BackgroundSubtractor extends Algorithm { 37 | 38 | protected BackgroundSubtractor(long addr) { super(addr); } 39 | 40 | 41 | // 42 | // C++: void BackgroundSubtractor::operator ()(Mat image, Mat& fgmask, double learningRate = 0) 43 | // 44 | 45 | /** 46 | *Computes a foreground mask.
47 | * 48 | * @param image Next video frame. 49 | * @param fgmask The output foreground mask as an 8-bit binary image. 50 | * @param learningRate a learningRate 51 | * 52 | * @see org.opencv.video.BackgroundSubtractor.operator() 53 | */ 54 | public void apply(Mat image, Mat fgmask, double learningRate) 55 | { 56 | 57 | apply_0(nativeObj, image.nativeObj, fgmask.nativeObj, learningRate); 58 | 59 | return; 60 | } 61 | 62 | /** 63 | *Computes a foreground mask.
64 | * 65 | * @param image Next video frame. 66 | * @param fgmask The output foreground mask as an 8-bit binary image. 67 | * 68 | * @see org.opencv.video.BackgroundSubtractor.operator() 69 | */ 70 | public void apply(Mat image, Mat fgmask) 71 | { 72 | 73 | apply_1(nativeObj, image.nativeObj, fgmask.nativeObj); 74 | 75 | return; 76 | } 77 | 78 | 79 | @Override 80 | protected void finalize() throws Throwable { 81 | delete(nativeObj); 82 | } 83 | 84 | 85 | 86 | // C++: void BackgroundSubtractor::operator ()(Mat image, Mat& fgmask, double learningRate = 0) 87 | private static native void apply_0(long nativeObj, long image_nativeObj, long fgmask_nativeObj, double learningRate); 88 | private static native void apply_1(long nativeObj, long image_nativeObj, long fgmask_nativeObj); 89 | 90 | // native support for java finalize() 91 | private static native void delete(long nativeObj); 92 | 93 | } 94 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/java/org/opencv/video/BackgroundSubtractorMOG.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.video; 6 | 7 | 8 | 9 | // C++: class BackgroundSubtractorMOG 10 | /** 11 | *Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
12 | * 13 | *The class implements the algorithm described in P. KadewTraKuPong and R. 14 | * Bowden, *An improved adaptive background mixture model for real-time tracking 15 | * with shadow detection*, Proc. 2nd European Workshop on Advanced Video-Based 16 | * Surveillance Systems, 2001: http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf
17 | * 18 | * @see org.opencv.video.BackgroundSubtractorMOG : public BackgroundSubtractor 19 | */ 20 | public class BackgroundSubtractorMOG extends BackgroundSubtractor { 21 | 22 | protected BackgroundSubtractorMOG(long addr) { super(addr); } 23 | 24 | 25 | // 26 | // C++: BackgroundSubtractorMOG::BackgroundSubtractorMOG() 27 | // 28 | 29 | /** 30 | *The constructors.
31 | * 32 | *Default constructor sets all parameters to default values.
33 | * 34 | * @see org.opencv.video.BackgroundSubtractorMOG.BackgroundSubtractorMOG 35 | */ 36 | public BackgroundSubtractorMOG() 37 | { 38 | 39 | super( BackgroundSubtractorMOG_0() ); 40 | 41 | return; 42 | } 43 | 44 | 45 | // 46 | // C++: BackgroundSubtractorMOG::BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma = 0) 47 | // 48 | 49 | /** 50 | *The constructors.
51 | * 52 | *Default constructor sets all parameters to default values.
53 | * 54 | * @param history Length of the history. 55 | * @param nmixtures Number of Gaussian mixtures. 56 | * @param backgroundRatio Background ratio. 57 | * @param noiseSigma Noise strength. 58 | * 59 | * @see org.opencv.video.BackgroundSubtractorMOG.BackgroundSubtractorMOG 60 | */ 61 | public BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma) 62 | { 63 | 64 | super( BackgroundSubtractorMOG_1(history, nmixtures, backgroundRatio, noiseSigma) ); 65 | 66 | return; 67 | } 68 | 69 | /** 70 | *The constructors.
71 | * 72 | *Default constructor sets all parameters to default values.
73 | * 74 | * @param history Length of the history. 75 | * @param nmixtures Number of Gaussian mixtures. 76 | * @param backgroundRatio Background ratio. 77 | * 78 | * @see org.opencv.video.BackgroundSubtractorMOG.BackgroundSubtractorMOG 79 | */ 80 | public BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio) 81 | { 82 | 83 | super( BackgroundSubtractorMOG_2(history, nmixtures, backgroundRatio) ); 84 | 85 | return; 86 | } 87 | 88 | 89 | @Override 90 | protected void finalize() throws Throwable { 91 | delete(nativeObj); 92 | } 93 | 94 | 95 | 96 | // C++: BackgroundSubtractorMOG::BackgroundSubtractorMOG() 97 | private static native long BackgroundSubtractorMOG_0(); 98 | 99 | // C++: BackgroundSubtractorMOG::BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma = 0) 100 | private static native long BackgroundSubtractorMOG_1(int history, int nmixtures, double backgroundRatio, double noiseSigma); 101 | private static native long BackgroundSubtractorMOG_2(int history, int nmixtures, double backgroundRatio); 102 | 103 | // native support for java finalize() 104 | private static native void delete(long nativeObj); 105 | 106 | } 107 | -------------------------------------------------------------------------------- /openCVLibrary2411/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 |